Search in sources :

Example 6 with BaseNode

use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.

the class ASTBuilderVisitor method visitCompExpression.

@Override
public BaseNode visitCompExpression(FEEL_1_1Parser.CompExpressionContext ctx) {
    BaseNode left = visit(ctx.left);
    BaseNode right = visit(ctx.right);
    return ASTBuilderFactory.newInfixOpNode(ctx, left, ctx.op.getText(), right);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode)

Example 7 with BaseNode

use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.

the class ASTBuilderVisitor method visitRelExpressionTestList.

@Override
public BaseNode visitRelExpressionTestList(FEEL_1_1Parser.RelExpressionTestListContext ctx) {
    BaseNode value = visit(ctx.val);
    BaseNode list = visit(ctx.simpleUnaryTests());
    return ASTBuilderFactory.newInNode(ctx, value, list);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode)

Example 8 with BaseNode

use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.

the class ASTBuilderVisitor method visitForExpression.

@Override
public BaseNode visitForExpression(FEEL_1_1Parser.ForExpressionContext ctx) {
    ListNode list = (ListNode) visit(ctx.iterationContexts());
    BaseNode expr = visit(ctx.expression());
    return ASTBuilderFactory.newForExpression(ctx, list, expr);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode) ListNode(org.kie.dmn.feel.lang.ast.ListNode)

Example 9 with BaseNode

use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.

the class ASTBuilderVisitor method visitRelExpressionBetween.

@Override
public BaseNode visitRelExpressionBetween(FEEL_1_1Parser.RelExpressionBetweenContext ctx) {
    BaseNode value = visit(ctx.val);
    BaseNode start = visit(ctx.start);
    BaseNode end = visit(ctx.end);
    return ASTBuilderFactory.newBetweenNode(ctx, value, start, end);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode)

Example 10 with BaseNode

use of org.kie.dmn.feel.lang.ast.BaseNode in project drools by kiegroup.

the class ASTBuilderVisitor method visitPositiveUnaryTestIneq.

@Override
public BaseNode visitPositiveUnaryTestIneq(FEEL_1_1Parser.PositiveUnaryTestIneqContext ctx) {
    BaseNode value = visit(ctx.endpoint());
    String op = ctx.op.getText();
    return ASTBuilderFactory.newUnaryTestNode(ctx, op, value);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode)

Aggregations

BaseNode (org.kie.dmn.feel.lang.ast.BaseNode)84 Test (org.junit.Test)54 ListNode (org.kie.dmn.feel.lang.ast.ListNode)12 InfixOpNode (org.kie.dmn.feel.lang.ast.InfixOpNode)11 FunctionInvocationNode (org.kie.dmn.feel.lang.ast.FunctionInvocationNode)7 IterationContextNode (org.kie.dmn.feel.lang.ast.IterationContextNode)7 NameDefNode (org.kie.dmn.feel.lang.ast.NameDefNode)7 ContextEntryNode (org.kie.dmn.feel.lang.ast.ContextEntryNode)6 ContextNode (org.kie.dmn.feel.lang.ast.ContextNode)6 PathExpressionNode (org.kie.dmn.feel.lang.ast.PathExpressionNode)4 SignedUnaryNode (org.kie.dmn.feel.lang.ast.SignedUnaryNode)4 ParseTree (org.antlr.v4.runtime.tree.ParseTree)3 InNode (org.kie.dmn.feel.lang.ast.InNode)3 InstanceOfNode (org.kie.dmn.feel.lang.ast.InstanceOfNode)3 RangeNode (org.kie.dmn.feel.lang.ast.RangeNode)3 ArrayList (java.util.ArrayList)2 CompiledExpression (org.kie.dmn.feel.lang.CompiledExpression)2 FunctionDefNode (org.kie.dmn.feel.lang.ast.FunctionDefNode)2 NamedParameterNode (org.kie.dmn.feel.lang.ast.NamedParameterNode)2 QualifiedNameNode (org.kie.dmn.feel.lang.ast.QualifiedNameNode)2