Class AbstractDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
- Direct Known Subclasses:
AggregateDfnGenerator
,FunctionDfnGenerator
,ProgramDfnGenerator
Acts as a base for the main construct definitions.
As there are lots of common processing aspects across constructs and, they are
only really very focussed on IR generation (and not reusable elsewhere) hence defined in this base.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final NotImplicitSuper
protected final OperationDfnGenerator
protected final IRGenerationContext
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDfnGenerator
(IRGenerationContext stackContext) Primary constructor using stack context - the single source of truth. -
Method Summary
Modifier and TypeMethodDescriptionprotected CallMetaDataExtractor
Create CallMetaDataExtractor using stack context - the single source of truth.protected DebugInfoCreator
Create DebugInfoCreator using stack context - the single source of truth.protected void
createInitOperation
(IRConstruct construct, IScope aggregateSymbol, ISymbol superType) Create c_init operation for class/static initialization.protected void
createInstanceInitOperation
(IRConstruct construct, IScope symbol, EK9Parser.AggregatePartsContext ctx) Create i_init operation for instance initialization.protected ParsedModule
Get the parsed module from stack context - the single source of truth.protected IRContext
Create a new IRContext for per-construct isolation.protected OperationInstr
newSyntheticInitOperation
(IScope scope, String methodName) protected void
processAsMethodOrOperator
(IRConstruct construct, ISymbol symbol, EK9Parser.OperationDetailsContext ctx) Process all properties for instance initialization.protected void
processSyntheticConstructor
(IRConstruct construct, MethodSymbol constructorSymbol, IScopedSymbol superType) Process a synthetic constructor (default constructor created by earlier phases).
-
Field Details
-
notImplicitSuper
-
operationDfnGenerator
-
stackContext
-
voidStr
-
-
Constructor Details
-
AbstractDfnGenerator
AbstractDfnGenerator(IRGenerationContext stackContext) Primary constructor using stack context - the single source of truth.
-
-
Method Details
-
getParsedModule
Get the parsed module from stack context - the single source of truth. -
createCallMetaDataExtractor
Create CallMetaDataExtractor using stack context - the single source of truth. -
createDebugInfoCreator
Create DebugInfoCreator using stack context - the single source of truth. -
processAsMethodOrOperator
protected void processAsMethodOrOperator(IRConstruct construct, ISymbol symbol, EK9Parser.OperationDetailsContext ctx) -
newPerConstructContext
Create a new IRContext for per-construct isolation. This ensures each construct gets fresh block labeling (_entry_1, _temp_1, etc.) while sharing the core parsedModule and compilerFlags. -
newSyntheticInitOperation
-
createInitOperation
protected void createInitOperation(IRConstruct construct, IScope aggregateSymbol, ISymbol superType) Create c_init operation for class/static initialization. This runs once per class loading. -
createInstanceInitOperation
protected void createInstanceInitOperation(IRConstruct construct, IScope symbol, EK9Parser.AggregatePartsContext ctx) Create i_init operation for instance initialization. This handles property REFERENCE declarations and immediate initializations. -
processPropertiesForInstanceInit
Process all properties for instance initialization. Generates REFERENCE declarations and immediate initializations. -
processSyntheticConstructor
protected void processSyntheticConstructor(IRConstruct construct, MethodSymbol constructorSymbol, IScopedSymbol superType) Process a synthetic constructor (default constructor created by earlier phases). Implements proper constructor inheritance chain: 1. Call super constructor (if not implicit base class) 2. Call own class's i_init method 3. Return this
-