improved PHP parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / DoStatement.java
index 8dedd3b..d9c5745 100644 (file)
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package net.sourceforge.phpeclipse.internal.compiler.ast;
 
-import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
+import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
 import net.sourceforge.phpdt.internal.compiler.codegen.Label;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowContext;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
@@ -166,7 +166,18 @@ public class DoStatement extends Statement {
                if (action != null)
                        action.resolve(scope);
        }
+       public StringBuffer printStatement(int indent, StringBuffer output) {
 
+               printIndent(indent, output).append("do"); //$NON-NLS-1$
+               if (action == null)
+                       output.append(" ;\n"); //$NON-NLS-1$
+               else {
+                       output.append('\n');
+                       action.printStatement(indent + 1, output).append('\n');
+               }
+               output.append("while ("); //$NON-NLS-1$
+               return condition.printExpression(0, output).append(");"); //$NON-NLS-1$
+       }
        public String toString(int tab) {
 
                String inFront, s = tabString(tab);
@@ -182,7 +193,7 @@ public class DoStatement extends Statement {
                return s;
        }
 
-       public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
+       public void traverse(ASTVisitor visitor, BlockScope scope) {
 
                if (visitor.visit(this, scope)) {
                        if (action != null) {