X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayVariableDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayVariableDeclaration.java index 38d3527..4322f61 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayVariableDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayVariableDeclaration.java @@ -1,24 +1,42 @@ package net.sourceforge.phpdt.internal.compiler.ast; +import java.util.List; +import java.util.ArrayList; + /** - * This variable declaration do not extend AbstractVariableDeclaration because + * a variable declaration in an array(). * it could take Expression as key. * @author Matthieu Casanova */ public class ArrayVariableDeclaration extends Expression { - public Expression key,value; + /** the array key. */ + public Expression key; + + /** the array value. */ + public Expression value; - public ArrayVariableDeclaration(Expression key,Expression value) { + /** + * Create a new array variable declaration. + * @param key the key + * @param value the value + */ + public ArrayVariableDeclaration(final Expression key, final Expression value) { super(key.sourceStart, value.sourceEnd); this.key = key; this.value = value; } - public ArrayVariableDeclaration(Expression key,int sourceEnd) { + /** + * Create a new array variable declaration. + * @param key the key + * @param sourceEnd the end position + */ + public ArrayVariableDeclaration(final Expression key, final int sourceEnd) { super(key.sourceStart, sourceEnd); this.key = key; } + /** * Return the expression as String. * @return the expression @@ -32,4 +50,38 @@ public class ArrayVariableDeclaration extends Expression { } 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(key.getModifiedVariable()); + if (value != null) { + list.addAll(value.getModifiedVariable()); + } + return list; + } + + /** + * Get the variables used. + * @return the variables used + */ + public List getUsedVariable() { + final ArrayList list = new ArrayList(); + if (value != null) { + list.addAll(value.getUsedVariable()); + } + return list; + } }