Class ConstructorCallProcessor
java.lang.Object
org.ek9lang.compiler.phase7.generator.ConstructorCallProcessor
Unified processor for constructor call generation.
Eliminates duplication between ExprInstrGenerator and CallInstrGenerator
by providing a single, reusable component for constructor call processing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Constructor Details
-
ConstructorCallProcessor
-
-
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 symbolcallContext
- The ANTLR call contextresultVariable
- The variable to store the constructor resultinstructions
- The list to add generated instructions toexpressionProcessor
- Function to process argument expressionsuseMemoryManagement
- Whether to apply memory management to arguments
-