public class SourceFileScope extends AbstractScope
| Modifier and Type | Field and Description |
|---|---|
protected Map<ClassNameDeclaration,List<NameOccurrence>> |
classNames |
| Constructor and Description |
|---|
SourceFileScope() |
SourceFileScope(String image) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(ClassNameDeclaration classDecl)
Add a class declaration to this scope
|
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()
|
protected NameDeclaration |
findVariableHere(NameOccurrence occ) |
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.
|
String |
getPackageName() |
Map<VariableNameDeclaration,List<NameOccurrence>> |
getVariableDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that
exist at this scope
|
String |
toString() |
contains, getParent, glomNames, setParentprotected Map<ClassNameDeclaration,List<NameOccurrence>> classNames
public SourceFileScope()
public SourceFileScope(String image)
public ClassScope getEnclosingClassScope()
ScopegetEnclosingClassScope in interface ScopegetEnclosingClassScope in class AbstractScopepublic MethodScope getEnclosingMethodScope()
ScopegetEnclosingMethodScope in interface ScopegetEnclosingMethodScope in class AbstractScopepublic String getPackageName()
public SourceFileScope getEnclosingSourceFileScope()
ScopegetEnclosingSourceFileScope in interface ScopegetEnclosingSourceFileScope in class AbstractScopepublic void addDeclaration(ClassNameDeclaration classDecl)
ScopeaddDeclaration in interface ScopeaddDeclaration in class AbstractScopepublic void addDeclaration(MethodNameDeclaration decl)
ScopeaddDeclaration in interface ScopeaddDeclaration in class AbstractScopepublic void addDeclaration(VariableNameDeclaration decl)
Scopepublic Map<ClassNameDeclaration,List<NameOccurrence>> getClassDeclarations()
ScopegetClassDeclarations in interface ScopegetClassDeclarations in class AbstractScopepublic Map<VariableNameDeclaration,List<NameOccurrence>> getVariableDeclarations()
Scopepublic NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
Scopeprotected NameDeclaration findVariableHere(NameOccurrence occ)
findVariableHere in class AbstractScopeCopyright © 2002-2013 InfoEther. All Rights Reserved.