1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
14 import net.sourceforge.phpdt.internal.compiler.lookup.*;
16 public class QualifiedTypeReference extends TypeReference {
17 public char[][] tokens;
18 public long[] sourcePositions;
19 public QualifiedTypeReference(char[][] sources , long[] poss) {
21 sourcePositions = poss ;
22 sourceStart = (int) (sourcePositions[0]>>>32) ;
23 sourceEnd = (int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFFL ) ;
25 public QualifiedTypeReference(char[][] sources , TypeBinding tb , long[] poss) {
29 public TypeReference copyDims(int dim){
30 //return a type reference copy of me with some dimensions
31 //warning : the new type ref has a null binding
33 return new ArrayQualifiedTypeReference(tokens,null,dim,sourcePositions) ;
35 public TypeBinding getTypeBinding(Scope scope) {
38 return scope.getType(tokens);
40 public char[][] getTypeName(){
44 public String toStringExpression(int tab) {
45 StringBuffer buffer = new StringBuffer();
46 for (int i = 0; i < tokens.length; i++) {
47 buffer.append(tokens[i]);
48 if (i < (tokens.length - 1)) {
49 buffer.append("."); //$NON-NLS-1$
52 return buffer.toString();
54 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
55 visitor.visit(this, scope);
56 visitor.endVisit(this, scope);
58 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope scope) {
59 visitor.visit(this, scope);
60 visitor.endVisit(this, scope);