Record Class ForRangePolymorphicInstr.AscendingCase

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.instructions.ForRangePolymorphicInstr.AscendingCase
Enclosing class:
ForRangePolymorphicInstr

public static record ForRangePolymorphicInstr.AscendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, List<IRInstr> loopIncrement) extends Record
Dispatch case for ascending loops (direction < 0). Contains explicit IR for all loop operations.

Example: for i in 1 ... 10

  • direction_check: IR for direction < 0
  • loop_condition: IR for current <= end
  • loop_increment: IR for current++
  • Constructor Details

    • AscendingCase

      public AscendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, List<IRInstr> loopIncrement)
      Creates an instance of a AscendingCase record class.
      Parameters:
      directionCheck - the value for the directionCheck record component
      directionPrimitive - the value for the directionPrimitive record component
      loopConditionTemplate - the value for the loopConditionTemplate record component
      loopConditionPrimitive - the value for the loopConditionPrimitive record component
      loopBodySetup - the value for the loopBodySetup record component
      loopIncrement - the value for the loopIncrement record component
  • 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.
    • directionCheck

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

      public String directionPrimitive()
      Returns the value of the directionPrimitive record component.
      Returns:
      the value of the directionPrimitive record component
    • loopConditionTemplate

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

      public String loopConditionPrimitive()
      Returns the value of the loopConditionPrimitive record component.
      Returns:
      the value of the loopConditionPrimitive record component
    • loopBodySetup

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

      public List<IRInstr> loopIncrement()
      Returns the value of the loopIncrement record component.
      Returns:
      the value of the loopIncrement record component