1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
13 import org.eclipse.jdt.internal.compiler.ASTVisitor;
14 import org.eclipse.jdt.internal.compiler.lookup.*;
16 public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
19 public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) {
21 super( sources , poss);
25 public ArrayQualifiedTypeReference(char[][] sources , TypeBinding tb, int dim, long[] poss) {
27 super( sources , tb, poss);
31 public int dimensions() {
36 public TypeBinding getTypeBinding(Scope scope) {
38 if (this.resolvedType != null)
39 return this.resolvedType;
40 if (dimensions > 255) {
41 scope.problemReporter().tooManyDimensions(this);
43 return scope.createArray(scope.getType(tokens), dimensions);
46 public StringBuffer printExpression(int indent, StringBuffer output){
48 super.printExpression(indent, output);
49 for (int i = 0 ; i < dimensions ; i++) {
50 output.append("[]"); //$NON-NLS-1$
55 public void traverse(ASTVisitor visitor, BlockScope scope) {
57 visitor.visit(this, scope);
58 visitor.endVisit(this, scope);
61 public void traverse(ASTVisitor visitor, ClassScope scope) {
63 visitor.visit(this, scope);
64 visitor.endVisit(this, scope);