ast
Class Expr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
Direct Known Subclasses:
ArrayAssignExpr, ArrayExpr, AssignExpr, BinaryExpr, CastExpr, ConstExpr, DispatchExpr, InstanceofExpr, NewArrayExpr, NewExpr, UnaryExpr, VarExpr

public abstract class Expr
extends ASTNode

The abstract Expr class represents an expression that is is contained in either a statement, a field declaration, or another expression. An expression can be either a dispatch expression, a new expression, an assignment expression, a binary expression (comparison, arithmetic, or boolean logic), a unary expression (negation or complement), a variable expression, or a constant expression (int constant, boolean constant, String constant). An expression contains an expression type (exprType), which is set during semantic analysis.

See Also:
ASTNode, DispatchExpr, NewExpr, InstanceofExpr, CastExpr, AssignExpr, BinaryExpr, UnaryExpr, VarExpr, ConstExpr

Field Summary
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
Expr(int lineNum)
          Expr constructor
 
Method Summary
abstract  java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 java.lang.String getExprType()
          Get the type of the expression
 void setExprType(java.lang.String exprType)
          Set the type of the 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
 

Constructor Detail

Expr

public Expr(int lineNum)
Expr constructor

Parameters:
lineNum - source line number corresponding to this AST node
Method Detail

getExprType

public java.lang.String getExprType()
Get the type of the expression

Returns:
the expression type

setExprType

public void setExprType(java.lang.String exprType)
Set the type of the expression

Parameters:
exprType - the type of the expression

accept

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

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