Record Class ForRangePolymorphicInstr.DescendingCase

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

public static record ForRangePolymorphicInstr.DescendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> loopIncrement, ForRangePolymorphicInstr.ProgressCheck progressCheck) extends Record
Dispatch case for descending loops (direction > 0). Contains explicit IR for all loop operations.

Example: for i in 10 ... 1

  • direction_check: IR for direction > 0
  • loop_condition: IR for current >= end
  • loop_increment: IR for current--
  • Constructor Details

    • DescendingCase

      public DescendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> loopIncrement, ForRangePolymorphicInstr.ProgressCheck progressCheck)
      Creates an instance of a DescendingCase 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
      valueGuard - the value for the valueGuard record component
      endCheck - the value for the endCheck record component
      loopIncrement - the value for the loopIncrement record component
      progressCheck - the value for the progressCheck 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
    • valueGuard

      Returns the value of the valueGuard record component.
      Returns:
      the value of the valueGuard record component
    • endCheck

      Returns the value of the endCheck record component.
      Returns:
      the value of the endCheck record component
    • loopIncrement

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

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