|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcetus.hir.Expression
cetus.hir.ArrayAccess
public class ArrayAccess
Represents the access of an array or pointer variable: array[x][y]...
| Field Summary |
|---|
| Fields inherited from class cetus.hir.Expression |
|---|
children, needs_parens, object_print_method, parent |
| Constructor Summary | |
|---|---|
ArrayAccess(Expression array,
Expression index)
Creates an array access with a single index expression. |
|
ArrayAccess(Expression array,
java.util.List indices)
Creates an array access with multiple index expressions. |
|
| Method Summary | |
|---|---|
void |
addIndex(Expression expr)
|
java.lang.Object |
clone()
Creates and returns a deep copy of this expression. |
static void |
defaultPrint(ArrayAccess expr,
java.io.OutputStream stream)
Prints an array access expression to a stream. |
Expression |
getArrayName()
Returns the expression being indexed. |
Expression |
getIndex(int n)
Gets the nth index expression of this array access. |
java.util.List<Expression> |
getIndices()
Returns the list of indices in the array access. |
int |
getNumIndices()
Returns the number of index expressions used in this array access. |
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently created objects will use the supplied method. |
void |
setIndex(int n,
Expression expr)
Sets the nth index expression of this array access. |
void |
setIndices(java.util.List indices)
Set the list of index expressions. |
java.lang.String |
toString()
Every expression class should override toString method. |
| Methods inherited from class cetus.hir.Expression |
|---|
compareTo, equals, equals2, findExpression, getChildren, getParent, getStatement, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verify |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayAccess(Expression array,
Expression index)
array - An expression evaluating to an address.index - The expression with which to index the array.
public ArrayAccess(Expression array,
java.util.List indices)
array - An expression evaluating to an address.indices - A list of expressions with which to index the array.| Method Detail |
|---|
public void addIndex(Expression expr)
public java.lang.Object clone()
Expression
clone in class Expression
public static void defaultPrint(ArrayAccess expr,
java.io.OutputStream stream)
expr - The array access to print.stream - The stream on which to print the array access.public java.lang.String toString()
Expression
toString in class Expressionpublic Expression getArrayName()
public Expression getIndex(int n)
n - The position of the index expression.
java.lang.IndexOutOfBoundsException - if there is no expression at that position.public java.util.List<Expression> getIndices()
public int getNumIndices()
public void setIndex(int n,
Expression expr)
n - The position of the index expression.expr - The expression to use for the index.
java.lang.IndexOutOfBoundsException - if there is no expression at that position.public void setIndices(java.util.List indices)
indices - A list of expressions.public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||