use of org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantsContext in project groovy by apache.
the class AstBuilder method visitEnumConstants.
@Override
public List<FieldNode> visitEnumConstants(final EnumConstantsContext ctx) {
ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
Objects.requireNonNull(classNode, "classNode should not be null");
return ctx.enumConstant().stream().map(e -> {
e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
return this.visitEnumConstant(e);
}).collect(Collectors.toList());
}
Aggregations