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 net.sourceforge.phpeclipse.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
14 import net.sourceforge.phpdt.internal.compiler.lookup.Binding;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.lookup.ClassScope;
17 import net.sourceforge.phpdt.internal.compiler.lookup.PackageBinding;
18 import net.sourceforge.phpdt.internal.compiler.lookup.Scope;
19 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
23 public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
25 public int tagSourceStart, tagSourceEnd;
26 public PackageBinding packageBinding;
28 public JavadocQualifiedTypeReference(char[][] sources, long[] pos, int tagStart, int tagEnd) {
30 this.tagSourceStart = tagStart;
31 this.tagSourceEnd = tagEnd;
32 this.bits |= InsideJavadoc;
35 protected void reportInvalidType(Scope scope) {
36 scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers());
38 protected void reportDeprecatedType(Scope scope) {
39 scope.problemReporter().javadocDeprecatedType(this.resolvedType, this, scope.getDeclarationModifiers());
43 * Redefine to capture javadoc specific signatures
44 * @see net.sourceforge.phpdt.internal.compiler.ast.ASTNode#traverse(net.sourceforge.phpdt.internal.compiler.ASTVisitor, net.sourceforge.phpdt.internal.compiler.lookup.BlockScope)
46 public void traverse(ASTVisitor visitor, BlockScope scope) {
47 visitor.visit(this, scope);
48 visitor.endVisit(this, scope);
54 private TypeBinding internalResolveType(Scope scope) {
55 // handle the error here
56 this.constant = NotAConstant;
57 if (this.resolvedType != null) { // is a shared type reference which was already resolved
58 if (!this.resolvedType.isValidBinding())
59 return null; // already reported error
61 this.resolvedType = getTypeBinding(scope);
62 if (!this.resolvedType.isValidBinding()) {
63 Binding binding = scope.getTypeOrPackage(this.tokens);
64 if (binding instanceof PackageBinding) {
65 this.packageBinding = (PackageBinding) binding;
67 reportInvalidType(scope);
71 if (isTypeUseDeprecated(this.resolvedType, scope)) {
72 reportDeprecatedType(scope);
75 return this.resolvedType;
79 * @see net.sourceforge.phpdt.internal.compiler.ast.Expression#resolveType(net.sourceforge.phpdt.internal.compiler.lookup.BlockScope)
80 * We need to override to handle package references
82 public TypeBinding resolveType(BlockScope blockScope) {
83 return internalResolveType(blockScope);
87 * @see net.sourceforge.phpdt.internal.compiler.ast.Expression#resolveType(net.sourceforge.phpdt.internal.compiler.lookup.ClassScope)
88 * We need to override to handle package references
90 public TypeBinding resolveType(ClassScope classScope) {
91 return internalResolveType(classScope);