Makefile fixup
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / ast / JavadocSingleNameReference.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 JavadocSingleNameReference extends SingleNameReference {
17
18         public int tagSourceStart, tagSourceEnd;
19
20         public JavadocSingleNameReference(char[] name, int startPosition, int endPosition) {
21                 super(name, (((long) startPosition) << 32) + endPosition);
22                 this.bits |= InsideJavadoc;
23         }
24
25         public void resolve(BlockScope scope) {
26                 resolve(scope, true);
27         }
28
29         /**
30          * Resolve without warnings
31          */
32         public void resolve(BlockScope scope, boolean warn) {
33                 
34                 LocalVariableBinding variableBinding = scope.findVariable(this.token);
35                 if (variableBinding != null && variableBinding.isValidBinding() && variableBinding.isArgument) {
36                         this.binding = variableBinding;
37                         return;
38                 }
39                 if (warn) {
40                         try {
41                                 MethodScope methScope = (MethodScope) scope;
42                                 scope.problemReporter().javadocInvalidParamName(this, methScope.referenceMethod().modifiers);
43                         }
44                         catch (Exception e) {
45                                 scope.problemReporter().javadocInvalidParamName(this, -1);
46                         }
47                 }
48         }
49
50         /* (non-Javadoc)
51          * Redefine to capture javadoc specific signatures
52          * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
53          */
54         public void traverse(ASTVisitor visitor, BlockScope scope) {
55                 visitor.visit(this, scope);
56                 visitor.endVisit(this, scope);
57         }
58 }