org.acm.seguin.pmd.symboltable
Class GlobalScope

java.lang.Object
  extended by org.acm.seguin.pmd.symboltable.AbstractScope
      extended by org.acm.seguin.pmd.symboltable.GlobalScope
All Implemented Interfaces:
net.sourceforge.jrefactory.ast.Scope

public class GlobalScope
extends AbstractScope
implements Scope


Field Summary
 
Fields inherited from class org.acm.seguin.pmd.symboltable.AbstractScope
methodNames, variableNames
 
Constructor Summary
GlobalScope()
           
 
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.
protected  NameDeclaration findVariableHere(NameOccurrence occ)
           
 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 getUnusedVariableDeclarations()
           
 java.lang.String toString()
           
 
Methods inherited from class org.acm.seguin.pmd.symboltable.AbstractScope
getParent, getVariableDeclarations, glomNames, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.acm.seguin.pmd.symboltable.Scope
getVariableDeclarations
 
Methods inherited from interface net.sourceforge.jrefactory.ast.Scope
getParent, setParent
 

Constructor Detail

GlobalScope

public GlobalScope()
Method Detail

getEnclosingClassScope

public ClassScope getEnclosingClassScope()
Description copied from interface: Scope
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.

Overrides:
getEnclosingClassScope in class AbstractScope

addDeclaration

public void addDeclaration(MethodNameDeclaration decl)
Description copied from interface: Scope
Add a method declaration to this scope

Overrides:
addDeclaration in class AbstractScope

getUnusedVariableDeclarations

public java.util.Map getUnusedVariableDeclarations()

addDeclaration

public void addDeclaration(VariableNameDeclaration decl)
Description copied from interface: Scope
Add a variable declaration to this scope

Overrides:
addDeclaration in class AbstractScope

contains

public boolean contains(NameOccurrence occ)
Description copied from interface: Scope
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.

Overrides:
contains in class AbstractScope

addVariableNameOccurrence

public NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
Description copied from interface: Scope
Adds a NameOccurrence to this scope - only call this after getting a true back from contains()

Overrides:
addVariableNameOccurrence in class AbstractScope

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

findVariableHere

protected NameDeclaration findVariableHere(NameOccurrence occ)
Specified by:
findVariableHere in class AbstractScope