improved PHP parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / internal / compiler / ast / AllocationExpression.java
index 9e898ac..b1c2034 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;
@@ -200,7 +200,19 @@ public class AllocationExpression
 //                     }
                }
        }
+       public StringBuffer printExpression(int indent, StringBuffer output) {
 
+               output.append("new "); //$NON-NLS-1$
+               type.printExpression(0, output); 
+               output.append('(');
+               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(')');
+       }
        public TypeBinding resolveType(BlockScope scope) {
 
                // Propagate the type checking to the arguments, and check if the constructor is defined.
@@ -274,7 +286,7 @@ public class AllocationExpression
                return s;
        }
 
-       public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
+       public void traverse(ASTVisitor visitor, BlockScope scope) {
 
                if (visitor.visit(this, scope)) {
                        int argumentsLength;