Record Class LoopCaseData

java.lang.Object
java.lang.Record
org.ek9lang.compiler.backend.jvm.LoopCaseData
Record Components:
loopStart - Label marking the start of the loop (for goto jumps back)
conditionTemplate - IR instructions to evaluate loop condition (re-executed each iteration)
conditionPrimitive - Variable name holding primitive boolean condition result
bodySetup - IR instructions for body setup (assigns loopVariable = current)
body - IR instructions for loop body (user code, shared across all cases)
increment - IR instructions for increment (current++ or current--)
endLabel - Label to jump to when loop exits (shared across all cases)
loopScopeId - Unique scope ID for this loop (used for label generation)
dispatchCase - Which FOR_RANGE dispatch case (ASCENDING or DESCENDING)

record LoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, List<IRInstr> body, List<IRInstr> increment, org.objectweb.asm.Label endLabel, String loopScopeId, BytecodeGenerationContext.DispatchCase dispatchCase) extends Record
Encapsulates all data needed for generating a FOR_RANGE loop case (ascending or descending).

This record groups the 9 parameters needed for loop generation into a single cohesive unit.

  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • loopStart

      public org.objectweb.asm.Label loopStart()
      Returns the value of the loopStart record component.
      Returns:
      the value of the loopStart record component
    • conditionTemplate

      public List<IRInstr> conditionTemplate()
      Returns the value of the conditionTemplate record component.
      Returns:
      the value of the conditionTemplate record component
    • conditionPrimitive

      public String conditionPrimitive()
      Returns the value of the conditionPrimitive record component.
      Returns:
      the value of the conditionPrimitive record component
    • bodySetup

      public List<IRInstr> bodySetup()
      Returns the value of the bodySetup record component.
      Returns:
      the value of the bodySetup record component
    • body

      public List<IRInstr> body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • increment

      public List<IRInstr> increment()
      Returns the value of the increment record component.
      Returns:
      the value of the increment record component
    • endLabel

      public org.objectweb.asm.Label endLabel()
      Returns the value of the endLabel record component.
      Returns:
      the value of the endLabel record component
    • loopScopeId

      public String loopScopeId()
      Returns the value of the loopScopeId record component.
      Returns:
      the value of the loopScopeId record component
    • dispatchCase

      Returns the value of the dispatchCase record component.
      Returns:
      the value of the dispatchCase record component