improved PHP parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / ExplicitConstructorCall.java
index 175afee..467b9dd 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.flow.FlowContext;
 import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
@@ -95,8 +95,8 @@ public class ExplicitConstructorCall
        /**
         * Constructor call code generation
         *
-        * @param currentScope org.eclipse.jdt.internal.compiler.lookup.BlockScope
-        * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream
+        * @param currentScope net.sourceforge.phpdt.internal.compiler.lookup.BlockScope
+        * @param codeStream net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
         */
 //     public void generateCode(BlockScope currentScope, CodeStream codeStream) {
 //
@@ -291,7 +291,23 @@ public class ExplicitConstructorCall
        public void setFieldIndex(int depth) {
                // ignore for here
        }
+       public StringBuffer printStatement(int indent, StringBuffer output) {
 
+               printIndent(indent, output);
+               if (qualification != null) qualification.printExpression(0, output).append('.');
+               if (accessMode == This) {
+                       output.append("this("); //$NON-NLS-1$
+               } else {
+                       output.append("super("); //$NON-NLS-1$
+               }
+               if (arguments != null) {
+                       for (int i = 0; i < arguments.length; i++) {
+                               if (i > 0) output.append(", "); //$NON-NLS-1$
+                               arguments[i].printExpression(0, output);
+                       }
+               }
+               return output.append(");"); //$NON-NLS-1$
+       }
        public String toString(int tab) {
 
                String s = tabString(tab);
@@ -312,7 +328,7 @@ public class ExplicitConstructorCall
                return s;
        }
 
-       public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
+       public void traverse(ASTVisitor visitor, BlockScope scope) {
 
                if (visitor.visit(this, scope)) {
                        if (qualification != null) {