use of org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterContext in project groovy by apache.
the class AstBuilder method transformRecordHeaderToProperties.
private void transformRecordHeaderToProperties(ClassDeclarationContext ctx, ClassNode classNode) {
Parameter[] parameters = this.visitFormalParameters(ctx.formalParameters());
classNode.putNodeMetaData(RECORD_HEADER, parameters);
final int n = parameters.length;
for (int i = 0; i < n; i += 1) {
Parameter parameter = parameters[i];
FormalParameterContext parameterCtx = parameter.getNodeMetaData(PARAMETER_CONTEXT);
ModifierManager parameterModifierManager = parameter.getNodeMetaData(PARAMETER_MODIFIER_MANAGER);
ClassNode originType = parameter.getOriginType();
PropertyNode propertyNode = declareProperty(parameterCtx, parameterModifierManager, originType, classNode, i, parameter, parameter.getName(), parameter.getModifiers(), parameter.getInitialExpression());
propertyNode.getField().putNodeMetaData(IS_RECORD_GENERATED, Boolean.TRUE);
}
}
Aggregations