Temporarily removed all references to com.quantum.util.connection.NotConnectedException
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / AbstractMethodDeclaration.java
index 15b28ed..217f853 100644 (file)
@@ -11,8 +11,8 @@
 package net.sourceforge.phpeclipse.internal.compiler.ast;
 
 import net.sourceforge.phpdt.core.compiler.CharOperation;
+import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
 import net.sourceforge.phpdt.internal.compiler.CompilationResult;
-import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
 import net.sourceforge.phpdt.internal.compiler.flow.InitializationFlowContext;
 import net.sourceforge.phpdt.internal.compiler.impl.ReferenceContext;
@@ -30,7 +30,7 @@ import net.sourceforge.phpdt.internal.compiler.problem.ProblemSeverities;
 
 
 public abstract class AbstractMethodDeclaration
-       extends AstNode
+       extends ASTNode
        implements ProblemSeverities, ReferenceContext {
                
        public MethodScope scope;
@@ -309,7 +309,50 @@ public abstract class AbstractMethodDeclaration
        public abstract void parseStatements(
                UnitParser parser,
                CompilationUnitDeclaration unit);
+       public StringBuffer print(int tab, StringBuffer output) {
+
+               printIndent(tab, output);
+               printModifiers(this.modifiers, output);
+               printReturnType(0, output).append(this.selector).append('(');
+               if (this.arguments != null) {
+                       for (int i = 0; i < this.arguments.length; i++) {
+                               if (i > 0) output.append(", "); //$NON-NLS-1$
+                               this.arguments[i].print(0, output);
+                       }
+               }
+               output.append(')');
+               if (this.thrownExceptions != null) {
+                       output.append(" throws "); //$NON-NLS-1$
+                       for (int i = 0; i < this.thrownExceptions.length; i++) {
+                               if (i > 0) output.append(", "); //$NON-NLS-1$
+                               this.thrownExceptions[i].print(0, output);
+                       }
+               }
+               printBody(tab + 1, output);
+               return output;
+       }
+
+       public StringBuffer printBody(int indent, StringBuffer output) {
+
+               if (isAbstract() || (this.modifiers & AccSemicolonBody) != 0) 
+                       return output.append(';');
 
+               output.append(" {"); //$NON-NLS-1$
+               if (this.statements != null) {
+                       for (int i = 0; i < this.statements.length; i++) {
+                               output.append('\n');
+                               this.statements[i].printStatement(indent, output); 
+                       }
+               }
+               output.append('\n'); //$NON-NLS-1$
+               printIndent(indent == 0 ? 0 : indent - 1, output).append('}');
+               return output;
+       }
+
+       public StringBuffer printReturnType(int indent, StringBuffer output) {
+               
+               return output;
+       }
        public void resolve(ClassScope upperScope) {
 
                if (binding == null) {
@@ -393,7 +436,7 @@ public abstract class AbstractMethodDeclaration
        }
 
        public void traverse(
-               IAbstractSyntaxTreeVisitor visitor,
+           ASTVisitor visitor,
                ClassScope classScope) {
        }
 }