All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.WhileStatement
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.NonLeaf
|
+----openjava.ptree.WhileStatement
- public class WhileStatement
- extends NonLeaf
- implements Statement, Ptree
The WhileStatement class presents while statement node
of parse tree
- See Also:
- Ptree, NonLeaf, Statement
-
WhileStatement(Expression, StatementList)
- Allocates a new object.
-
getExpression()
- Gets the condtion of this while statement.
-
getStatements()
- Gets the body of this while statement.
-
setExpression(Expression)
- Sets the condtion of this while statement.
-
setStatements(StatementList)
- Sets the body of this while statement.
-
writeCode()
- Writes the code this parse-tree presents for.
WhileStatement
public WhileStatement(Expression expr,
StatementList stmts)
- Allocates a new object.
- Parameters:
- expr - the expression of the condition of this while
statement.
- stmts - the statement list of the body oof this while
statement.
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getExpression
public Expression getExpression()
- Gets the condtion of this while statement.
- Returns:
- the expression of the condtion.
setExpression
public void setExpression(Expression expr)
- Sets the condtion of this while statement.
- Parameters:
- expr - the expression of the condtion to set.
getStatements
public StatementList getStatements()
- Gets the body of this while statement.
- Returns:
- the statement list of the body.
setStatements
public void setStatements(StatementList stmts)
- Sets the body of this while statement.
- Parameters:
- stmts - the statement list of the body to set.
All Packages Class Hierarchy This Package Previous Next Index