public interface Scope
| Modifier and Type | Method and Description |
|---|---|
void |
define(Symbol sym)
Define a symbol in this scope, throw IllegalArgumentException
if sym already defined in this scope.
|
List<? extends Symbol> |
getAllSymbols()
Return all symbols found in all nested scopes.
|
List<Scope> |
getEnclosingPathToRoot()
Return (inclusive) list of all scopes on path to root scope.
|
Scope |
getEnclosingScope()
Scope in which this scope defined.
|
String |
getName()
Often scopes have names like function or class names.
|
List<Scope> |
getNestedScopedSymbols()
Return all immediately enclosed scoped symbols in insertion order.
|
List<Scope> |
getNestedScopes()
Return a list of scopes nested within this scope.
|
int |
getNumberOfSymbols()
Number of symbols in this specific scope
|
Scope |
getParentScope()
Where to look next for symbols if just one parent; superclass or enclosing scope.
|
List<Scope> |
getParentScopes()
Multiple superclass or interface implementations and the like...
|
Symbol |
getSymbol(String name)
Get symbol if name defined within this specific scope
|
Set<String> |
getSymbolNames()
Return the set of names associated with all symbols in the scope.
|
List<? extends Symbol> |
getSymbols()
Return the symbols defined within this scope.
|
void |
nest(Scope scope)
Add a nested local scope to this scope; it's like define() but
for non SymbolWithScope objects.
|
Symbol |
resolve(String name)
Look up name in this scope or recursively in parent scope if not here
|
void |
setEnclosingScope(Scope s)
What scope encloses this scope.
|
String |
toQualifierString(String separator)
Return scopes from to current with separator in between
|
String getName()
Scope getParentScope()
List<Scope> getParentScopes()
Scope getEnclosingScope()
void setEnclosingScope(Scope s)
void define(Symbol sym) throws IllegalArgumentException
getSymbols() returns the list in definition order.IllegalArgumentExceptionSymbol resolve(String name)
void nest(Scope scope) throws IllegalArgumentException
IllegalArgumentException - if you pass in a SymbolWithScope.List<Scope> getNestedScopes()
getNestedScopedSymbols().
ScopedSymbols come first then all non-ScopedSymbols Scope objects.
Insertion order is used within each sublist.List<Scope> getEnclosingPathToRoot()
List<Scope> getNestedScopedSymbols()
getNestedScopes().List<? extends Symbol> getSymbols()
List<? extends Symbol> getAllSymbols()
Set<String> getSymbolNames()
int getNumberOfSymbols()
Copyright © 2016 ANTLR. All Rights Reserved.