coins.ast.stmnt
Class ForStmnt

java.lang.Object
  extended bycoins.ast.ASTree
      extended bycoins.ast.stmnt.TreeStmnt
          extended bycoins.ast.stmnt.ForStmnt
All Implemented Interfaces:
java.io.Serializable, Stmnt

public class ForStmnt
extends TreeStmnt

For statement.

The for statement is decomposed into four parts:

See Also:
Serialized Form

Field Summary
 
Fields inherited from class coins.ast.stmnt.TreeStmnt
left, right
 
Constructor Summary
ForStmnt(java.lang.String fname, int line)
           
 
Method Summary
 void accept(Visitor v)
          Is a method for the visitor pattern.
 Stmnt getBody()
          Returns the loop body.
 Expr getCondition()
          Returns the condition expression.
 Expr getInitializer()
          Returns the initializer expression.
 Expr getIteration()
          Returns the iteration expression.
protected  java.lang.String getTag()
          Returns the type of this node.
 ForStmnt set(Expr init, Expr cond, Expr iterate, CompoundStmnt body)
           
 
Methods inherited from class coins.ast.stmnt.TreeStmnt
fileName, getLeft, getRight, lineNumber, setLeft, setRight
 
Methods inherited from class coins.ast.ASTree
putSeparator, rightToString, toString, toString1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForStmnt

public ForStmnt(java.lang.String fname,
                int line)
Method Detail

set

public ForStmnt set(Expr init,
                    Expr cond,
                    Expr iterate,
                    CompoundStmnt body)

accept

public void accept(Visitor v)
Description copied from class: ASTree
Is a method for the visitor pattern. It calls atXXX() on the given visitor, where XXX is the class name of the node object.

Specified by:
accept in class ASTree

getInitializer

public Expr getInitializer()
Returns the initializer expression.


getCondition

public Expr getCondition()
Returns the condition expression.


getIteration

public Expr getIteration()
Returns the iteration expression.


getBody

public Stmnt getBody()
Returns the loop body.


getTag

protected java.lang.String getTag()
Description copied from class: ASTree
Returns the type of this node. This method is used by toString().

Overrides:
getTag in class TreeStmnt