X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayDeclarator.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayDeclarator.java index 9b8fd9d..8d2930a 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayDeclarator.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayDeclarator.java @@ -1,19 +1,22 @@ package net.sourceforge.phpdt.internal.compiler.ast; +import java.util.List; +import java.util.ArrayList; + /** * @author Matthieu Casanova */ -public class ArrayDeclarator extends AbstractSuffixExpression { +public class ArrayDeclarator extends AbstractVariable { - public Expression prefix; - public Expression vars; + public AbstractVariable prefix; + public Expression var; - public ArrayDeclarator(Expression prefix, - Expression vars, - int sourceEnd) { + public ArrayDeclarator(final AbstractVariable prefix, + final Expression vars, + final int sourceEnd) { super(prefix.sourceStart, sourceEnd); this.prefix = prefix; - this.vars = vars; + this.var = vars; } /** @@ -23,10 +26,50 @@ public class ArrayDeclarator extends AbstractSuffixExpression { public String toStringExpression() { final StringBuffer buff = new StringBuffer(prefix.toStringExpression()); buff.append('['); - if (vars != null) { - buff.append(vars.toStringExpression()); + if (var != null) { + buff.append(var.toStringExpression()); } buff.append(']'); return buff.toString(); } + + /** + * Return the name of the variable. + * @return the name of the functionName variable + */ + public String getName() { + return prefix.getName(); + } + + /** + * Get the variables from outside (parameters, globals ...) + * @return the variables from outside + */ + public List getOutsideVariable() { + return new ArrayList(1); + } + + /** + * get the modified variables. + * @return the variables from we change value + */ + public List getModifiedVariable() { + final List list = prefix.getModifiedVariable(); + if (var != null) { + list.addAll(var.getModifiedVariable()); + } + return list; + } + + /** + * Get the variables used. + * @return the variables used + */ + public List getUsedVariable() { + final List list = prefix.getUsedVariable(); + if (var != null) { + list.addAll(var.getUsedVariable()); + } + return list; + } }