Class AbstractGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
- Direct Known Subclasses:
AbstractShortCircuitGenerator
,AbstractVariableDeclGenerator
,AssertStmtGenerator
,AssignExpressionToSymbol
,AssignmentExprInstrGenerator
,AssignmentStmtGenerator
,BasicBlockInstrGenerator
,BinaryOperationGenerator
,BlockStmtInstrGenerator
,CallInstrGenerator
,ControlFlowChainGenerator
,ExprInstrGenerator
,GuardedAssignmentBlockGenerator
,GuardedAssignmentGenerator
,ObjectAccessInstrGenerator
,PrimaryReferenceGenerator
,QuestionBlockGenerator
,StmtInstrGenerator
,UnaryOperationGenerator
,VariableOnlyDeclInstrGenerator
Acts as base for most generators as they all require the context and in most cases
need to generate debug information.
Uses stack-based IRGenerationContext for state management, eliminating parameter threading.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DebugInfoCreator
protected final IRInstructionBuilder
protected final IRGenerationContext
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractGenerator
(IRGenerationContext stackContext) Constructor accepting only IRGenerationContext - the single source of state. -
Method Summary
Modifier and TypeMethodDescriptionprotected CallMetaDataDetails
extractCallMetaData
(ISymbol symbol) Extract call metadata from a symbol using the common pattern.protected ISymbol
getRecordedSymbolOrException
(org.antlr.v4.runtime.tree.ParseTree node)
-
Field Details
-
stackContext
-
debugInfoCreator
-
instructionBuilder
-
-
Constructor Details
-
AbstractGenerator
AbstractGenerator(IRGenerationContext stackContext) Constructor accepting only IRGenerationContext - the single source of state.
-
-
Method Details
-
getRecordedSymbolOrException
-
extractCallMetaData
Extract call metadata from a symbol using the common pattern. This consolidates the frequent pattern of creating CallMetaDataExtractor and applying it.
-