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 assertDoesNotThrow expressions (test-only).Generates IR for assertPanic expressions (test-only).Generates IR for assert statements.Generates IR for assertThrows expressions (test-only).THE assign-if-unset (:=?) block.THE generator of an assignmentExpression (expression, dynamic class, switch/try/while/for expression, list, dict, stream) - the expression is an argument, so ONE per set (IR tidy W3.9, EXPR-15).Generates IR for assignment statements with guard support.THE assignment of an assignmentExpression to an EXISTING variable (the value it replaces is dropped).THE assignment of an assignmentExpression to a NEW variable (a declaration's first value).Generates IR for binary operations (addition, comparison, etc.).Invokes binary operators with memory management.Main block statement processor - handles statement blocks.THE step from an evaluated condition (a Boolean, or a type with#^to Boolean) to a branch's primitive.THE evaluation of a call's arguments - every call form evaluates its arguments through this.Builds CallDetails with cost-based method resolution and promotion.Generates IR for call statements (function/method calls).THE generated close chain: a type's close (its body, then its closeable fields and its super class's close) and a constructor's partial-construction cleanup.Evaluates comparison operations and extracts primitive boolean.THE load of a copy-on-access constant (a copy of the constant, so the original can never be mutated) - one per set (IR tidy W3.9, OPS-11).Processes constructor calls with memory management.Generates control flow chains (ternary, guards, etc.).Generates IR for dict literal expressions.Builds direction check IR for polymorphic for-range loops.THE emission of a dynamic class or dynamic function where it is written (construct, module, captures, call).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.Orchestrates guard + scope + return variable pattern for control flow generators.Generates IR for if/else statements using CONTROL_FLOW_CHAIN.Evaluates increment/decrement operations and updates loop counter.Generates IR for interpolated string expressions.Generates IR for list literal expressions.Loads a literal into its result variable (no memory management - the expression processor above it owns that).Loads literal values with memory management.Processes object access expressions (method calls, property access).THE declaration of a variable that owns the temporaries its initialiser makes (returning variable, property).Processes parameter promotions for method calls.Handles primary references (THIS and SUPER keywords).Extracts primitive boolean from EK9 Boolean objects.Generates type promotion calls using #^ operator.THE instance initialisation of a type's properties (the body of_i_init).Generates question block (? operator) expressions.Shared helper for range iteration logic used by both for-range loops and stream for-range sources.Processes record expression construction (field extraction for short-circuit operators).Generates IR for require statements (production preconditions/invariants).THE compiler-generated close: a single close call, and the close-if-present finally sequence shared by try-with-resources and statement-owned closeable temporaries.THE returning-parameter processing of an operation, or of a switch/while/for/try expression.Executes instructions within a scoped block (SCOPE_ENTER/EXIT).Memory management for consuming pre-retained values (SCOPE_REGISTER only, no RETAIN).Generates short-circuit AND expressions.Generates short-circuit OR expressions.Wraps a statement that creates an unnamed closeable temporary so the statement closes it.Main statement processor - delegates to specialized statement generators.(package private) final StreamOperandsEvaluatedAheadThe stream stage function operands evaluated once before their pipeline (QA0059) - shared by the stream generator, which records them, and every stage generator, which loads them.Generates IR for stream statement pipelines (cat/for source | stages | > sink).Generates short-circuit OR chains for multiple switch case expressions.Generates IR for switch statements (statement form) using CONTROL_FLOW_CHAIN.THE shared source of call metadata for every synthesised call site of this construct - one per set, never one per generator (IR tidy W3.9, OPS-11: it was a field of everyAbstractGenerator), and never a hand-writtenCallMetaDataDetailstuple.THE body of a text method (its string is the returned value).Generates IR for throw statements.Generates IR for try/catch/finally exception handling 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.). -
scopeRegisterOnly
Memory management for consuming pre-retained values (SCOPE_REGISTER only, no RETAIN). Used by consumer side of ARC ownership transfer pattern - receiving values from producer.- See Also:
-
promotionCallGenerator
Generates type promotion calls using #^ operator. Used by both assignment promotion and parameter promotion. -
parameterPromotionProcessor
Processes parameter promotions for method calls. -
callDetailsBuilder
Builds CallDetails with cost-based method resolution and promotion. -
recordExprProcessing
Processes record expression construction (field extraction for short-circuit operators). -
synthesisedCallMetaData
THE shared source of call metadata for every synthesised call site of this construct - one per set, never one per generator (IR tidy W3.9, OPS-11: it was a field of everyAbstractGenerator), and never a hand-writtenCallMetaDataDetailstuple. See its javadoc for the two honest sources. -
constantCopyOnAccessLoader
THE load of a copy-on-access constant (a copy of the constant, so the original can never be mutated) - one per set (IR tidy W3.9, OPS-11). -
literalGenerator
Loads a literal into its result variable (no memory management - the expression processor above it owns that). -
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. -
booleanCondition
THE step from an evaluated condition (a Boolean, or a type with#^to Boolean) to a branch's primitive. -
comparisonEvaluator
Evaluates comparison operations and extracts primitive boolean. -
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. -
dictLiteralGenerator
Generates IR for dict literal expressions. -
interpolatedStringGenerator
Generates IR for interpolated string 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. -
assignmentExprGenerator
THE generator of an assignmentExpression (expression, dynamic class, switch/try/while/for expression, list, dict, stream) - the expression is an argument, so ONE per set (IR tidy W3.9, EXPR-15). -
assignToNewSymbol
THE assignment of an assignmentExpression to a NEW variable (a declaration's first value). -
assignToExistingSymbol
THE assignment of an assignmentExpression to an EXISTING variable (the value it replaces is dropped). -
assignIfUnsetBlockGenerator
THE assign-if-unset (:=?) block. -
returningParamProcessor
THE returning-parameter processing of an operation, or of a switch/while/for/try expression. -
textBodyMethodGenerator
THE body of a text method (its string is the returned value). -
assertStmtGenerator
Generates IR for assert statements. -
requireStmtGenerator
Generates IR for require statements (production preconditions/invariants). -
throwStatementGenerator
Generates IR for throw statements. -
resourceCloser
THE compiler-generated close: a single close call, and the close-if-present finally sequence shared by try-with-resources and statement-owned closeable temporaries. -
closeChain
THE generated close chain: a type's close (its body, then its closeable fields and its super class's close) and a constructor's partial-construction cleanup. -
statementOwnedCloseables
Wraps a statement that creates an unnamed closeable temporary so the statement closes it. -
dynamicConstructEmitter
THE emission of a dynamic class or dynamic function where it is written (construct, module, captures, call). -
ownedDeclaration
THE declaration of a variable that owns the temporaries its initialiser makes (returning variable, property). -
propertyInitialisers
THE instance initialisation of a type's properties (the body of_i_init). -
assertThrowsExprGenerator
Generates IR for assertThrows expressions (test-only). -
assertDoesNotThrowExprGenerator
Generates IR for assertDoesNotThrow expressions (test-only). -
assertPanicExprGenerator
Generates IR for assertPanic expressions (test-only). -
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. -
switchCaseOrChainGenerator
Generates short-circuit OR chains for multiple switch case expressions. -
guardedScopeOrchestrator
Orchestrates guard + scope + return variable pattern for control flow generators. -
whileStatementGenerator
Generates IR for while/do-while loops using CONTROL_FLOW_CHAIN. -
tryCatchStatementGenerator
Generates IR for try/catch/finally exception handling 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. -
rangeIterationHelper
Shared helper for range iteration logic used by both for-range loops and stream for-range sources. -
streamStatementGenerator
Generates IR for stream statement pipelines (cat/for source | stages | > sink). -
streamOperandsEvaluatedAhead
The stream stage function operands evaluated once before their pipeline (QA0059) - shared by the stream generator, which records them, and every stage generator, which loads them. -
blockStmtGenerator
Main block statement processor - handles statement blocks. -
variableDeclGenerator
Generates IR for variable declarations with initialization. -
variableOnlyDeclGenerator
Generates IR for variable declarations without initialization. -
callArguments
THE evaluation of a call's arguments - every call form evaluates its arguments through this. -
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.
-