1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * An access to a key of an array.
7 * @author Matthieu Casanova
9 public final class ArrayDeclarator extends AbstractVariable {
11 /** The name of the array. */
12 private final AbstractVariable prefix;
15 private final Expression key;
18 * Create an ArrayDeclarator.
19 * @param prefix the prefix, it could be a variable.
21 * @param sourceEnd the end of the expression
23 public ArrayDeclarator(final AbstractVariable prefix,
25 final int sourceEnd) {
26 super(prefix.sourceStart, sourceEnd);
32 * Return the expression as String.
33 * @return the expression
35 public String toStringExpression() {
36 final StringBuffer buff = new StringBuffer(prefix.toStringExpression());
39 buff.append(key.toStringExpression());
42 return buff.toString();
46 * Return the name of the variable.
47 * @return the name of the functionName variable
49 public String getName() {
50 return prefix.getName();
54 * Get the variables from outside (parameters, globals ...)
55 * @param list the list where we will put variables
57 public void getOutsideVariable(final List list) {}
60 * get the modified variables.
61 * @param list the list where we will put variables
63 public void getModifiedVariable(final List list) {
64 prefix.getModifiedVariable(list);
66 key.getModifiedVariable(list);
71 * Get the variables used.
72 * @param list the list where we will put variables
74 public void getUsedVariable(final List list) {
75 prefix.getUsedVariable(list);
77 key.getUsedVariable(list);