use of org.elasticsearch.painless.node.SDeclaration in project elasticsearch by elastic.
the class Walker method visitDeclaration.
@Override
public ANode visitDeclaration(DeclarationContext ctx) {
String type = ctx.decltype().getText();
List<SDeclaration> declarations = new ArrayList<>();
for (DeclvarContext declvar : ctx.declvar()) {
String name = declvar.ID().getText();
AExpression expression = declvar.expression() == null ? null : (AExpression) visit(declvar.expression());
declarations.add(new SDeclaration(location(declvar), type, name, expression));
}
return new SDeclBlock(location(ctx), declarations);
}
Aggregations