|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.pmd.symboltable.AbstractScope
Provides behavior common to all Scopes
| Field Summary | |
protected java.util.Map |
methodNames
|
protected java.util.Map |
variableNames
|
| Constructor Summary | |
AbstractScope()
|
|
| Method Summary | |
void |
addDeclaration(MethodNameDeclaration methodDecl)
Add a method declaration to this scope |
void |
addDeclaration(VariableNameDeclaration variableDecl)
Add a variable declaration to this scope |
NameDeclaration |
addVariableNameOccurrence(NameOccurrence occurrence)
Adds a NameOccurrence to this scope - only call this after getting a true back from contains() |
boolean |
contains(NameOccurrence occurrence)
Tests whether or not a NameOccurrence is directly contained in the scope Note that if this search is just in this scope - it doesn't go diving into any contained scopes. |
protected abstract NameDeclaration |
findVariableHere(NameOccurrence occurrence)
|
ClassScope |
getEnclosingClassScope()
Goes searching up the tree for this scope's enclosing ClassScope This is handy if you're buried down in a LocalScope and need to hop up to the ClassScope to find a method name. |
Scope |
getParent()
Retrieves this scope's parent |
java.util.Map |
getVariableDeclarations(boolean lookingForUsed)
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist and are either used or not used at this scope |
protected java.lang.String |
glomNames()
|
void |
setParent(Scope parent)
Points this scope to its parent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map variableNames
protected java.util.Map methodNames
| Constructor Detail |
public AbstractScope()
| Method Detail |
public ClassScope getEnclosingClassScope()
Scope
getEnclosingClassScope in interface Scopepublic void setParent(Scope parent)
Scope
setParent in interface Scopepublic Scope getParent()
Scope
getParent in interface Scopepublic void addDeclaration(VariableNameDeclaration variableDecl)
Scope
addDeclaration in interface Scopepublic void addDeclaration(MethodNameDeclaration methodDecl)
Scope
addDeclaration in interface Scopepublic boolean contains(NameOccurrence occurrence)
Scope
contains in interface Scopepublic java.util.Map getVariableDeclarations(boolean lookingForUsed)
Scope
getVariableDeclarations in interface Scopepublic NameDeclaration addVariableNameOccurrence(NameOccurrence occurrence)
Scope
addVariableNameOccurrence in interface Scopeprotected abstract NameDeclaration findVariableHere(NameOccurrence occurrence)
protected java.lang.String glomNames()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||