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 Details

  • Method Details

    • apply

      public List<IRInstr> apply(UnaryOperatorParams params)
      Invoke unary operator on operand.

      Handles: - CallContext creation - CallDetailsBuilder invocation - Memory management (RETAIN/SCOPE_REGISTER)

      Specified by:
      apply in interface Function<UnaryOperatorParams, List<IRInstr>>
      Parameters:
      params - Unary operator parameters
      Returns:
      Instructions ending with result in params.resultTemp()