1 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[] source, long pos, int tagStart, int tagEnd) { 21 super(source, pos); 22 this.tagSourceStart = tagStart; 23 this.tagSourceEnd = tagEnd; 24 this.bits |= InsideJavadoc; 25 } 26 27 public void resolve(BlockScope scope) { 28 resolve(scope, true, scope.compilerOptions().reportUnusedParameterIncludeDocCommentReference); 29 } 30 31 34 public void resolve(BlockScope scope, boolean warn, boolean considerParamRefAsUsage) { 35 36 LocalVariableBinding variableBinding = scope.findVariable(this.token); 37 if (variableBinding != null && variableBinding.isValidBinding() && ((variableBinding.tagBits & TagBits.IsArgument) != 0)) { 38 this.binding = variableBinding; 39 if (considerParamRefAsUsage) { 40 variableBinding.useFlag = LocalVariableBinding.USED; 41 } 42 return; 43 } 44 if (warn) { 45 try { 46 MethodScope methScope = (MethodScope) scope; 47 scope.problemReporter().javadocUndeclaredParamTagName(this.token, this.sourceStart, this.sourceEnd, methScope.referenceMethod().modifiers); 48 } 49 catch (Exception e) { 50 scope.problemReporter().javadocUndeclaredParamTagName(this.token, this.sourceStart, this.sourceEnd, -1); 51 } 52 } 53 } 54 55 59 public void traverse(ASTVisitor visitor, BlockScope scope) { 60 visitor.visit(this, scope); 61 visitor.endVisit(this, scope); 62 } 63 67 public void traverse(ASTVisitor visitor, ClassScope scope) { 68 visitor.visit(this, scope); 69 visitor.endVisit(this, scope); 70 } 71 } 72 | Popular Tags |