Class CallInstruction

java.lang.Object
org.ek9lang.compiler.ir.IRInstruction
org.ek9lang.compiler.ir.CallInstruction
All Implemented Interfaces:
INode

public final class CallInstruction extends IRInstruction
Specialized IR instruction for method calls (CALL, CALL_VIRTUAL, CALL_STATIC, CALL_DISPATCHER).

This instruction type handles ALL EK9 method calls and operators. EK9 operators like a + b become method calls like a._add(b).

  • Method Details

    • call

      public static CallInstruction call(String result, String targetObject, String methodName, String... arguments)
      Create standard method call: CALL result = object.method(args...)
    • call

      public static CallInstruction call(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments)
      Create standard method call with debug info: CALL result = object.method(args...)
    • callVirtual

      public static CallInstruction callVirtual(String result, String targetObject, String methodName, String... arguments)
      Create virtual method call: CALL_VIRTUAL result = object.method(args...)
    • callVirtual

      public static CallInstruction callVirtual(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments)
      Create virtual method call with debug info: CALL_VIRTUAL result = object.method(args...)
    • callStatic

      public static CallInstruction callStatic(String result, String targetType, String methodName, String... arguments)
      Create static method call: CALL_STATIC result = Type.method(args...)
    • callStatic

      public static CallInstruction callStatic(String result, String targetType, String methodName, DebugInfo debugInfo, String... arguments)
      Create static method call with debug info: CALL_STATIC result = Type.method(args...)
    • callDispatcher

      public static CallInstruction callDispatcher(String result, String targetObject, String methodName, String... arguments)
      Create dispatcher method call: CALL_DISPATCHER result = object.dispatcherMethod(args...)
    • callDispatcher

      public static CallInstruction callDispatcher(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments)
      Create dispatcher method call with debug info: CALL_DISPATCHER result = object.dispatcherMethod(args...)
    • operator

      public static CallInstruction operator(String result, String targetObject, String operatorMethod, String... arguments)
      Create EK9 operator call: CALL result = object._operatorMethod(args...) Common operators: _add, _sub, _eq, _lt, _addAss, _isSet, etc.
    • operator

      public static CallInstruction operator(String result, String targetObject, String operatorMethod, DebugInfo debugInfo, String... arguments)
      Create EK9 operator call with debug info: CALL result = object._operatorMethod(args...)
    • constructor

      public static CallInstruction constructor(String result, String typeName, String... arguments)
      Create constructor call: CALL result = Type.<init>(args...)
    • constructor

      public static CallInstruction constructor(String result, String typeName, DebugInfo debugInfo, String... arguments)
      Create constructor call with debug info: CALL result = Type.<init>(args...)
    • accept

      public void accept(INodeVisitor visitor)
      Specified by:
      accept in interface INode
      Overrides:
      accept in class IRInstruction
    • getTargetObject

      public String getTargetObject()
    • getMethodName

      public String getMethodName()
    • getArguments

      public List<String> getArguments()
    • isOperatorCall

      public boolean isOperatorCall()
      Check if this is an EK9 operator method call.
    • isConstructorCall

      public boolean isConstructorCall()
      Check if this is a constructor call.