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 ...)
58 public void getOutsideVariable(final List list) {
62 * get the modified variables.
64 public void getModifiedVariable(final List list) {
65 key.getModifiedVariable(list);
67 value.getModifiedVariable(list);
72 * Get the variables used.
74 public void getUsedVariable(final List list) {
75 key.getUsedVariable(list);
77 value.getUsedVariable(list);