Refactored packagename to net.sourceforge.phpdt.internal.compiler.ast
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / QualifiedTypeReference.java
index 3987a6c..102804e 100644 (file)
@@ -1,17 +1,20 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v0.5 
+ * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
+ * http://www.eclipse.org/legal/cpl-v10.html
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
- ******************************************************************************/
+ *******************************************************************************/
 package net.sourceforge.phpdt.internal.compiler.ast;
 
-import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
-import net.sourceforge.phpdt.internal.compiler.lookup.*;
+import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
+import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
+import net.sourceforge.phpdt.internal.compiler.lookup.ClassScope;
+import net.sourceforge.phpdt.internal.compiler.lookup.Scope;
+import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
 
 public class QualifiedTypeReference extends TypeReference {
        public char[][] tokens;
@@ -22,9 +25,9 @@ public QualifiedTypeReference(char[][] sources , long[] poss) {
        sourceStart = (int) (sourcePositions[0]>>>32) ;
        sourceEnd = (int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFFL ) ;
 }
-public QualifiedTypeReference(char[][] sources , TypeBinding tb , long[] poss) {
+public QualifiedTypeReference(char[][] sources , TypeBinding type , long[] poss) {
        this(sources,poss);
-       binding = tb;
+       this.resolvedType = type;
 }
 public TypeReference copyDims(int dim){
        //return a type reference copy of me with some dimensions
@@ -33,14 +36,22 @@ public TypeReference copyDims(int dim){
        return new ArrayQualifiedTypeReference(tokens,null,dim,sourcePositions) ;
 }
 public TypeBinding getTypeBinding(Scope scope) {
-       if (binding != null)
-               return binding;
+       if (this.resolvedType != null)
+               return this.resolvedType;
        return scope.getType(tokens);
 }
 public char[][] getTypeName(){
 
        return tokens;
 }
+public StringBuffer printExpression(int indent, StringBuffer output) {
+       
+       for (int i = 0; i < tokens.length; i++) {
+               if (i > 0) output.append('.');
+               output.append(tokens[i]);
+       }
+       return output;
+}
 public String toStringExpression(int tab) {
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < tokens.length; i++) {
@@ -51,11 +62,11 @@ public String toStringExpression(int tab) {
        }
        return buffer.toString();
 }
-public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope scope) {
+public void traverse(ASTVisitor visitor, BlockScope scope) {
        visitor.visit(this, scope);
        visitor.endVisit(this, scope);
 }
-public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope scope) {
+public void traverse(ASTVisitor visitor, ClassScope scope) {
        visitor.visit(this, scope);
        visitor.endVisit(this, scope);
 }