Search in sources :

Example 6 with ContextEntryNode

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

the class ASTBuilderVisitor method visitContextEntries.

@Override
public BaseNode visitContextEntries(FEEL_1_1Parser.ContextEntriesContext ctx) {
    List<BaseNode> nodes = new ArrayList<>();
    scopeHelper.pushScope();
    for (FEEL_1_1Parser.ContextEntryContext c : ctx.contextEntry()) {
        // forced cast similarly to visitFunctionDefinition() method
        ContextEntryNode visited = (ContextEntryNode) visit(c);
        if (visited != null) {
            nodes.add(visited);
            scopeHelper.addType(visited.getName().getText(), visited.getResultType());
        }
    }
    scopeHelper.popScope();
    return ASTBuilderFactory.newListNode(ctx, nodes);
}
Also used : BaseNode(org.kie.dmn.feel.lang.ast.BaseNode) ArrayList(java.util.ArrayList) ContextEntryNode(org.kie.dmn.feel.lang.ast.ContextEntryNode)

Aggregations

BaseNode (org.kie.dmn.feel.lang.ast.BaseNode)6 ContextEntryNode (org.kie.dmn.feel.lang.ast.ContextEntryNode)6 Test (org.junit.Test)5 ContextNode (org.kie.dmn.feel.lang.ast.ContextNode)5 IterationContextNode (org.kie.dmn.feel.lang.ast.IterationContextNode)5 NameDefNode (org.kie.dmn.feel.lang.ast.NameDefNode)5 FunctionDefNode (org.kie.dmn.feel.lang.ast.FunctionDefNode)2 ArrayList (java.util.ArrayList)1 QualifiedNameNode (org.kie.dmn.feel.lang.ast.QualifiedNameNode)1