coins.ast.stmnt
Class IfStmnt

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

public class IfStmnt
extends TreeStmnt

If statement.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class coins.ast.stmnt.TreeStmnt
left, right
 
Constructor Summary
IfStmnt(java.lang.String fname, int line)
           
 
Method Summary
 void accept(Visitor v)
          Is a method for the visitor pattern.
 Stmnt getElse()
          Returns the else statement.
 Expr getExpr()
          Returns the condition expression.
protected  java.lang.String getTag()
          Returns the type of this node.
 Stmnt getThen()
          Returns the then statement.
 IfStmnt set(Expr cond, CompoundStmnt thenp, CompoundStmnt elsep)
           
 
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

IfStmnt

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

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

set

public IfStmnt set(Expr cond,
                   CompoundStmnt thenp,
                   CompoundStmnt elsep)

getExpr

public Expr getExpr()
Returns the condition expression.


getThen

public Stmnt getThen()
Returns the then statement.


getElse

public Stmnt getElse()
Returns the else statement.


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