01: package org.acm.seguin.pmd.symboltable;
02:
03: import net.sourceforge.jrefactory.ast.ASTVariableDeclaratorId;
04: import net.sourceforge.jrefactory.ast.AccessNode;
05:
06: public class VariableNameDeclaration extends AbstractNameDeclaration
07: implements NameDeclaration {
08:
09: public VariableNameDeclaration(ASTVariableDeclaratorId node) {
10: super (node);
11: }
12:
13: public Scope getScope() {
14: return ((Scope) node.getScope()).getEnclosingClassScope();
15: }
16:
17: public boolean isExceptionBlockParameter() {
18: return ((ASTVariableDeclaratorId) node)
19: .isExceptionBlockParameter();
20: }
21:
22: public AccessNode getAccessNodeParent() {
23: return (AccessNode) node.jjtGetParent().jjtGetParent();
24: }
25:
26: public boolean equals(Object o) {
27: VariableNameDeclaration n = (VariableNameDeclaration) o;
28: return n.node.getImage().equals(node.getImage());
29: }
30:
31: public int hashCode() {
32: return node.getImage().hashCode();
33: }
34:
35: public String toString() {
36: return "Variable symbol " + node.getImage() + " line "
37: + node.getBeginLine();
38: }
39: }
|