1 package net.sourceforge.phpdt.internal.compiler.ast;
7 * it could be list($v1,$v2), list(,$v2) ...
8 * @author Matthieu Casanova
10 public class ListExpression extends Expression {
12 public Expression[] vars;
13 public 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 public void getOutsideVariable(final List list) {
59 * get the modified variables.
61 public void getModifiedVariable(final List list) {
62 for (int i = 0; i < vars.length; i++) {
63 if (vars[i] != null) {
64 vars[i].getUsedVariable(list);
67 if (expression != null) {
68 expression.getModifiedVariable(list);
73 * Get the variables used.
75 public void getUsedVariable(final List list) {
76 if (expression != null) {
77 expression.getUsedVariable(list);