Search in sources :

Example 21 with ExpressionNode

use of org.apache.sling.scripting.sightly.compiler.expression.ExpressionNode in project sling by apache.

the class ExpressionTranslator method visit.

@Override
public void visit(UnaryOperation unaryOperation) {
    UnaryOperator operator = unaryOperation.getOperator();
    ExpressionNode operand = unaryOperation.getTarget();
    UnaryOpGen unaryOpGen = Operators.generatorFor(operator);
    source.startExpression();
    unaryOpGen.generate(source, this, typeInfo.getTyped(operand));
    source.endExpression();
}
Also used : ExpressionNode(org.apache.sling.scripting.sightly.compiler.expression.ExpressionNode) UnaryOpGen(org.apache.sling.scripting.sightly.java.compiler.impl.operator.UnaryOpGen) UnaryOperator(org.apache.sling.scripting.sightly.compiler.expression.nodes.UnaryOperator)

Aggregations

ExpressionNode (org.apache.sling.scripting.sightly.compiler.expression.ExpressionNode)21 HashMap (java.util.HashMap)9 VariableBinding (org.apache.sling.scripting.sightly.compiler.commands.VariableBinding)7 MapLiteral (org.apache.sling.scripting.sightly.compiler.expression.nodes.MapLiteral)7 RuntimeCall (org.apache.sling.scripting.sightly.compiler.expression.nodes.RuntimeCall)7 StringConstant (org.apache.sling.scripting.sightly.compiler.expression.nodes.StringConstant)7 ArrayList (java.util.ArrayList)6 Expression (org.apache.sling.scripting.sightly.compiler.expression.Expression)6 Identifier (org.apache.sling.scripting.sightly.compiler.expression.nodes.Identifier)5 NumericConstant (org.apache.sling.scripting.sightly.compiler.expression.nodes.NumericConstant)5 Conditional (org.apache.sling.scripting.sightly.compiler.commands.Conditional)4 ArrayLiteral (org.apache.sling.scripting.sightly.compiler.expression.nodes.ArrayLiteral)4 ExpressionWrapper (org.apache.sling.scripting.sightly.impl.compiler.frontend.ExpressionWrapper)4 Interpolation (org.apache.sling.scripting.sightly.impl.compiler.frontend.Interpolation)4 Test (org.junit.Test)4 BinaryOperation (org.apache.sling.scripting.sightly.compiler.expression.nodes.BinaryOperation)3 PushStream (org.apache.sling.scripting.sightly.impl.compiler.PushStream)3 Map (java.util.Map)2 Loop (org.apache.sling.scripting.sightly.compiler.commands.Loop)2 OutputVariable (org.apache.sling.scripting.sightly.compiler.commands.OutputVariable)2