ast
Class ExprStmt

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

public class ExprStmt
extends Stmt

The ExprStmt class represents an expression statement (a statement containing a single expression) appearing in a method declaration. It contains an expression (expr).

See Also:
ASTNode, Stmt

Field Summary
protected  Expr expr
          The expression within the statement
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
ExprStmt(int lineNum, Expr expr)
          ExprStmt constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 Expr getExpr()
          Get the expression within the statement
 
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

expr

protected Expr expr
The expression within the statement

Constructor Detail

ExprStmt

public ExprStmt(int lineNum,
                Expr expr)
ExprStmt constructor

Parameters:
lineNum - source line number corresponding to this AST node
expr - the expression within the statement
Method Detail

getExpr

public Expr getExpr()
Get the expression within the statement

Returns:
expression

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