1 package net.sourceforge.phpdt.internal.compiler.ast;
 
   4  * @author Matthieu Casanova
 
   6 public class DoStatement extends Statement {
 
   9   /** The condition expression. */
 
  10   public Expression condition;
 
  11   /** The action of the while. (it could be a block) */
 
  12   public Statement action;
 
  14   public DoStatement(Expression condition,
 
  18     super(sourceStart, sourceEnd);
 
  19     this.condition = condition;
 
  24    * Return the object into String.
 
  25    * @param tab how many tabs (not used here
 
  28   public String toString(int tab) {
 
  29     final String s = tabString(tab);
 
  30     final StringBuffer buff = new StringBuffer("do "); //$NON-NLS-1$
 
  32       buff.append(" {} ;"); //$NON-NLS-1$
 
  34       buff.append("\n").append(action.toString(tab + 1)); //$NON-NLS-1$
 
  36     buff.append(s).append(" while (");
 
  37     buff.append(condition.toStringExpression()).append(")");    //$NON-NLS-1$
 
  38     return buff.toString();