Class ForContext


public class ForContext extends ArgumentBasedContext
This represents the semantics of the FOR control in an action script. Provides a compact way to iterate over a range of (integer) values.
  • Field Details

    • loopVarName

      protected String loopVarName
  • Constructor Details

  • Method Details

    • setupNextStep

      protected void setupNextStep()
      Description copied from class: Context
      If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.
      Overrides:
      setupNextStep in class Context
    • setupArguments

      protected void setupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs)
      Sets up the variable for the "for" context.
      Specified by:
      setupArguments in class ArgumentBasedContext
      Parameters:
      inputArgs - should be !var init_val compar_op compar_val incr_op (5 arguments)
    • isIncrementOperator

      public static boolean isIncrementOperator(String txt)
    • copy

      public ForContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context