|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectast.ASTNode
ast.Expr
ast.CastExpr
public class CastExpr
The CastExpr class represents a cast expression. It contains a target type name (type), an expression to cast (expr), and a flag indicating whether the cast is an upcast (upcast).
ASTNode
,
Expr
Field Summary | |
---|---|
protected Expr |
expr
The expression to cast |
protected java.lang.String |
type
The target type |
protected boolean |
upcast
Boolean indicating whether the cast is an upcast |
Fields inherited from class ast.ASTNode |
---|
charNum, lineNum, lineStr |
Constructor Summary | |
---|---|
CastExpr(int lineNum,
java.lang.String type,
Expr expr)
CastExpr constructor |
Method Summary | |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method |
Expr |
getExpr()
Get the expression to cast |
java.lang.String |
getType()
Get the target type |
boolean |
getUpCast()
Is this an upcast? |
void |
setUpCast(boolean upcast)
Set whether the cast is an upcast |
Methods inherited from class ast.Expr |
---|
getExprType, setExprType |
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 |
---|
protected java.lang.String type
protected Expr expr
protected boolean upcast
Constructor Detail |
---|
public CastExpr(int lineNum, java.lang.String type, Expr expr)
lineNum
- source line number corresponding to this AST nodetype
- the target typeexpr
- expression to castMethod Detail |
---|
public java.lang.String getType()
public Expr getExpr()
public boolean getUpCast()
public void setUpCast(boolean upcast)
upcast
- boolean indicating whether cast is an upcastpublic java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
accept
in class Expr
v
- visitor objecto
- object to pass down
Visitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |