|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectast.ASTNode
ast.Expr
ast.VarExpr
public class VarExpr
The VarExpr class represents variable expressions. It contains the name of the variable. Note: these may actually be 'this', 'super', or 'null'. Also, these may or may not include a reference object name (if the variable is a field). Because fields are 'protected' in Bantam Java, the reference object name must always be either 'this' or 'super'.
ASTNode,
Expr| Field Summary | |
|---|---|
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) |
| Fields inherited from class ast.ASTNode |
|---|
charNum, lineNum, lineStr |
| Constructor Summary | |
|---|---|
VarExpr(int lineNum,
Expr ref,
java.lang.String name)
VarExpr constructor |
|
| Method Summary | |
|---|---|
java.lang.Object |
accept(Visitor v)
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) |
| 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 Expr ref
protected java.lang.String name
| Constructor Detail |
|---|
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 variable| Method Detail |
|---|
public Expr getRef()
public java.lang.String getName()
public java.lang.Object accept(Visitor v)
accept in class Exprv - visitor object
Visitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||