public class VarExpr extends Expr
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name
The name of the variable (possibly 'this', 'super', or 'null')
|
protected Expr |
ref
The optional reference object expression
(must be 'this' or 'super' for non-arrays)
|
Constructor and Description |
---|
VarExpr(int lineNum,
Expr ref,
java.lang.String name)
VarExpr constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method
|
java.lang.String |
getName()
Get the name of the variable
|
Expr |
getRef()
Get the reference object expression
Only applicable if variable is a field (otherwise this returns null)
|
getExprType, setExprType
getLineNum
protected Expr ref
protected java.lang.String name
public VarExpr(int lineNum, Expr ref, java.lang.String name)
lineNum
- source line number corresponding to this AST noderef
- the optional reference object expression
(must be 'this' or 'super' for non-arrays)name
- the name of the variablepublic Expr getRef()
public java.lang.String getName()