public class ClassScope extends AbstractScope
| Modifier and Type | Field and Description |
|---|---|
protected Map<ClassNameDeclaration,List<NameOccurrence>> |
classNames |
protected Map<MethodNameDeclaration,List<NameOccurrence>> |
methodNames |
protected Map<VariableNameDeclaration,List<NameOccurrence>> |
variableNames |
| Constructor and Description |
|---|
ClassScope()
This is only for anonymous inner classes
FIXME - should have name like Foo$1, not Anonymous$1
to get this working right, the parent scope needs
to be passed in when instantiating a ClassScope
|
ClassScope(String className) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(ClassNameDeclaration decl)
Add a class declaration to this scope
|
void |
addDeclaration(MethodNameDeclaration decl)
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()
|
protected NameDeclaration |
findVariableHere(NameOccurrence occurrence) |
Map<ClassNameDeclaration,List<NameOccurrence>> |
getClassDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that
exist at this scope
|
String |
getClassName() |
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.
|
Map<MethodNameDeclaration,List<NameOccurrence>> |
getMethodDeclarations() |
Map<VariableNameDeclaration,List<NameOccurrence>> |
getVariableDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that
exist at this scope
|
String |
toString() |
contains, getEnclosingMethodScope, getEnclosingSourceFileScope, getParent, glomNames, setParentprotected Map<ClassNameDeclaration,List<NameOccurrence>> classNames
protected Map<MethodNameDeclaration,List<NameOccurrence>> methodNames
protected Map<VariableNameDeclaration,List<NameOccurrence>> variableNames
public ClassScope(String className)
public ClassScope()
public void addDeclaration(VariableNameDeclaration variableDecl)
Scopepublic NameDeclaration addVariableNameOccurrence(NameOccurrence occurrence)
Scopepublic Map<VariableNameDeclaration,List<NameOccurrence>> getVariableDeclarations()
Scopepublic Map<MethodNameDeclaration,List<NameOccurrence>> getMethodDeclarations()
public Map<ClassNameDeclaration,List<NameOccurrence>> getClassDeclarations()
ScopegetClassDeclarations in interface ScopegetClassDeclarations in class AbstractScopepublic ClassScope getEnclosingClassScope()
ScopegetEnclosingClassScope in interface ScopegetEnclosingClassScope in class AbstractScopepublic String getClassName()
public void addDeclaration(MethodNameDeclaration decl)
ScopeaddDeclaration in interface ScopeaddDeclaration in class AbstractScopepublic void addDeclaration(ClassNameDeclaration decl)
ScopeaddDeclaration in interface ScopeaddDeclaration in class AbstractScopeprotected NameDeclaration findVariableHere(NameOccurrence occurrence)
findVariableHere in class AbstractScopeCopyright © 2002-2013 InfoEther. All Rights Reserved.