public class MethodScope extends AbstractJavaScope
Constructor and Description |
---|
MethodScope(Node node) |
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(NameDeclaration variableDecl)
Adds a new declaration to this scope.
|
Set<NameDeclaration> |
addNameOccurrence(NameOccurrence occurrence)
Adds a
NameOccurrence to this scope - only call this after getting
a true back from Scope.contains(NameOccurrence) . |
Set<NameDeclaration> |
findVariableHere(JavaNameOccurrence occurrence) |
String |
getName() |
Map<VariableNameDeclaration,List<NameOccurrence>> |
getVariableDeclarations() |
String |
toString() |
checkForDuplicatedNameDeclaration, contains, glomNames
getDeclarations, getDeclarations, getEnclosingScope, getParent, setParent
public MethodScope(Node node)
public Map<VariableNameDeclaration,List<NameOccurrence>> getVariableDeclarations()
public Set<NameDeclaration> addNameOccurrence(NameOccurrence occurrence)
Scope
NameOccurrence
to this scope - only call this after getting
a true back from Scope.contains(NameOccurrence)
.addNameOccurrence
in interface Scope
addNameOccurrence
in class AbstractScope
NameDeclaration
s that are referenced by the given NameOccurrence
,
if the NameOccurrence
could be added. Otherwise an empty set is returned.public void addDeclaration(NameDeclaration variableDecl)
Scope
Scope.contains(NameOccurrence)
and Scope.addNameOccurrence(NameOccurrence)
can
be used correctly.addDeclaration
in interface Scope
addDeclaration
in class AbstractJavaScope
variableDecl
- the declaration to addpublic Set<NameDeclaration> findVariableHere(JavaNameOccurrence occurrence)
findVariableHere
in class AbstractJavaScope
public String getName()
Copyright © 2002–2016 InfoEther. All rights reserved.