Search in sources :

Example 1 with ForStmtT

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

the class StatementVisitor method visit.

@Override
public TypedExpression visit(ForStmt n, Void arg) {
    List<TypedExpression> typedInitialization = n.getInitialization().stream().map(this::compileMVEL).collect(Collectors.toList());
    Optional<TypedExpression> typedCompare = n.getCompare().map(c -> new RHSPhase(mvelCompilerContext).invoke(c));
    List<TypedExpression> typedUpdate = n.getUpdate().stream().map(this::compileMVEL).collect(Collectors.toList());
    TypedExpression body = n.getBody().accept(this, arg);
    return new ForStmtT(typedInitialization, typedCompare, typedUpdate, body);
}
Also used : ForStmtT(org.drools.mvelcompiler.ast.ForStmtT) UnalteredTypedExpression(org.drools.mvelcompiler.ast.UnalteredTypedExpression) TypedExpression(org.drools.mvelcompiler.ast.TypedExpression)

Aggregations

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