1 package net.sourceforge.phpdt.internal.compiler.ast;
4 * @author Matthieu Casanova
6 public class Else extends Statement {
8 public Statement[] statements;
10 public Else(Statement[] statements, int sourceStart, int sourceEnd) {
11 super(sourceStart, sourceEnd);
12 this.statements = statements;
15 public Else(Statement statement, int sourceStart, int sourceEnd) {
16 super(sourceStart, sourceEnd);
17 this.statements = new Statement[1];
18 this.statements[0] = statement;
22 * Return the object into String.
23 * @param tab how many tabs (not used here
26 public String toString(int tab) {
27 final StringBuffer buff = new StringBuffer(tabString(tab));
28 buff.append("else \n");
29 for (int i = 0; i < statements.length; i++) {
30 Statement statement = statements[i];
31 buff.append(statement.toString(tab + 1)).append('\n');
33 return buff.toString();