X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/Block.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/Block.java index d2fe75f..fa38430 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/Block.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/Block.java @@ -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; @@ -80,7 +80,23 @@ public class Block extends Statement { return statements == null; } + public StringBuffer printBody(int indent, StringBuffer output) { + if (this.statements == null) return output; + for (int i = 0; i < statements.length; i++) { + statements[i].printStatement(indent + 1, output); + output.append('\n'); + } + return output; + } + + public StringBuffer printStatement(int indent, StringBuffer output) { + + printIndent(indent, output); + output.append("{\n"); //$NON-NLS-1$ + printBody(indent, output); + return printIndent(indent, output).append('}'); + } public void resolve(BlockScope upperScope) { if (statements != null) { @@ -138,7 +154,7 @@ public class Block extends Statement { } public void traverse( - IAbstractSyntaxTreeVisitor visitor, + ASTVisitor visitor, BlockScope blockScope) { if (visitor.visit(this, blockScope)) {