1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
7 * a variable declaration in an array().
8 * it could take Expression as key.
9 * @author Matthieu Casanova
11 public class ArrayVariableDeclaration extends Expression {
14 public Expression key;
16 /** the array value. */
17 public Expression value;
20 * Create a new array variable declaration.
22 * @param value the value
24 public ArrayVariableDeclaration(final Expression key, final Expression value) {
25 super(key.sourceStart, value.sourceEnd);
31 * Create a new array variable declaration.
33 * @param sourceEnd the end position
35 public ArrayVariableDeclaration(final Expression key, final int sourceEnd) {
36 super(key.sourceStart, sourceEnd);
41 * Return the expression as String.
42 * @return the expression
44 public String toStringExpression() {
45 final StringBuffer buff = new StringBuffer();
46 buff.append(key.toStringExpression());
49 buff.append(value.toStringExpression());
51 return buff.toString();
56 * Get the variables from outside (parameters, globals ...)
57 * @return the variables from outside
59 public List getOutsideVariable() {
60 return new ArrayList();
64 * get the modified variables.
65 * @return the variables from we change value
67 public List getModifiedVariable() {
68 final ArrayList list = new ArrayList();
69 list.addAll(key.getModifiedVariable());
71 list.addAll(value.getModifiedVariable());
77 * Get the variables used.
78 * @return the variables used
80 public List getUsedVariable() {
81 final ArrayList list = new ArrayList();
83 list.addAll(value.getUsedVariable());