Class GeneratorSet

java.lang.Object
org.ek9lang.compiler.phase7.generator.GeneratorSet

public final class GeneratorSet extends Object
Struct-style data holder for all Phase 7 IR generators and helpers.

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 Details

    • variableMemoryManagement

      public VariableMemoryManagement variableMemoryManagement
      Handles variable memory management (RETAIN, SCOPE_REGISTER, etc.).
    • parameterPromotionProcessor

      public ParameterPromotionProcessor parameterPromotionProcessor
      Processes parameter promotions for method calls.
    • callDetailsBuilder

      public CallDetailsBuilder callDetailsBuilder
      Builds CallDetails with cost-based method resolution and promotion.
    • debugInfoCreator

      public DebugInfoCreator debugInfoCreator
      Creates debug info from source tokens when instrumentation enabled.
    • recordExprProcessing

      public RecordExprProcessing recordExprProcessing
      Processes record expression construction (field extraction for short-circuit operators).
    • scopedInstructionExecutor

      public ScopedInstructionExecutor scopedInstructionExecutor
      Executes instructions within a scoped block (SCOPE_ENTER/EXIT).
    • unaryOperatorInvoker

      public UnaryOperatorInvoker unaryOperatorInvoker
      Invokes unary operators with memory management.
    • binaryOperatorInvoker

      public BinaryOperatorInvoker binaryOperatorInvoker
      Invokes binary operators with memory management.
    • managedLiteralLoader

      public ManagedLiteralLoader managedLiteralLoader
      Loads literal values with memory management.
    • primitiveBooleanExtractor

      public PrimitiveBooleanExtractor primitiveBooleanExtractor
      Extracts primitive boolean from EK9 Boolean objects.
    • comparisonEvaluator

      public ComparisonEvaluator comparisonEvaluator
      Evaluates comparison operations and extracts primitive boolean.
    • chainedComparisonEvaluator

      public ChainedComparisonEvaluator chainedComparisonEvaluator
      Evaluates chained comparisons for polymorphic for-range loops.
    • incrementEvaluator

      public IncrementEvaluator incrementEvaluator
      Evaluates increment/decrement operations and updates loop counter.
    • directionCheckBuilder

      public DirectionCheckBuilder directionCheckBuilder
      Builds direction check IR for polymorphic for-range loops.
    • exprGenerator

      public ExprInstrGenerator exprGenerator
      Main expression processor - handles all expression types recursively.
    • objectAccessGenerator

      public ObjectAccessInstrGenerator objectAccessGenerator
      Processes object access expressions (method calls, property access).
    • primaryReferenceGenerator

      public PrimaryReferenceGenerator primaryReferenceGenerator
      Handles primary references (THIS and SUPER keywords).
    • unaryOperationGenerator

      public UnaryOperationGenerator unaryOperationGenerator
      Generates IR for unary operations (negation, increment, etc.).
    • binaryOperationGenerator

      public BinaryOperationGenerator binaryOperationGenerator
      Generates IR for binary operations (addition, comparison, etc.).
    • shortCircuitAndGenerator

      public ShortCircuitAndGenerator shortCircuitAndGenerator
      Generates short-circuit AND expressions.
    • shortCircuitOrGenerator

      public ShortCircuitOrGenerator shortCircuitOrGenerator
      Generates short-circuit OR expressions.
    • questionBlockGenerator

      public QuestionBlockGenerator questionBlockGenerator
      Generates question block (? operator) expressions.
    • listLiteralGenerator

      public ListLiteralGenerator listLiteralGenerator
      Generates IR for list literal expressions.
    • controlFlowChainGenerator

      public ControlFlowChainGenerator controlFlowChainGenerator
      Generates control flow chains (ternary, guards, etc.).
    • stmtGenerator

      public StmtInstrGenerator stmtGenerator
      Main statement processor - delegates to specialized statement generators.
    • assignmentStmtGenerator

      public AssignmentStmtGenerator assignmentStmtGenerator
      Generates IR for assignment statements with guard support.
    • assertStmtGenerator

      public AssertStmtGenerator assertStmtGenerator
      Generates IR for assert statements.
    • callGenerator

      public CallInstrGenerator callGenerator
      Generates IR for call statements (function/method calls).
    • ifStatementGenerator

      public IfStatementGenerator ifStatementGenerator
      Generates IR for if/else statements using CONTROL_FLOW_CHAIN.
    • switchStatementGenerator

      public SwitchStatementGenerator switchStatementGenerator
      Generates IR for switch statements (statement form) using CONTROL_FLOW_CHAIN.
    • whileStatementGenerator

      public WhileStatementGenerator whileStatementGenerator
      Generates IR for while/do-while loops using CONTROL_FLOW_CHAIN.
    • forRangeGenerator

      public ForRangeGenerator forRangeGenerator
      Generates IR for for-range loops (for i in 1..10) using FOR_RANGE_POLYMORPHIC.
    • forInGenerator

      public ForInGenerator forInGenerator
      Generates IR for for-in loops (for item in collection) using iterator protocol.
    • forStatementGenerator

      public ForStatementGenerator forStatementGenerator
      Coordinates for-statement IR generation by delegating to ForRangeGenerator or ForInGenerator.
    • blockStmtGenerator

      public BlockStmtInstrGenerator blockStmtGenerator
      Main block statement processor - handles statement blocks.
    • variableDeclGenerator

      public VariableDeclInstrGenerator variableDeclGenerator
      Generates IR for variable declarations with initialization.
    • variableOnlyDeclGenerator

      public VariableOnlyDeclInstrGenerator variableOnlyDeclGenerator
      Generates IR for variable declarations without initialization.
    • constructorCallProcessor

      public ConstructorCallProcessor constructorCallProcessor
      Processes constructor calls with memory management.
    • functionCallProcessor

      public FunctionCallProcessor 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.