Class BranchInstr

java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.BranchInstr
All Implemented Interfaces:
INode

public final class BranchInstr extends IRInstr
Specialized IR instruction for control flow operations (BRANCH, BRANCH_TRUE, BRANCH_FALSE, ASSERT, RETURN).

Branch instructions handle all control flow in the EK9 IR, including loops, conditionals, and method returns.

  • Method Details

    • returnVoid

      public static BranchInstr returnVoid()
      Create return with no value: RETURN.
    • returnVoid

      public static BranchInstr returnVoid(DebugInfo debugInfo)
      Create return with no value and debug info: RETURN.
    • returnValue

      public static BranchInstr returnValue(String value, DebugInfo debugInfo)
      Create return with value and debug info: RETURN value.
    • assertValue

      public static BranchInstr assertValue(String condition, DebugInfo debugInfo)
      Create assert instruction with debug info: ASSERT condition.
    • addOperand

      public BranchInstr addOperand(String operand)
      Description copied from class: IRInstr
      Add operand to this instruction.
      Overrides:
      addOperand in class IRInstr
    • addOperands

      public BranchInstr addOperands(String... operands)
      Description copied from class: IRInstr
      Add multiple operands to this instruction.
      Overrides:
      addOperands in class IRInstr
    • getTargetLabel

      public String getTargetLabel()
      Get target label for branch instructions.
    • getCondition

      public String getCondition()
      Get condition for conditional branch instructions.
    • getReturnValue

      public String getReturnValue()
      Get return value for RETURN instructions.