package net.sourceforge.phpdt.internal.compiler.ast; import java.util.List; import java.util.ArrayList; /** * @author Matthieu Casanova */ public class ArrayDeclarator extends AbstractSuffixExpression { public Expression prefix; public Expression vars; public ArrayDeclarator(final Expression prefix, final Expression vars, final int sourceEnd) { super(prefix.sourceStart, sourceEnd); this.prefix = prefix; this.vars = vars; } /** * Return the expression as String. * @return the expression */ public String toStringExpression() { final StringBuffer buff = new StringBuffer(prefix.toStringExpression()); buff.append('['); if (vars != null) { buff.append(vars.toStringExpression()); } buff.append(']'); return buff.toString(); } /** * Get the variables from outside (parameters, globals ...) * @return the variables from outside */ public List getOutsideVariable() { return new ArrayList(); } /** * get the modified variables. * @return the variables from we change value */ public List getModifiedVariable() { final ArrayList list = new ArrayList(); list.addAll(prefix.getModifiedVariable()); list.addAll(vars.getModifiedVariable()); return list; } /** * Get the variables used. * @return the variables used */ public List getUsedVariable() { final ArrayList list = new ArrayList(); list.addAll(prefix.getUsedVariable()); list.addAll(vars.getUsedVariable()); return list; } }