Class UnaryOperatorInvoker
java.lang.Object
org.ek9lang.compiler.phase7.support.UnaryOperatorInvoker
- All Implemented Interfaces:
Function<UnaryOperatorParams, List<IRInstr>>
public final class UnaryOperatorInvoker
extends Object
implements Function<UnaryOperatorParams, List<IRInstr>>
CONCERN: Unary operator invocation with memory management.
RESPONSIBILITY: Call unary operator (_inc, _dec, _neg, etc.) with ARC compliance.
REUSABILITY: ALL generators calling unary operators.
Encapsulates the pattern: 1. Create CallContext for unary operation 2. Build CallDetails via CallDetailsBuilder 3. Execute operator call 4. Apply memory management (RETAIN/SCOPE_REGISTER)
Ensures all unary operator calls follow consistent memory management, preventing reference counting bugs.
-
Constructor Summary
ConstructorsConstructorDescriptionUnaryOperatorInvoker(CallDetailsBuilder callDetailsBuilder, VariableMemoryManagement variableMemoryManagement) -
Method Summary
Modifier and TypeMethodDescriptionapply(UnaryOperatorParams params) Invoke unary operator on operand.
-
Constructor Details
-
UnaryOperatorInvoker
public UnaryOperatorInvoker(CallDetailsBuilder callDetailsBuilder, VariableMemoryManagement variableMemoryManagement)
-
-
Method Details
-
apply
Invoke unary operator on operand.Handles: - CallContext creation - CallDetailsBuilder invocation - Memory management (RETAIN/SCOPE_REGISTER)
- Specified by:
applyin interfaceFunction<UnaryOperatorParams, List<IRInstr>>- Parameters:
params- Unary operator parameters- Returns:
- Instructions ending with result in params.resultTemp()
-