koala.dynamicjava.tree
Class ArrayAccess

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Expression
          extended by koala.dynamicjava.tree.PrimaryExpression
              extended by koala.dynamicjava.tree.ArrayAccess
All Implemented Interfaces:
ExpressionContainer, LeftHandSide, SourceInfo.Wrapper

public class ArrayAccess
extends PrimaryExpression
implements LeftHandSide, ExpressionContainer

This class represents the array access nodes of the syntax tree

Version:
1.0 - 1999/04/24
Author:
Stephane Hillion

Field Summary
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
ArrayAccess(Expression exp, Expression cell)
          Creates a new array access node
ArrayAccess(Expression exp, Expression cell, SourceInfo si)
          Creates a new array access node
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getCellNumber()
          Returns the expression which denotes the cell number
 Expression getExpression()
          Returns the expression on which this array access applies
 void setCellNumber(Expression e)
          Sets the expression which denotes the cell number
 void setExpression(Expression e)
          Sets the expression on which this array access applies
 String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayAccess

public ArrayAccess(Expression exp,
                   Expression cell)
Creates a new array access node

Parameters:
exp - the expression on which this array access applies
cell - the cell number
Throws:
IllegalArgumentException - if exp is null or cell is null

ArrayAccess

public ArrayAccess(Expression exp,
                   Expression cell,
                   SourceInfo si)
Creates a new array access node

Parameters:
exp - the expression on which this array access applies
cell - the cell number
Throws:
IllegalArgumentException - if exp is null or cell is null
Method Detail

getExpression

public Expression getExpression()
Returns the expression on which this array access applies

Specified by:
getExpression in interface ExpressionContainer

setExpression

public void setExpression(Expression e)
Sets the expression on which this array access applies

Specified by:
setExpression in interface ExpressionContainer
Throws:
IllegalArgumentException - if e is null

getCellNumber

public Expression getCellNumber()
Returns the expression which denotes the cell number


setCellNumber

public void setCellNumber(Expression e)
Sets the expression which denotes the cell number

Throws:
IllegalArgumentException - if e is null

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class Object