X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/ArrayAllocationExpression.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/ArrayAllocationExpression.java index 93a145a..524ad04 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/ArrayAllocationExpression.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/internal/compiler/ast/ArrayAllocationExpression.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.flow.FlowContext; import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo; import net.sourceforge.phpdt.internal.compiler.impl.Constant; @@ -91,7 +91,22 @@ public class ArrayAllocationExpression extends Expression { // // codeStream.recordPositionsFrom(pc, this.sourceStart); // } + public StringBuffer printExpression(int indent, StringBuffer output) { + output.append("new "); //$NON-NLS-1$ + type.print(0, output); + for (int i = 0; i < dimensions.length; i++) { + if (dimensions[i] == null) + output.append("[]"); //$NON-NLS-1$ + else { + output.append('['); + dimensions[i].printExpression(0, output); + output.append(']'); + } + } + if (initializer != null) initializer.printExpression(0, output); + return output; + } public TypeBinding resolveType(BlockScope scope) { // Build an array type reference using the current dimensions @@ -169,7 +184,7 @@ public class ArrayAllocationExpression extends Expression { return s; } - public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) { + public void traverse(ASTVisitor visitor, BlockScope scope) { if (visitor.visit(this, scope)) { int dimensionsLength = dimensions.length;