public abstract class AbstractScope extends Object implements Scope
| Constructor and Description |
|---|
AbstractScope() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(ClassNameDeclaration classDecl)
Add a class declaration to this scope
|
void |
addDeclaration(MethodNameDeclaration methodDecl)
Add a method declaration to this scope
|
boolean |
contains(NameOccurrence occurrence)
Tests whether or not a NameOccurrence is directly contained in the scope
Note that this search is just for this scope - it doesn't go diving into any
child scopes.
|
protected abstract NameDeclaration |
findVariableHere(NameOccurrence occurrence) |
Map<ClassNameDeclaration,List<NameOccurrence>> |
getClassDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that
exist at this scope
|
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.
|
MethodScope |
getEnclosingMethodScope()
Goes searching up the tree for this scope's enclosing MethodScope
This is handy if you're buried down in a LocalScope and need to
hop up to the MethodScope to find a method parameter.
|
SourceFileScope |
getEnclosingSourceFileScope()
Goes searching up the tree for this scope's enclosing SourceFileScope
This is handy if you're buried down in a LocalScope and need to
hop up to the SourceFileScope to find a class name.
|
Scope |
getParent()
Retrieves this scope's parent
|
protected <T> String |
glomNames(Set<T> s) |
void |
setParent(Scope parent)
Points this scope to its parent
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDeclaration, addVariableNameOccurrence, getVariableDeclarationspublic Map<ClassNameDeclaration,List<NameOccurrence>> getClassDeclarations()
ScopegetClassDeclarations in interface Scopepublic MethodScope getEnclosingMethodScope()
ScopegetEnclosingMethodScope in interface Scopepublic ClassScope getEnclosingClassScope()
ScopegetEnclosingClassScope in interface Scopepublic SourceFileScope getEnclosingSourceFileScope()
ScopegetEnclosingSourceFileScope in interface Scopepublic void setParent(Scope parent)
Scopepublic Scope getParent()
Scopepublic void addDeclaration(MethodNameDeclaration methodDecl)
ScopeaddDeclaration in interface Scopepublic void addDeclaration(ClassNameDeclaration classDecl)
ScopeaddDeclaration in interface Scopepublic boolean contains(NameOccurrence occurrence)
Scopeprotected abstract NameDeclaration findVariableHere(NameOccurrence occurrence)
Copyright © 2002-2013 InfoEther. All Rights Reserved.