Class ConstructorCallProcessor

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

public final class ConstructorCallProcessor extends Object
Unified processor for constructor call generation. Eliminates duplication between ExprInstrGenerator and CallInstrGenerator by providing a single, reusable component for constructor call processing.
  • Constructor Details

  • Method Details

    • processConstructorCall

      public void processConstructorCall(CallSymbol callSymbol, EK9Parser.CallContext callContext, String resultVariable, List<IRInstr> instructions, Function<ExprProcessingDetails,List<IRInstr>> expressionProcessor, boolean useMemoryManagement)
      Process a constructor call and generate appropriate IR instructions. This method consolidates all the common logic between expression and statement contexts.
      Parameters:
      callSymbol - The resolved call symbol
      callContext - The ANTLR call context
      resultVariable - The variable to store the constructor result
      instructions - The list to add generated instructions to
      expressionProcessor - Function to process argument expressions
      useMemoryManagement - Whether to apply memory management to arguments