1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
7 * @author Matthieu Casanova
9 public class ArrayDeclarator extends AbstractVariable {
11 public AbstractVariable prefix;
12 public Expression var;
14 public ArrayDeclarator(final AbstractVariable prefix,
15 final Expression vars,
16 final int sourceEnd) {
17 super(prefix.sourceStart, sourceEnd);
23 * Return the expression as String.
24 * @return the expression
26 public String toStringExpression() {
27 final StringBuffer buff = new StringBuffer(prefix.toStringExpression());
30 buff.append(var.toStringExpression());
33 return buff.toString();
37 * Return the name of the variable.
38 * @return the name of the prefix variable
40 public String getName() {
41 return prefix.getName();
45 * Get the variables from outside (parameters, globals ...)
46 * @return the variables from outside
48 public List getOutsideVariable() {
49 return new ArrayList(1);
53 * get the modified variables.
54 * @return the variables from we change value
56 public List getModifiedVariable() {
57 final List list = prefix.getModifiedVariable();
59 list.addAll(var.getModifiedVariable());
65 * Get the variables used.
66 * @return the variables used
68 public List getUsedVariable() {
69 final List list = prefix.getUsedVariable();
71 list.addAll(var.getUsedVariable());