Class AggregateDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.AggregateDfnGenerator
- Direct Known Subclasses:
ClassDfnGenerator, ComponentDfnGenerator, DynamicClassDfnGenerator, RecordDfnGenerator, TraitDfnGenerator
Common code of Aggregate Construct types.
-
Field Summary
Fields inherited from class AbstractDfnGenerator
generators, notImplicitSuper, operationDfnGenerator, stackContext, synthesisedCallMetaData, voidStr -
Constructor Summary
ConstructorsConstructorDescriptionAggregateDfnGenerator(IRGenerationContext stackContext, SymbolGenus forGenus) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateFieldDeclarations(IRConstruct construct, AggregateSymbol aggregateSymbol) Create field declarations using AggregateSymbol.getProperties().protected voidcreateInitializationOperations(IRConstruct construct, AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) Create the three-phase initialization operations for the class: 1.protected voidcreateOperationsForAggregateParts(IRConstruct construct, AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) protected IRConstructprocessAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) protected List<MethodSymbol> withFieldSetStatusCarrier(AggregateSymbol aggregateSymbol) The aggregate's own methods, plus the synthetic_fieldSetStatuscarrier if it needs one.
-
Constructor Details
-
AggregateDfnGenerator
AggregateDfnGenerator(IRGenerationContext stackContext, SymbolGenus forGenus)
-
-
Method Details
-
processAggregate
protected IRConstruct processAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) -
createFieldDeclarations
Create field declarations using AggregateSymbol.getProperties(). This provides structural metadata about the class's data members, separate from the behavioral operations (methods). -
createInitializationOperations
protected void createInitializationOperations(IRConstruct construct, AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) Create the three-phase initialization operations for the class: 1. c_init - Class/static initialization 2. i_init - Instance initialization (property declarations and immediate initialization) 3. Constructor methods will be processed separately in createOperationsForAggregateParts -
createOperationsForAggregateParts
protected void createOperationsForAggregateParts(IRConstruct construct, AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) -
withFieldSetStatusCarrier
The aggregate's own methods, plus the synthetic_fieldSetStatuscarrier if it needs one.The carrier is detached - created for this construct's operations list and never defined into the aggregate's scope. That is what removes the shared-model mutation during the parallel IR phase, and with it the single-threaded pre-pass that existed to stop it racing (F37). It is appended last, which is exactly where
define()used to put it, so the emitted operation order is unchanged.The method returns a Bits value where each bit represents a field's set status. Using Bits instead of Integer removes the 32-field limit.
-