1 package net.sourceforge.phpdt.internal.compiler.ast;
7 * it could be list($v1,$v2), list(,$v2) ...
8 * @author Matthieu Casanova
10 public final class ListExpression extends Expression {
12 private final Expression[] vars;
13 private Expression expression;
15 public ListExpression(final Expression[] vars,
16 final Expression expression,
17 final int sourceStart,
18 final int sourceEnd) {
19 super(sourceStart, sourceEnd);
21 this.expression = expression;
24 public ListExpression(final Expression[] vars,
25 final int sourceStart,
26 final int sourceEnd) {
27 super(sourceStart, sourceEnd);
32 * Return the expression as String.
33 * @return the expression
35 public String toStringExpression() {
36 final StringBuffer buff = new StringBuffer("list(");
37 for (int i = 0; i < vars.length; i++) {
41 if (vars[i] != null) {
42 buff.append(vars[i].toStringExpression());
45 if (expression != null) {
47 buff.append(expression.toStringExpression());
49 return buff.toString();
53 * Get the variables from outside (parameters, globals ...)
55 * @param list the list where we will put variables
57 public void getOutsideVariable(final List list) {}
60 * get the modified variables.
62 * @param list the list where we will put variables
64 public void getModifiedVariable(final List list) {
65 for (int i = 0; i < vars.length; i++) {
66 if (vars[i] != null) {
67 vars[i].getUsedVariable(list);
70 if (expression != null) {
71 expression.getModifiedVariable(list);
76 * Get the variables used.
78 * @param list the list where we will put variables
80 public void getUsedVariable(final List list) {
81 if (expression != null) {
82 expression.getUsedVariable(list);