use of org.elasticsearch.painless.antlr.PainlessParser.DecltypeContext in project elasticsearch by elastic.
the class Walker method visitFunction.
@Override
public ANode visitFunction(FunctionContext ctx) {
reserved.push(new FunctionReserved());
String rtnType = ctx.decltype().getText();
String name = ctx.ID().getText();
List<String> paramTypes = new ArrayList<>();
List<String> paramNames = new ArrayList<>();
List<AStatement> statements = new ArrayList<>();
for (DecltypeContext decltype : ctx.parameters().decltype()) {
paramTypes.add(decltype.getText());
}
for (TerminalNode id : ctx.parameters().ID()) {
paramNames.add(id.getText());
}
for (StatementContext statement : ctx.block().statement()) {
statements.add((AStatement) visit(statement));
}
return new SFunction((FunctionReserved) reserved.pop(), location(ctx), rtnType, name, paramTypes, paramNames, statements, false);
}
Aggregations