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 QualifiedTypeReference extends TypeReference {
18 public char[][] tokens;
19 public long[] sourcePositions;
21 public QualifiedTypeReference(char[][] sources , long[] poss) {
24 sourcePositions = poss ;
25 sourceStart = (int) (sourcePositions[0]>>>32) ;
26 sourceEnd = (int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFFL ) ;
29 public QualifiedTypeReference(char[][] sources , TypeBinding type , long[] poss) {
32 this.resolvedType = type;
35 public TypeReference copyDims(int dim){
36 //return a type reference copy of me with some dimensions
37 //warning : the new type ref has a null binding
38 return new ArrayQualifiedTypeReference(tokens,null,dim,sourcePositions) ;
41 public TypeBinding getTypeBinding(Scope scope) {
43 if (this.resolvedType != null)
44 return this.resolvedType;
45 return scope.getType(tokens);
48 public char[][] getTypeName(){
53 public StringBuffer printExpression(int indent, StringBuffer output) {
55 for (int i = 0; i < tokens.length; i++) {
56 if (i > 0) output.append('.');
57 output.append(tokens[i]);
62 public void traverse(ASTVisitor visitor, BlockScope scope) {
64 visitor.visit(this, scope);
65 visitor.endVisit(this, scope);
68 public void traverse(ASTVisitor visitor, ClassScope scope) {
70 visitor.visit(this, scope);
71 visitor.endVisit(this, scope);