use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.
the class ASTBuilderVisitor method visitQuantExprEvery.
@Override
public BaseNode visitQuantExprEvery(FEEL_1_1Parser.QuantExprEveryContext ctx) {
ListNode list = (ListNode) visit(ctx.iterationContexts());
BaseNode expr = visit(ctx.expression());
return ASTBuilderFactory.newQuantifiedExpression(ctx, QuantifiedExpressionNode.Quantifier.EVERY, list, expr);
}
use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.
the class ASTBuilderVisitor method visitFunctionDefinition.
@Override
public BaseNode visitFunctionDefinition(FEEL_1_1Parser.FunctionDefinitionContext ctx) {
ListNode parameters = null;
if (ctx.formalParameters() != null) {
parameters = (ListNode) visit(ctx.formalParameters());
}
boolean external = ctx.external != null;
BaseNode body = visit(ctx.body);
return ASTBuilderFactory.newFunctionDefinition(ctx, parameters, external, body);
}
use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.
the class ASTBuilderVisitor method visitMultExpression.
@Override
public BaseNode visitMultExpression(FEEL_1_1Parser.MultExpressionContext ctx) {
BaseNode left = visit(ctx.multiplicativeExpression());
BaseNode right = visit(ctx.powerExpression());
String op = ctx.op.getText();
return ASTBuilderFactory.newInfixOpNode(ctx, left, op, right);
}
use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.
the class ASTBuilderVisitor method visitFilterPathExpression.
@Override
public BaseNode visitFilterPathExpression(FEEL_1_1Parser.FilterPathExpressionContext ctx) {
if (ctx.filter != null) {
BaseNode expr = visit(ctx.filterPathExpression());
BaseNode filter = visit(ctx.filter);
expr = ASTBuilderFactory.newFilterExpressionNode(ctx, expr, filter);
return expr;
} else if (ctx.qualifiedName() != null) {
BaseNode expr = visit(ctx.filterPathExpression());
BaseNode path = visit(ctx.qualifiedName());
return ASTBuilderFactory.newPathExpressionNode(ctx, expr, path);
} else {
return visit(ctx.unaryExpression());
}
}
use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.
the class ASTBuilderVisitor method visitInterval.
@Override
public BaseNode visitInterval(FEEL_1_1Parser.IntervalContext ctx) {
BaseNode start = visit(ctx.start);
BaseNode end = visit(ctx.end);
RangeNode.IntervalBoundary low = ctx.low.getText().equals("[") ? RangeNode.IntervalBoundary.CLOSED : RangeNode.IntervalBoundary.OPEN;
RangeNode.IntervalBoundary up = ctx.up.getText().equals("]") ? RangeNode.IntervalBoundary.CLOSED : RangeNode.IntervalBoundary.OPEN;
return ASTBuilderFactory.newIntervalNode(ctx, low, start, end, up);
}
Aggregations