Search in sources :

Example 1 with IfStmtT

use of org.drools.mvelcompiler.ast.IfStmtT in project drools by kiegroup.

the class StatementVisitor method visit.

@Override
public TypedExpression visit(IfStmt n, Void arg) {
    TypedExpression typedCondition = new RHSPhase(mvelCompilerContext).invoke(n.getCondition());
    TypedExpression typedThen = n.getThenStmt().accept(this, arg);
    Optional<TypedExpression> typedElse = n.getElseStmt().map(e -> e.accept(this, arg));
    return new IfStmtT(typedCondition, typedThen, typedElse);
}
Also used : IfStmtT(org.drools.mvelcompiler.ast.IfStmtT) UnalteredTypedExpression(org.drools.mvelcompiler.ast.UnalteredTypedExpression) TypedExpression(org.drools.mvelcompiler.ast.TypedExpression)

Aggregations

IfStmtT (org.drools.mvelcompiler.ast.IfStmtT)1 TypedExpression (org.drools.mvelcompiler.ast.TypedExpression)1 UnalteredTypedExpression (org.drools.mvelcompiler.ast.UnalteredTypedExpression)1