1 package net.sourceforge.phpdt.internal.compiler.ast;
5 * @author Matthieu Casanova
7 public class ElseIf extends Statement {
10 public Expression condition;
12 /** The statements. */
13 public Statement[] statements;
15 public ElseIf(Expression condition, Statement[] statements, int sourceStart, int sourceEnd) {
16 super(sourceStart, sourceEnd);
17 this.condition = condition;
18 this.statements = statements;
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("elseif (");
29 buff.append(condition.toStringExpression());
31 for (int i = 0; i < statements.length; i++) {
32 Statement statement = statements[i];
33 buff.append(statement.toString(tab+1)).append('\n');
35 return buff.toString();