ast
Class WhileStmt

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Stmt
          extended by ast.WhileStmt

public class WhileStmt
extends Stmt

The WhileStmt class represents a while (loop) statement appearing in a method declaration. It contains a predicate expression (predExpr) and body statement (bodyStmt).

See Also:
ASTNode, Stmt

Field Summary
protected  Stmt bodyStmt
          The body statement
protected  Expr predExpr
          The predicate expression
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
WhileStmt(int lineNum, Expr predExpr, Stmt bodyStmt)
          WhileStmt constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 Stmt getBodyStmt()
          Get the body statement
 Expr getPredExpr()
          Get the predicate expression
 
Methods inherited from class ast.ASTNode
getLineNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

predExpr

protected Expr predExpr
The predicate expression


bodyStmt

protected Stmt bodyStmt
The body statement

Constructor Detail

WhileStmt

public WhileStmt(int lineNum,
                 Expr predExpr,
                 Stmt bodyStmt)
WhileStmt constructor

Parameters:
lineNum - source line number corresponding to this AST node
predExpr - the predicate expression
bodyStmt - the then statement
Method Detail

getPredExpr

public Expr getPredExpr()
Get the predicate expression

Returns:
predicate expression

getBodyStmt

public Stmt getBodyStmt()
Get the body statement

Returns:
body statement

accept

public java.lang.Object accept(visitor.Visitor v,
                               java.lang.Object o)
Visitor method

Specified by:
accept in class Stmt
Parameters:
v - visitor object
o - object to pass down
Returns:
result of visiting this node
See Also:
Visitor