final class PreprocessorSymbolTable extends java.lang.Object implements StaticTypedScope<JSType>, StaticSymbolTable<SimpleSlot,PreprocessorSymbolTable.Reference>
ProcessClosurePrimitives).| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
PreprocessorSymbolTable.Reference |
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.collect.Multimap<java.lang.String,PreprocessorSymbolTable.Reference> |
refs |
private Node |
root |
private java.util.Map<java.lang.String,SimpleSlot> |
symbols
All preprocessor symbols are globals.
|
| Constructor and Description |
|---|
PreprocessorSymbolTable(Node root) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addReference(Node node) |
java.lang.Iterable<SimpleSlot> |
getAllSymbols()
Returns all variables in this symbol table.
|
SimpleSlot |
getOwnSlot(java.lang.String name)
Like
getSlot but does not recurse into parent scopes. |
StaticTypedScope<JSType> |
getParentScope()
Returns the scope enclosing this one or null if none.
|
java.lang.Iterable<PreprocessorSymbolTable.Reference> |
getReferences(SimpleSlot symbol)
Returns the references that point to the given symbol.
|
Node |
getRootNode()
Returns the root node associated with this scope.
|
StaticTypedScope<JSType> |
getScope(SimpleSlot slot)
Returns the scope for a given symbol.
|
SimpleSlot |
getSlot(java.lang.String name)
Returns any defined slot within this scope for this name.
|
JSType |
getTypeOfThis()
Returns the expected type of
this in the current scope. |
private final java.util.Map<java.lang.String,SimpleSlot> symbols
private final com.google.common.collect.Multimap<java.lang.String,PreprocessorSymbolTable.Reference> refs
private final Node root
PreprocessorSymbolTable(Node root)
public Node getRootNode()
StaticScopegetRootNode in interface StaticScopepublic JSType getTypeOfThis()
StaticTypedScopethis in the current scope.getTypeOfThis in interface StaticTypedScope<JSType>public StaticTypedScope<JSType> getParentScope()
StaticTypedScopegetParentScope in interface StaticTypedScope<JSType>getParentScope in interface StaticScopepublic SimpleSlot getSlot(java.lang.String name)
StaticTypedScopegetSlot in interface StaticTypedScope<JSType>getSlot in interface StaticScopename - The name of the variable slot to look up.null if no
definition exists.public SimpleSlot getOwnSlot(java.lang.String name)
StaticTypedScopegetSlot but does not recurse into parent scopes.getOwnSlot in interface StaticTypedScope<JSType>getOwnSlot in interface StaticScopepublic java.lang.Iterable<PreprocessorSymbolTable.Reference> getReferences(SimpleSlot symbol)
StaticSymbolTablegetReferences in interface StaticSymbolTable<SimpleSlot,PreprocessorSymbolTable.Reference>public java.lang.Iterable<SimpleSlot> getAllSymbols()
StaticSymbolTablegetAllSymbols in interface StaticSymbolTable<SimpleSlot,PreprocessorSymbolTable.Reference>public StaticTypedScope<JSType> getScope(SimpleSlot slot)
StaticSymbolTablegetScope in interface StaticSymbolTable<SimpleSlot,PreprocessorSymbolTable.Reference>void addReference(Node node)