public class MethodScope extends AbstractScope
| Modifier and Type | Field and Description |
|---|---|
protected Map<VariableNameDeclaration,List<NameOccurrence>> |
variableNames |
| Constructor and Description |
|---|
MethodScope(Node node) |
| Modifier and Type | Method and Description |
|---|---|
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()
|
NameDeclaration |
findVariableHere(NameOccurrence occurrence) |
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.
|
String |
getName() |
Map<VariableNameDeclaration,List<NameOccurrence>> |
getVariableDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that
exist at this scope
|
String |
toString() |
addDeclaration, addDeclaration, contains, getClassDeclarations, getEnclosingClassScope, getEnclosingSourceFileScope, getParent, glomNames, setParentprotected Map<VariableNameDeclaration,List<NameOccurrence>> variableNames
public MethodScope(Node node)
public MethodScope getEnclosingMethodScope()
ScopegetEnclosingMethodScope in interface ScopegetEnclosingMethodScope in class AbstractScopepublic Map<VariableNameDeclaration,List<NameOccurrence>> getVariableDeclarations()
Scopepublic NameDeclaration addVariableNameOccurrence(NameOccurrence occurrence)
Scopepublic void addDeclaration(VariableNameDeclaration variableDecl)
Scopepublic NameDeclaration findVariableHere(NameOccurrence occurrence)
findVariableHere in class AbstractScopepublic String getName()
Copyright © 2002-2013 InfoEther. All Rights Reserved.