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, final int sourceEnd) {
17 super(sourceStart, sourceEnd);
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 ...)
47 public void getOutsideVariable(final List list) {
48 for (int i = 0; i < expressions.length; i++) {
49 expressions[i].getOutsideVariable(list);
54 * get the modified variables.
56 public void getModifiedVariable(final List list) {
57 for (int i = 0; i < expressions.length; i++) {
58 expressions[i].getModifiedVariable(list);
63 * Get the variables used.
65 public void getUsedVariable(final List list) {
66 for (int i = 0; i < expressions.length; i++) {
67 expressions[i].getUsedVariable(list);