org.millscript.millscript.action
Class ForAction

java.lang.Object
  extended by org.millscript.millscript.action.Action
      extended by org.millscript.millscript.action.ForAction
All Implemented Interfaces:
org.millscript.commons.alert.AlertOrigin

public final class ForAction
extends Action

This class represents a For loop action. A for loop action may contain multiple condition/binding expressions and a single body expression. The loop conditions are represented as ForIterators, which produce and bind values as necessary. When the condition produces no more values, a check is made to see if the condition terminates the loop and it's terminate action is executed accordingly.

See Also:
ForConditionAction.ForIterator

Constructor Summary
ForAction(ForConditionAction[] x, Action b)
          Constructs a new for loop action, with the supplied conditon and body actions.
 
Method Summary
 void action(Machine mc)
          Performs this action, on the specified machine.
 
Methods inherited from class org.millscript.millscript.action.Action
act, act1, getLineNumber, getOrigin, predAct, setContext, setLineNumber, setOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForAction

public ForAction(ForConditionAction[] x,
                 Action b)
Constructs a new for loop action, with the supplied conditon and body actions.

Parameters:
x - array of for loop condition actions
b - the for loop body action
Method Detail

action

public void action(Machine mc)
Description copied from class: Action
Performs this action, on the specified machine. This method must be implemented in sub-classes to perform the required actions.

Specified by:
action in class Action
Parameters:
mc - the machine to perform this action on
See Also:
Action.action(org.millscript.millscript.vm.Machine)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.