org.acm.seguin.pmd.symboltable
Interface Scope

All Superinterfaces:
net.sourceforge.jrefactory.ast.Scope

public interface Scope
extends net.sourceforge.jrefactory.ast.Scope

Provides methods which all scopes must implement See JLS 6.3 for a description of scopes


Method Summary
 void addDeclaration(MethodNameDeclaration decl)
          Add a method declaration to this scope
 void addDeclaration(VariableNameDeclaration decl)
          Add a variable declaration to this scope
 NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
          Adds a NameOccurrence to this scope - only call this after getting a true back from contains()
 boolean contains(NameOccurrence occ)
          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.
 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.
 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
 
Methods inherited from interface net.sourceforge.jrefactory.ast.Scope
getParent, setParent
 

Method Detail

getVariableDeclarations

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


addDeclaration

void addDeclaration(VariableNameDeclaration decl)
Add a variable declaration to this scope


addDeclaration

void addDeclaration(MethodNameDeclaration decl)
Add a method declaration to this scope


contains

boolean contains(NameOccurrence occ)
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.


addVariableNameOccurrence

NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
Adds a NameOccurrence to this scope - only call this after getting a true back from contains()


getEnclosingClassScope

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.