public abstract class AbstractJavaScope extends AbstractScope
Constructor and Description |
---|
AbstractJavaScope() |
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(NameDeclaration declaration)
Adds a new declaration to this scope.
|
protected void |
checkForDuplicatedNameDeclaration(NameDeclaration declaration) |
boolean |
contains(NameOccurrence occurrence)
Tests whether or not a
NameOccurrence is directly contained in the scope. |
protected abstract Set<NameDeclaration> |
findVariableHere(JavaNameOccurrence occurrence) |
protected <T> String |
glomNames(Set<T> s) |
addNameOccurrence, getDeclarations, getDeclarations, getEnclosingScope, getParent, setParent
public void addDeclaration(NameDeclaration declaration)
Scope
Scope.contains(NameOccurrence)
and Scope.addNameOccurrence(NameOccurrence)
can
be used correctly.addDeclaration
in interface Scope
addDeclaration
in class AbstractScope
declaration
- the declaration to addprotected void checkForDuplicatedNameDeclaration(NameDeclaration declaration)
public boolean contains(NameOccurrence occurrence)
Scope
NameOccurrence
is directly contained in the scope.
This means, whether the given NameOccurrence
references a declaration, that has been
declared within this scope.
Note that this search is just for this scope - it doesn't go diving into any
parent scopes.contains
in interface Scope
contains
in class AbstractScope
protected abstract Set<NameDeclaration> findVariableHere(JavaNameOccurrence occurrence)
Copyright © 2002–2016 InfoEther. All rights reserved.