use of org.kie.dmn.feel.parser.feel11.FEEL_1_1Parser.TypeContext in project drools by kiegroup.
the class ASTBuilderVisitor method visitContextType.
@Override
public BaseNode visitContextType(FEEL_1_1Parser.ContextTypeContext ctx) {
List<String> pNames = new ArrayList<>();
for (TerminalNode id : ctx.Identifier()) {
pNames.add(id.getText());
}
if (!pNames.get(0).equals("context")) {
throw new IllegalStateException("grammar rule changed.");
} else {
pNames.remove(0);
}
List<TypeNode> pTypes = new ArrayList<>();
for (TypeContext t : ctx.type()) {
pTypes.add((TypeNode) visit(t));
}
Map<String, TypeNode> gens = new HashMap<>();
for (int i = 0; i < pNames.size(); i++) {
gens.put(pNames.get(i), pTypes.get(i));
}
return new ContextTypeNode(ctx, gens);
}
use of org.kie.dmn.feel.parser.feel11.FEEL_1_1Parser.TypeContext in project drools by kiegroup.
the class ASTBuilderVisitor method visitFunctionType.
@Override
public BaseNode visitFunctionType(FEEL_1_1Parser.FunctionTypeContext ctx) {
List<TypeNode> argTypes = new ArrayList<>();
for (TypeContext t : ctx.type()) {
argTypes.add((TypeNode) visit(t));
}
TypeNode type = argTypes.remove(argTypes.size() - 1);
return new FunctionTypeNode(ctx, argTypes, type);
}
Aggregations