edu.ksu.cis.projects.bogor.ast
Class ArrayAccessExp

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Exp
          extended by edu.ksu.cis.projects.bogor.ast.LValueExp
              extended by edu.ksu.cis.projects.bogor.ast.ArrayAccessExp
All Implemented Interfaces:
IExpParent, Disposable, Serializable, Cloneable

public final class ArrayAccessExp
extends LValueExp

Array access exp AST.

Version:
CVS $Revision: 1.4 $ $Date: 2005/01/13 23:40:09 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Exp
TYPE
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
ArrayAccessExp(Exp exp, Exp index)
          Default constructor.
 
Method Summary
 ArrayAccessExp clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Disposes exp and index.
 Exp getExp()
          Gets the exp.
 Exp getIndex()
          Gets the index exp.
 void setExp(Exp newExp)
          Sets the exp.
 void setIndex(Exp newIndex)
          Sets the index exp.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Exp
getParent, setParent
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayAccessExp

public ArrayAccessExp(Exp exp,
                      Exp index)
Default constructor. Sets this object as the exp's and index's parent.

Parameters:
exp - The exp. Must be non-null.
index - The index exp. Must be non-null.
Method Detail

setExp

public void setExp(Exp newExp)
Sets the exp. Sets this object as the exp's parent.

Parameters:
newExp - The new exp. Must be non-null.

getExp

public Exp getExp()
Gets the exp.

Returns:
The exp. Non-null.

setIndex

public void setIndex(Exp newIndex)
Sets the index exp. Sets this object as the index exp's parent.

Parameters:
newIndex - The new index exp. Must be non-null.

getIndex

public Exp getIndex()
Gets the index exp.

Returns:
The index exp. Non-null.

clone

public ArrayAccessExp clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class LValueExp
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Disposes exp and index. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Exp

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
"exp[index]".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node