|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectast.ASTNode
ast.Expr
ast.ArrayExpr
public class ArrayExpr
The ArrayExpr class represents array expressions. It contains the name of the variable and an index expression. Note: these may or may not include a reference object name (if the array 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 Expr |
index
The index expression |
protected java.lang.String |
name
The name of the variable (possibly 'this', 'super', or 'null') |
protected Expr |
ref
The optional reference object (must be 'this' or 'super') |
Fields inherited from class ast.ASTNode |
---|
charNum, lineNum, lineStr |
Constructor Summary | |
---|---|
ArrayExpr(int lineNum,
Expr ref,
java.lang.String name,
Expr index)
ArrayExpr constructor |
Method Summary | |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method |
Expr |
getIndex()
Get the index expression |
java.lang.String |
getName()
Get the name of the array |
Expr |
getRef()
Get the reference object Only applicable if array 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
protected Expr index
Constructor Detail |
---|
public ArrayExpr(int lineNum, Expr ref, java.lang.String name, Expr index)
lineNum
- source line number corresponding to this AST noderef
- the optional reference object (must be 'this' or 'super')name
- the name of the variableindex
- the index expressionMethod Detail |
---|
public Expr getRef()
public java.lang.String getName()
public Expr getIndex()
public 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 |