removed Makefile; lifted repo/org.ibex.tool/src/ to src/
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / ast / ArrayQualifiedTypeReference.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
12
13 import org.eclipse.jdt.internal.compiler.ASTVisitor;
14 import org.eclipse.jdt.internal.compiler.lookup.*;
15
16 public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
17         int dimensions;
18         
19         public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) {
20                 
21                 super( sources , poss);
22                 dimensions = dim ;
23         }
24         
25         public ArrayQualifiedTypeReference(char[][] sources , TypeBinding tb, int dim, long[] poss) {
26                 
27                 super( sources , tb, poss);
28                 dimensions = dim ;
29         }
30         
31         public int dimensions() {
32                 
33                 return dimensions;
34         }
35         
36         public TypeBinding getTypeBinding(Scope scope) {
37                 
38                 if (this.resolvedType != null)
39                         return this.resolvedType;
40                 if (dimensions > 255) {
41                         scope.problemReporter().tooManyDimensions(this);
42                 }
43                 return scope.createArray(scope.getType(tokens), dimensions);
44         }
45         
46         public StringBuffer printExpression(int indent, StringBuffer output){
47                 
48                 super.printExpression(indent, output);
49                 for (int i = 0 ; i < dimensions ; i++) {
50                         output.append("[]"); //$NON-NLS-1$
51                 }
52                 return output;
53         }
54         
55         public void traverse(ASTVisitor visitor, BlockScope scope) {
56                 
57                 visitor.visit(this, scope);
58                 visitor.endVisit(this, scope);
59         }
60         
61         public void traverse(ASTVisitor visitor, ClassScope scope) {
62                 
63                 visitor.visit(this, scope);
64                 visitor.endVisit(this, scope);
65         }
66 }