use of org.kie.dmn.feel.lang.ast.FunctionTypeNode in project drools by kiegroup.
the class ASTCompilerVisitor method visit.
@Override
public DirectCompilerResult visit(FunctionTypeNode n) {
List<DirectCompilerResult> args = new ArrayList<>();
for (TypeNode arg : n.getArgTypes()) {
args.add(arg.accept(this));
}
DirectCompilerResult ret = n.getRetType().accept(this);
return DirectCompilerResult.of(Expressions.genFnType(args.stream().map(DirectCompilerResult::getExpression).collect(Collectors.toList()), ret.getExpression()), BuiltInType.UNKNOWN, mergeFDs(args)).withFD(ret);
}
use of org.kie.dmn.feel.lang.ast.FunctionTypeNode 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