Class ExpressionReducer
java.lang.Object
org.apache.sling.scripting.sightly.impl.compiler.optimization.reduce.ExpressionReducer
- All Implemented Interfaces:
NodeVisitor<EvalResult>
Try to evaluate constant parts in expressions
-
Method Summary
Modifier and TypeMethodDescriptionevaluate(ArrayLiteral arrayLiteral) Evaluate aArrayLiteralnode.evaluate(BinaryOperation binaryOperation) Evaluate aBinaryOperationnode.evaluate(BooleanConstant booleanConstant) Evaluate aBooleanConstantnode.evaluate(Identifier identifier) Evaluate anIdentifiernode.evaluate(MapLiteral mapLiteral) Evaluate aMapLiteralnode.evaluate(NullLiteral nullLiteral) Evaluate aNullLiteralnode.evaluate(NumericConstant numericConstant) Evaluate aNumericConstantnode.evaluate(PropertyAccess propertyAccess) Evaluate aPropertyAccessnode.evaluate(RuntimeCall runtimeCall) Evaluate aRuntimeCallnode.evaluate(StringConstant text) Evaluate aStringConstantnode.evaluate(TernaryOperator ternaryOperator) Evaluate aTernaryOperatornode.evaluate(UnaryOperation unaryOperation) Evaluate aUnaryOperationnode.static EvalResultreduce(ExpressionNode node, VariableTracker<EvalResult> tracker)
-
Method Details
-
reduce
-
evaluate
Description copied from interface:NodeVisitorEvaluate aPropertyAccessnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
propertyAccess- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate anIdentifiernode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
identifier- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aStringConstantnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
text- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aBinaryOperationnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
binaryOperation- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aBooleanConstantnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
booleanConstant- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aNumericConstantnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
numericConstant- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aUnaryOperationnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
unaryOperation- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aTernaryOperatornode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
ternaryOperator- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aRuntimeCallnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
runtimeCall- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aMapLiteralnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
mapLiteral- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aArrayLiteralnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
arrayLiteral- the node to evaluate- Returns:
- the evaluation result
-
evaluate
Description copied from interface:NodeVisitorEvaluate aNullLiteralnode.- Specified by:
evaluatein interfaceNodeVisitor<EvalResult>- Parameters:
nullLiteral- the node to evaluate- Returns:
- the evaluation result
-