1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
9 * @author Matthieu Casanova
11 public class EchoStatement extends Statement {
13 /** An array of expressions in this echo statement. */
14 public Expression[] expressions;
16 public EchoStatement (final Expression[] expressions, final int sourceStart) {
17 super(sourceStart, expressions[expressions.length-1].getSourceEnd());
18 this.expressions = expressions;
21 public String toString() {
22 final StringBuffer buff = new StringBuffer("echo ");//$NON-NLS-1$
23 for (int i = 0; i < expressions.length; i++) {
25 buff.append(", ");//$NON-NLS-1$
27 buff.append(expressions[i].toStringExpression());
29 return buff.toString();
33 * Return the object into String.
34 * @param tab how many tabs (not used here
37 public String toString(final int tab) {
38 final String tabs = tabString(tab);
39 final String str = toString();
40 final StringBuffer buff = new StringBuffer(tabs.length()+str.length());
41 return buff.toString();
45 * Get the variables from outside (parameters, globals ...)
46 * @return the variables from outside
48 public List getOutsideVariable() {
49 final ArrayList list = new ArrayList();
50 for (int i = 0; i < expressions.length; i++) {
51 list.addAll(expressions[i].getOutsideVariable());
57 * get the modified variables.
58 * @return the variables from we change value
60 public List getModifiedVariable() {
61 final ArrayList list = new ArrayList();
62 for (int i = 0; i < expressions.length; i++) {
63 list.addAll(expressions[i].getModifiedVariable());
69 * Get the variables used.
70 * @return the variables used
72 public List getUsedVariable() {
73 final ArrayList list = new ArrayList();
74 for (int i = 0; i < expressions.length; i++) {
75 list.addAll(expressions[i].getUsedVariable());