ast
Class Expr
java.lang.Object
ast.ASTNode
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
|
Constructor Summary |
Expr(int lineNum)
Expr constructor |
|
Method Summary |
abstract java.lang.Object |
accept(Visitor v)
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Expr
public Expr(int lineNum)
- Expr constructor
- Parameters:
lineNum - source line number corresponding to this AST node
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 v)
- Visitor method
- Specified by:
accept in class ASTNode
- Parameters:
v - visitor object
- Returns:
- result of visiting this node
- See Also:
Visitor