com.google.clearsilver.jsilver.interpreter
Class ExpressionEvaluator
java.lang.Object
com.google.clearsilver.jsilver.syntax.analysis.AnalysisAdapter
com.google.clearsilver.jsilver.syntax.analysis.DepthFirstAdapter
com.google.clearsilver.jsilver.interpreter.ExpressionEvaluator
- All Implemented Interfaces:
- Analysis, Switch
public class ExpressionEvaluator
- extends DepthFirstAdapter
Walks the tree of a PExpression node and evaluates the expression.
- See Also:
evaluate(PExpression)
Methods inherited from class com.google.clearsilver.jsilver.syntax.analysis.DepthFirstAdapter |
caseAAltCommand, caseAAutoescapeCommand, caseACallCommand, caseACommaExpression, caseACommentCommand, caseAContentTypeCommand, caseACsOpenPosition, caseADataCommand, caseADecNumberVariable, caseADefCommand, caseADescendVariable, caseAEachCommand, caseAEscapeCommand, caseAEvarCommand, caseAExpandVariable, caseAHardIncludeCommand, caseAHardLincludeCommand, caseAHexNumberVariable, caseAIfCommand, caseAIncludeCommand, caseAInlineCommand, caseALincludeCommand, caseALoopCommand, caseALoopIncCommand, caseALoopToCommand, caseALvarCommand, caseAMultipleCommand, caseANameCommand, caseANameVariable, caseANoopCommand, caseANoopExpression, caseASequenceExpression, caseASetCommand, caseAUvarCommand, caseAVarCommand, caseAWithCommand, caseStart, defaultIn, defaultOut, inAAddExpression, inAAltCommand, inAAndExpression, inAAutoescapeCommand, inACallCommand, inACommaExpression, inACommentCommand, inAContentTypeCommand, inACsOpenPosition, inADataCommand, inADecimalExpression, inADecNumberVariable, inADefCommand, inADescendVariable, inADivideExpression, inAEachCommand, inAEqExpression, inAEscapeCommand, inAEvarCommand, inAExistsExpression, inAExpandVariable, inAFunctionExpression, inAGteExpression, inAGtExpression, inAHardIncludeCommand, inAHardLincludeCommand, inAHexExpression, inAHexNumberVariable, inAIfCommand, inAIncludeCommand, inAInlineCommand, inALincludeCommand, inALoopCommand, inALoopIncCommand, inALoopToCommand, inALteExpression, inALtExpression, inALvarCommand, inAModuloExpression, inAMultipleCommand, inAMultiplyExpression, inANameCommand, inANameVariable, inANeExpression, inANegativeExpression, inANoopCommand, inANoopExpression, inANotExpression, inANumericAddExpression, inANumericEqExpression, inANumericExpression, inANumericNeExpression, inAOrExpression, inASequenceExpression, inASetCommand, inAStringExpression, inASubtractExpression, inAUvarCommand, inAVarCommand, inAVariableExpression, inAWithCommand, inStart, outAAddExpression, outAAltCommand, outAAndExpression, outAAutoescapeCommand, outACallCommand, outACommaExpression, outACommentCommand, outAContentTypeCommand, outACsOpenPosition, outADataCommand, outADecimalExpression, outADecNumberVariable, outADefCommand, outADescendVariable, outADivideExpression, outAEachCommand, outAEqExpression, outAEscapeCommand, outAEvarCommand, outAExistsExpression, outAExpandVariable, outAFunctionExpression, outAGteExpression, outAGtExpression, outAHardIncludeCommand, outAHardLincludeCommand, outAHexExpression, outAHexNumberVariable, outAIfCommand, outAIncludeCommand, outAInlineCommand, outALincludeCommand, outALoopCommand, outALoopIncCommand, outALoopToCommand, outALteExpression, outALtExpression, outALvarCommand, outAModuloExpression, outAMultipleCommand, outAMultiplyExpression, outANameCommand, outANameVariable, outANeExpression, outANegativeExpression, outANoopCommand, outANoopExpression, outANotExpression, outANumericAddExpression, outANumericEqExpression, outANumericExpression, outANumericNeExpression, outAOrExpression, outASequenceExpression, outASetCommand, outAStringExpression, outASubtractExpression, outAUvarCommand, outAVarCommand, outAVariableExpression, outAWithCommand, outStart |
Methods inherited from class com.google.clearsilver.jsilver.syntax.analysis.AnalysisAdapter |
caseEOF, caseTAlt, caseTAnd, caseTArgWhitespace, caseTAssignment, caseTAutoescape, caseTBang, caseTBracketClose, caseTBracketOpen, caseTCall, caseTComma, caseTCommandDelimiter, caseTComment, caseTCommentStart, caseTContentType, caseTCsClose, caseTCsOpen, caseTData, caseTDecNumber, caseTDef, caseTDollar, caseTDot, caseTEach, caseTElse, caseTElseIf, caseTEq, caseTEscape, caseTEvar, caseTGt, caseTGte, caseTHardDelimiter, caseTHash, caseTHexNumber, caseTIf, caseTInclude, caseTInline, caseTLinclude, caseTLoop, caseTLt, caseTLte, caseTLvar, caseTMinus, caseTName, caseTNe, caseTOr, caseTParenClose, caseTParenOpen, caseTPercent, caseTPlus, caseTQuestion, caseTSet, caseTSlash, caseTStar, caseTString, caseTUvar, caseTVar, caseTWith, caseTWord, defaultCase, getIn, getOut, setIn, setOut |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExpressionEvaluator
public ExpressionEvaluator(DataContext context,
FunctionExecutor functionExecutor)
- Parameters:
context
- functionExecutor
- Used for executing functions in expressions. As well as looking up
named functions (e.g. html_escape), it also uses
evaluate
public Value evaluate(PExpression expression)
- Evaluate an expression into a single value.
caseAVariableExpression
public void caseAVariableExpression(AVariableExpression node)
- Specified by:
caseAVariableExpression
in interface Analysis
- Overrides:
caseAVariableExpression
in class DepthFirstAdapter
caseAStringExpression
public void caseAStringExpression(AStringExpression node)
- Specified by:
caseAStringExpression
in interface Analysis
- Overrides:
caseAStringExpression
in class DepthFirstAdapter
caseADecimalExpression
public void caseADecimalExpression(ADecimalExpression node)
- Specified by:
caseADecimalExpression
in interface Analysis
- Overrides:
caseADecimalExpression
in class DepthFirstAdapter
caseAHexExpression
public void caseAHexExpression(AHexExpression node)
- Specified by:
caseAHexExpression
in interface Analysis
- Overrides:
caseAHexExpression
in class DepthFirstAdapter
caseANumericExpression
public void caseANumericExpression(ANumericExpression node)
- Specified by:
caseANumericExpression
in interface Analysis
- Overrides:
caseANumericExpression
in class DepthFirstAdapter
caseANotExpression
public void caseANotExpression(ANotExpression node)
- Specified by:
caseANotExpression
in interface Analysis
- Overrides:
caseANotExpression
in class DepthFirstAdapter
caseAExistsExpression
public void caseAExistsExpression(AExistsExpression node)
- Specified by:
caseAExistsExpression
in interface Analysis
- Overrides:
caseAExistsExpression
in class DepthFirstAdapter
caseAEqExpression
public void caseAEqExpression(AEqExpression node)
- Specified by:
caseAEqExpression
in interface Analysis
- Overrides:
caseAEqExpression
in class DepthFirstAdapter
caseANumericEqExpression
public void caseANumericEqExpression(ANumericEqExpression node)
- Specified by:
caseANumericEqExpression
in interface Analysis
- Overrides:
caseANumericEqExpression
in class DepthFirstAdapter
caseANeExpression
public void caseANeExpression(ANeExpression node)
- Specified by:
caseANeExpression
in interface Analysis
- Overrides:
caseANeExpression
in class DepthFirstAdapter
caseANumericNeExpression
public void caseANumericNeExpression(ANumericNeExpression node)
- Specified by:
caseANumericNeExpression
in interface Analysis
- Overrides:
caseANumericNeExpression
in class DepthFirstAdapter
caseALtExpression
public void caseALtExpression(ALtExpression node)
- Specified by:
caseALtExpression
in interface Analysis
- Overrides:
caseALtExpression
in class DepthFirstAdapter
caseAGtExpression
public void caseAGtExpression(AGtExpression node)
- Specified by:
caseAGtExpression
in interface Analysis
- Overrides:
caseAGtExpression
in class DepthFirstAdapter
caseALteExpression
public void caseALteExpression(ALteExpression node)
- Specified by:
caseALteExpression
in interface Analysis
- Overrides:
caseALteExpression
in class DepthFirstAdapter
caseAGteExpression
public void caseAGteExpression(AGteExpression node)
- Specified by:
caseAGteExpression
in interface Analysis
- Overrides:
caseAGteExpression
in class DepthFirstAdapter
caseAAndExpression
public void caseAAndExpression(AAndExpression node)
- Specified by:
caseAAndExpression
in interface Analysis
- Overrides:
caseAAndExpression
in class DepthFirstAdapter
caseAOrExpression
public void caseAOrExpression(AOrExpression node)
- Specified by:
caseAOrExpression
in interface Analysis
- Overrides:
caseAOrExpression
in class DepthFirstAdapter
caseAAddExpression
public void caseAAddExpression(AAddExpression node)
- Specified by:
caseAAddExpression
in interface Analysis
- Overrides:
caseAAddExpression
in class DepthFirstAdapter
caseANumericAddExpression
public void caseANumericAddExpression(ANumericAddExpression node)
- Specified by:
caseANumericAddExpression
in interface Analysis
- Overrides:
caseANumericAddExpression
in class DepthFirstAdapter
caseASubtractExpression
public void caseASubtractExpression(ASubtractExpression node)
- Specified by:
caseASubtractExpression
in interface Analysis
- Overrides:
caseASubtractExpression
in class DepthFirstAdapter
caseAMultiplyExpression
public void caseAMultiplyExpression(AMultiplyExpression node)
- Specified by:
caseAMultiplyExpression
in interface Analysis
- Overrides:
caseAMultiplyExpression
in class DepthFirstAdapter
caseADivideExpression
public void caseADivideExpression(ADivideExpression node)
- Specified by:
caseADivideExpression
in interface Analysis
- Overrides:
caseADivideExpression
in class DepthFirstAdapter
caseAModuloExpression
public void caseAModuloExpression(AModuloExpression node)
- Specified by:
caseAModuloExpression
in interface Analysis
- Overrides:
caseAModuloExpression
in class DepthFirstAdapter
caseANegativeExpression
public void caseANegativeExpression(ANegativeExpression node)
- Specified by:
caseANegativeExpression
in interface Analysis
- Overrides:
caseANegativeExpression
in class DepthFirstAdapter
caseAFunctionExpression
public void caseAFunctionExpression(AFunctionExpression node)
- Specified by:
caseAFunctionExpression
in interface Analysis
- Overrides:
caseAFunctionExpression
in class DepthFirstAdapter
Copyright © 2010-2012 Google. All Rights Reserved.