1 package net.sourceforge.phpdt.internal.compiler.ast;
9 * @author Matthieu Casanova
11 public final class EchoStatement extends Statement {
13 /** An array of expressions in this echo statement. */
14 private final 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.
35 * @param tab how many tabs (not used here
38 public String toString(final int tab) {
39 final String tabs = tabString(tab);
40 final String str = toString();
41 final StringBuffer buff = new StringBuffer(tabs.length() + str.length());
42 return buff.toString();
46 * Get the variables from outside (parameters, globals ...)
48 * @param list the list where we will put variables
50 public void getOutsideVariable(final List list) {
51 for (int i = 0; i < expressions.length; i++) {
52 expressions[i].getOutsideVariable(list);
57 * get the modified variables.
59 * @param list the list where we will put variables
61 public void getModifiedVariable(final List list) {
62 for (int i = 0; i < expressions.length; i++) {
63 expressions[i].getModifiedVariable(list);
68 * Get the variables used.
70 * @param list the list where we will put variables
72 public void getUsedVariable(final List list) {
73 for (int i = 0; i < expressions.length; i++) {
74 expressions[i].getUsedVariable(list);