use of org.apache.sling.scripting.sightly.java.compiler.impl.operator.UnaryOpGen in project sling by apache.
the class TypeInference method evaluate.
@Override
public Type evaluate(UnaryOperation unaryOperation) {
infer(unaryOperation.getTarget());
UnaryOpGen opGen = Operators.generatorFor(unaryOperation.getOperator());
return opGen.returnType(infer(unaryOperation.getTarget()));
}
use of org.apache.sling.scripting.sightly.java.compiler.impl.operator.UnaryOpGen 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();
}
Aggregations