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;
public abstract class AbstractMethodDeclaration
- extends AstNode
+ extends ASTNode
implements ProblemSeverities, ReferenceContext {
public MethodScope scope;
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) {
}
public void traverse(
- IAbstractSyntaxTreeVisitor visitor,
+ ASTVisitor visitor,
ClassScope classScope) {
}
}