Class GeneratorSet
Architecture Pattern: Mutable struct with public fields (C-style). Fields are mutable during construction phase, then logically immutable after. This pattern enables natural resolution of circular dependencies without complex forward method references or Supplier indirection.
Usage: Created and populated by IRConstructGenerators factory, then passed to all generator constructors. Reduces constructor parameter counts from 1-9 parameters down to 2 uniform parameters: (IRGenerationContext, GeneratorSet).
Thread Safety: Each construct gets its own GeneratorSet instance via unique IRGenerationContext, ensuring thread isolation during parallel construct generation.
Extension Strategy: Adding new generators requires only: 1. Add public field here 2. Populate in IRConstructGenerators.create() 3. Use via generators.fieldName in dependent code
-
Field Summary
FieldsModifier and TypeFieldDescriptionGenerates IR for assert statements.Generates IR for assignment statements with guard support.Generates IR for binary operations (addition, comparison, etc.).Invokes binary operators with memory management.Main block statement processor - handles statement blocks.Builds CallDetails with cost-based method resolution and promotion.Generates IR for call statements (function/method calls).Evaluates chained comparisons for polymorphic for-range loops.Evaluates comparison operations and extracts primitive boolean.Processes constructor calls with memory management.Generates control flow chains (ternary, guards, etc.).Creates debug info from source tokens when instrumentation enabled.Builds direction check IR for polymorphic for-range loops.Main expression processor - handles all expression types recursively.Generates IR for for-in loops (for item in collection) using iterator protocol.Generates IR for for-range loops (for i in 1..10) using FOR_RANGE_POLYMORPHIC.Coordinates for-statement IR generation by delegating to ForRangeGenerator or ForInGenerator.Processes function calls with promotion support.Generates IR for if/else statements using CONTROL_FLOW_CHAIN.Evaluates increment/decrement operations and updates loop counter.Generates IR for list literal expressions.Loads literal values with memory management.Processes object access expressions (method calls, property access).Processes parameter promotions for method calls.Handles primary references (THIS and SUPER keywords).Extracts primitive boolean from EK9 Boolean objects.Generates question block (? operator) expressions.Processes record expression construction (field extraction for short-circuit operators).Executes instructions within a scoped block (SCOPE_ENTER/EXIT).Generates short-circuit AND expressions.Generates short-circuit OR expressions.Main statement processor - delegates to specialized statement generators.Generates IR for switch statements (statement form) using CONTROL_FLOW_CHAIN.Generates IR for unary operations (negation, increment, etc.).Invokes unary operators with memory management.Generates IR for variable declarations with initialization.Handles variable memory management (RETAIN, SCOPE_REGISTER, etc.).Generates IR for variable declarations without initialization.Generates IR for while/do-while loops using CONTROL_FLOW_CHAIN. -
Constructor Summary
ConstructorsConstructorDescriptionPackage-private constructor - only IRConstructGenerators factory can create instances. -
Method Summary
-
Field Details
-
variableMemoryManagement
Handles variable memory management (RETAIN, SCOPE_REGISTER, etc.). -
parameterPromotionProcessor
Processes parameter promotions for method calls. -
callDetailsBuilder
Builds CallDetails with cost-based method resolution and promotion. -
debugInfoCreator
Creates debug info from source tokens when instrumentation enabled. -
recordExprProcessing
Processes record expression construction (field extraction for short-circuit operators). -
scopedInstructionExecutor
Executes instructions within a scoped block (SCOPE_ENTER/EXIT). -
unaryOperatorInvoker
Invokes unary operators with memory management. -
binaryOperatorInvoker
Invokes binary operators with memory management. -
managedLiteralLoader
Loads literal values with memory management. -
primitiveBooleanExtractor
Extracts primitive boolean from EK9 Boolean objects. -
comparisonEvaluator
Evaluates comparison operations and extracts primitive boolean. -
chainedComparisonEvaluator
Evaluates chained comparisons for polymorphic for-range loops. -
incrementEvaluator
Evaluates increment/decrement operations and updates loop counter. -
directionCheckBuilder
Builds direction check IR for polymorphic for-range loops. -
exprGenerator
Main expression processor - handles all expression types recursively. -
objectAccessGenerator
Processes object access expressions (method calls, property access). -
Handles primary references (THIS and SUPER keywords).
-
unaryOperationGenerator
Generates IR for unary operations (negation, increment, etc.). -
binaryOperationGenerator
Generates IR for binary operations (addition, comparison, etc.). -
shortCircuitAndGenerator
Generates short-circuit AND expressions. -
shortCircuitOrGenerator
Generates short-circuit OR expressions. -
questionBlockGenerator
Generates question block (? operator) expressions. -
listLiteralGenerator
Generates IR for list literal expressions. -
controlFlowChainGenerator
Generates control flow chains (ternary, guards, etc.). -
stmtGenerator
Main statement processor - delegates to specialized statement generators. -
assignmentStmtGenerator
Generates IR for assignment statements with guard support. -
assertStmtGenerator
Generates IR for assert statements. -
callGenerator
Generates IR for call statements (function/method calls). -
ifStatementGenerator
Generates IR for if/else statements using CONTROL_FLOW_CHAIN. -
switchStatementGenerator
Generates IR for switch statements (statement form) using CONTROL_FLOW_CHAIN. -
whileStatementGenerator
Generates IR for while/do-while loops using CONTROL_FLOW_CHAIN. -
forRangeGenerator
Generates IR for for-range loops (for i in 1..10) using FOR_RANGE_POLYMORPHIC. -
forInGenerator
Generates IR for for-in loops (for item in collection) using iterator protocol. -
forStatementGenerator
Coordinates for-statement IR generation by delegating to ForRangeGenerator or ForInGenerator. -
blockStmtGenerator
Main block statement processor - handles statement blocks. -
variableDeclGenerator
Generates IR for variable declarations with initialization. -
variableOnlyDeclGenerator
Generates IR for variable declarations without initialization. -
constructorCallProcessor
Processes constructor calls with memory management. -
functionCallProcessor
Processes function calls with promotion support.
-
-
Constructor Details
-
GeneratorSet
GeneratorSet()Package-private constructor - only IRConstructGenerators factory can create instances. Fields are populated externally during construction phase.
-