1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * a variable declaration in an array().
7 * it could take Expression as key.
8 * @author Matthieu Casanova
10 public class ArrayVariableDeclaration extends Expression {
13 public Expression key;
15 /** the array value. */
16 public Expression value;
19 * Create a new array variable declaration.
21 * @param value the value
23 public ArrayVariableDeclaration(final Expression key, final Expression value) {
24 super(key.sourceStart, value.sourceEnd);
30 * Create a new array variable declaration.
32 * @param sourceEnd the end position
34 public ArrayVariableDeclaration(final Expression key, final int sourceEnd) {
35 super(key.sourceStart, sourceEnd);
40 * Return the expression as String.
41 * @return the expression
43 public String toStringExpression() {
44 final StringBuffer buff = new StringBuffer();
45 buff.append(key.toStringExpression());
48 buff.append(value.toStringExpression());
50 return buff.toString();
55 * Get the variables from outside (parameters, globals ...)
57 public void getOutsideVariable(final List list) {
61 * get the modified variables.
63 public void getModifiedVariable(final List list) {
64 key.getModifiedVariable(list);
66 value.getModifiedVariable(list);
71 * Get the variables used.
73 public void getUsedVariable(final List list) {
74 key.getUsedVariable(list);
76 value.getUsedVariable(list);