edu.rice.cs.javalanglevels.tree
Class WhileStatement

java.lang.Object
  extended by edu.rice.cs.javalanglevels.tree.JExpression
      extended by edu.rice.cs.javalanglevels.tree.Statement
          extended by edu.rice.cs.javalanglevels.tree.WhileStatement
All Implemented Interfaces:
BodyItemI, JExpressionIF

public class WhileStatement
extends Statement

Class WhileStatement, a component of the JExpressionIF composite hierarchy. Note: null is not allowed as a value for any field.

Version:
Generated automatically by ASTGen at Sun Mar 04 23:01:27 CST 2012

Constructor Summary
WhileStatement(SourceInfo in_sourceInfo, Expression in_condition, Statement in_code)
          Constructs a WhileStatement.
 
Method Summary
 boolean equals(Object obj)
          Implementation of equals that is based on the values of the fields of the object.
protected  int generateHashCode()
          Implementation of hashCode that is consistent with equals.
 Statement getCode()
           
 Expression getCondition()
           
 void output(Writer writer)
          Prints this object out as a nicely tabbed tree.
 void outputHelp(TabPrintWriter writer)
           
 String toString()
          Implementation of toString that uses output(java.io.Writer) to generated nicely tabbed tree.
 void visit(JExpressionIFVisitor_void visitor)
           
<RetType> RetType
visit(JExpressionIFVisitor<RetType> visitor)
           
 
Methods inherited from class edu.rice.cs.javalanglevels.tree.JExpression
getSourceInfo, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.rice.cs.javalanglevels.tree.JExpressionIF
getSourceInfo
 

Constructor Detail

WhileStatement

public WhileStatement(SourceInfo in_sourceInfo,
                      Expression in_condition,
                      Statement in_code)
Constructs a WhileStatement.

Throws:
IllegalArgumentException - If any parameter to the constructor is null.
Method Detail

getCondition

public final Expression getCondition()

getCode

public final Statement getCode()

visit

public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor)
Specified by:
visit in interface JExpressionIF
Specified by:
visit in class Statement

visit

public void visit(JExpressionIFVisitor_void visitor)
Specified by:
visit in interface JExpressionIF
Specified by:
visit in class Statement

toString

public String toString()
Implementation of toString that uses output(java.io.Writer) to generated nicely tabbed tree.

Overrides:
toString in class Object

output

public void output(Writer writer)
Prints this object out as a nicely tabbed tree.


outputHelp

public void outputHelp(TabPrintWriter writer)
Specified by:
outputHelp in interface JExpressionIF
Specified by:
outputHelp in class Statement

equals

public boolean equals(Object obj)
Implementation of equals that is based on the values of the fields of the object. Thus, two objects created with identical parameters will be equal.

Overrides:
equals in class Object

generateHashCode

protected int generateHashCode()
Implementation of hashCode that is consistent with equals. The value of the hashCode is formed by XORing the hashcode of the class object with the hashcodes of all the fields of the object.

Specified by:
generateHashCode in class Statement