1 package net.sourceforge.phpdt.internal.compiler.ast;
3 import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage;
6 import java.util.ArrayList;
9 * @author Matthieu Casanova
11 public class ArrayInitializer extends Expression {
13 public ArrayVariableDeclaration[] vars;
15 public ArrayInitializer(final ArrayVariableDeclaration[] vars,
16 final int sourceStart,
17 final int sourceEnd) {
18 super(sourceStart, sourceEnd);
23 * Return the expression as String.
24 * @return the expression
26 public String toStringExpression() {
27 final StringBuffer buff = new StringBuffer("array(");
28 for (int i = 0; i < vars.length; i++) {
29 final ArrayVariableDeclaration var = vars[i];
33 buff.append(var.toStringExpression());
36 return buff.toString();
40 * Get the variables from outside (parameters, globals ...)
41 * @return the variables from outside
43 public List getOutsideVariable() {
44 return new ArrayList();
48 * get the modified variables.
49 * @return the variables from we change value
51 public List getModifiedVariable() {
52 final ArrayList list = new ArrayList();
53 for (int i = 0; i < vars.length; i++) {
54 list.addAll(vars[i].getModifiedVariable());
60 * Get the variables used.
61 * @return the variables used
63 public List getUsedVariable() {
64 final ArrayList list = new ArrayList();
65 for (int i = 0; i < vars.length; i++) {
66 list.addAll(vars[i].getUsedVariable());