Class AggregateDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.AggregateDfnGenerator
- Direct Known Subclasses:
ClassDfnGenerator, ComponentDfnGenerator, DynamicClassDfnGenerator, RecordDfnGenerator, ServiceDfnGenerator, TraitDfnGenerator
Common code of Aggregate Construct types.
-
Field Summary
Fields inherited from class AbstractDfnGenerator
generators, notImplicitSuper, operationDfnGenerator, stackContext, synthesisedCallMetaData -
Constructor Summary
ConstructorsConstructorDescriptionAggregateDfnGenerator(IRGenerationContext stackContext, SymbolGenus forGenus) -
Method Summary
Modifier and TypeMethodDescriptionbeforeInstanceInit(OperationInstr operation) What a constructor does between its construction call and its_i_init, while its body is built: nothing, but for a dynamic class's capture constructor (DynamicClassDfnGenerator), which stores the captured values there.protected 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, OperationBodyLocator bodies) protected voidThe aggregate about to be generated is a monomorphised copy of a dynamic class (see the field): match its methods to their declarations by source token.protected IRConstructprocessAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) An aggregate whose members are declared in itsaggregateParts(a class, record, trait or component, or a monomorphised copy of one): those parts also hold the property initialisers of its_i_init.protected IRConstructprocessAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext propertiesCtx, OperationBodyLocator bodies) THE construct skeleton of an aggregate: traits, fields,_c_init,_i_init(frompropertiesCtx, null when the aggregate has no property initialisers to run), then every method and operator - each written body found throughbodies, everything else synthesised.protected List<MethodSymbol> withFieldSetStatusCarrier(AggregateSymbol aggregateSymbol) The aggregate's own methods, plus the synthetic_fieldSetStatuscarrier if it needs one.Methods inherited from class AbstractDfnGenerator
createEmptyInitOperation, createInitOperation, createInstanceInitOperation, getParsedModule, newSyntheticInitOperation, processAsMethodOrOperator, processAsMethodOrOperator, processPropertiesForInstanceInit, processSyntheticConstructor, processSyntheticConstructor, processSyntheticConstructor
-
Constructor Details
-
AggregateDfnGenerator
AggregateDfnGenerator(IRGenerationContext stackContext, SymbolGenus forGenus)
-
-
Method Details
-
matchClonedMethodsBySourceToken
protected void matchClonedMethodsBySourceToken()The aggregate about to be generated is a monomorphised copy of a dynamic class (see the field): match its methods to their declarations by source token. -
processAggregate
protected IRConstruct processAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext ctx) An aggregate whose members are declared in itsaggregateParts(a class, record, trait or component, or a monomorphised copy of one): those parts also hold the property initialisers of its_i_init. -
processAggregate
protected IRConstruct processAggregate(AggregateSymbol aggregateSymbol, EK9Parser.AggregatePartsContext propertiesCtx, OperationBodyLocator bodies) THE construct skeleton of an aggregate: traits, fields,_c_init,_i_init(frompropertiesCtx, null when the aggregate has no property initialisers to run), then every method and operator - each written body found throughbodies, everything else synthesised. -
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, OperationBodyLocator bodies) -
beforeInstanceInit
What a constructor does between its construction call and its_i_init, while its body is built: nothing, but for a dynamic class's capture constructor (DynamicClassDfnGenerator), which stores the captured values there. -
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.
-