Class FOR_StepUntil

java.lang.Object
simula.runtime.FOR_Element
simula.runtime.FOR_StepUntil
All Implemented Interfaces:
Iterator<Boolean>

public final class FOR_StepUntil extends FOR_Element

For-statement step until element.

 A1 step A2 until A3

         C := A1;
         DELTA := A2;
         while DELTA*(C-A3) <= 0
         do begin
             S;
             DELTA := A2;
             C := C + DELTA;
         end while;
         ... next for list element
  • Field Details

  • Constructor Details

    • FOR_StepUntil

      public FOR_StepUntil(RTS_NAME<Number> cvar, RTS_NAME<Number> init, RTS_NAME<Number> step, RTS_NAME<Number> until)
      Create step until element.
      Parameters:
      cvar - the for-statement control variable
      init - the initial value expression
      step - the step value expression
      until - the until value expression
  • Method Details

    • next

      public Boolean next()
      Update the control variable with the next value if any.
      Returns:
      true if the control variable was updated; otherwise false.