Modifier and Type | Field and Description |
---|---|
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
|
Constructor and Description |
---|
CastExpr(int lineNum,
java.lang.String type,
Expr expr)
CastExpr constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
getExprType, setExprType
getLineNum
protected java.lang.String type
protected Expr expr
protected boolean upcast
public CastExpr(int lineNum, java.lang.String type, Expr expr)
lineNum
- source line number corresponding to this AST nodetype
- the target typeexpr
- expression to castpublic java.lang.String getType()
public Expr getExpr()
public boolean getUpCast()
public void setUpCast(boolean upcast)
upcast
- boolean indicating whether cast is an upcast