| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private Set | |
| private boolean | |
| private int | |
| private static Set | looked
For preventing circular inheritance from recursing. |
| private Scope | |
| private String | |
| private Scope. | |
| private List | |
| private Map | table
XXX: This table is incorrectly overloaded to contain both object attributes and lexical-ish scope names, when they are in some cases separate namespaces. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addGlobalName(String name)
Mark a name as being global (i.e. module scoped) for name-binding and name-lookup operations in this code block and any nested scopes. |
| public void | |
| public void | |
| public Scope | |
| private void | |
| public Set | |
| public String | Returns: the qname forname. Does not change this scope's path.a name to append to the current qname name)Constructs a qualified name by appending |
| public String | |
| public Scope | getEnclosingLexicalScope()
Returns the containing lexical scope (which may be this scope) for lexical name lookups. |
| public Scope | |
| private NBinding | |
| public Scope | |
| public String | |
| public Scope | |
| public Scope. | |
| public List | |
| public Scope | |
| public Map | |
| private NBinding | |
| private NBinding | |
| public boolean | |
| public boolean | |
| public boolean | isGlobalName(String name)
Returns |
| public boolean | isNameBindingPhase()
Name binding occurs in a separate pass before the name resolution pass, building out the scope tree and binding names in the correct scopes. |
| private boolean | |
| public boolean | |
| public Set | |
| public NBinding | |
| public NBinding | |
| public NBinding | lookupAttr(String name, boolean
search only in the supers' scopes, not in local table. supersOnly)Look up an attribute in the type hierarchy. |
| public NBinding | |
| public NBinding | Returns: a binding, ornull if not foundthe name to be looked up name, Scope.the type we wish the search to be bounded at typeboundLook up a name, but the search is bounded by a type and will not proceed to an outer scope when reaching a certain type of symbol table. |
| public NBinding | Returns: the local binding forname, or null.Look up a name, but only in the current scope. |
| public NBinding | |
| public NType | lookupType(String name)
Look up the scope chain for a binding named |
| public NType | lookupType(String name, boolean
true to look only in the current scope;
if false, follows the scope chain.Look for a binding named |
| public NType | |
| public void | |
| public String | |
| public void | |
| public NBinding | |
| public NBinding | |
| private void | |
| public void | |
| private void | retargetReferences(NBinding b, NType curType)
If the current type had a provisional binding, retarget its refs to the new type. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | |
| public String | |
| public NBinding | |
| public NBinding | |
| private void | |
| public Collection |
| globalNames | back to summary |
|---|---|
| private Set<String> globalNames | |
| isBindingPhase | back to summary |
|---|---|
| private boolean isBindingPhase | |
| lambdaCounter | back to summary |
|---|---|
| private int lambdaCounter | |
| looked | back to summary |
|---|---|
| private static Set<Scope> looked For preventing circular inheritance from recursing. | |
| parent | back to summary |
|---|---|
| private Scope parent | |
| path | back to summary |
|---|---|
| private String path | |
| scopeType | back to summary |
|---|---|
| private Scope. | |
| supers | back to summary |
|---|---|
| private List<Scope> supers | |
| table | back to summary |
|---|---|
| private Map<String, NBinding> table XXX: This table is incorrectly overloaded to contain both object
attributes and lexical-ish scope names, when they are in some cases
separate namespaces. (In particular, they're effectively the same
namespace for module scope and class scope, and they're different for
function scope, which uses the | |
| Scope | back to summary |
|---|---|
| public Scope(Scope parent, Scope. | |
| addGlobalName | back to summary |
|---|---|
| public void addGlobalName(String name) Mark a name as being global (i.e. module scoped) for name-binding and name-lookup operations in this code block and any nested scopes. | |
| addSuper | back to summary |
|---|---|
| public void addSuper(Scope sup) | |
| clear | back to summary |
|---|---|
| public void clear() Dismantles all resources allocated by this scope. | |
| copy | back to summary |
|---|---|
| public Scope copy(Scope. Create a copy of the symbol table but without the links to parent, supers and children. Useful for creating instances.
| |
| ensureTable | back to summary |
|---|---|
| private void ensureTable() | |
| entrySet | back to summary |
|---|---|
| public Set | |
| extendPath | back to summary |
|---|---|
| public String extendPath(String name) Constructs a qualified name by appending The indexer uses globally unique fully qualified names to address identifier definition sites. Many Python identifiers are already globally addressable using dot-separated package, class and attribute names. Function variables and parameters are not globally addressable in the language, so the indexer uses a special path syntax for creating globally unique qualified names for them. By convention the syntax is "@" for parameters and "&" for local variables. | |
| extendPathForParam | back to summary |
|---|---|
| public String extendPathForParam(String name) Generates a qname for a parameter of a function or method.
There is not enough context for | |
| getEnclosingLexicalScope | back to summary |
|---|---|
| public Scope getEnclosingLexicalScope() Returns the containing lexical scope (which may be this scope) for lexical name lookups. In particular, it skips class scopes. | |
| getGlobalTable | back to summary |
|---|---|
| public Scope getGlobalTable() Returns the global scope (i.e. the module scope for the current module). | |
| getModuleBindingIfGlobal | back to summary |
|---|---|
| private NBinding getModuleBindingIfGlobal(String name) If | |
| getParent | back to summary |
|---|---|
| public Scope getParent() | |
| getPath | back to summary |
|---|---|
| public String getPath() | |
| getScopeSymtab | back to summary |
|---|---|
| public Scope getScopeSymtab() Find the enclosing scope-defining symbol table.
More precisely, if a form introduces a new name in the "current scope",
resolving the form needs to search up the symbol-table chain until it
finds the table representing the scope to which the name should be added.
Used by | |
| getScopeType | back to summary |
|---|---|
| public Scope. | |
| getSupers | back to summary |
|---|---|
| public List | |
| getSymtabOfType | back to summary |
|---|---|
| public Scope getSymtabOfType(Scope. Find a symbol table of a certain type in the enclosing scopes. | |
| getTable | back to summary |
|---|---|
| public Map Returns an immutable view of the table. | |
| insertBinding | back to summary |
|---|---|
| private NBinding insertBinding(NBinding b) | |
| insertOrUpdate | back to summary |
|---|---|
| private NBinding insertOrUpdate(NBinding b, String id, NNode loc, NType t, NBinding. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| isFunctionScope | back to summary |
|---|---|
| public boolean isFunctionScope() | |
| isGlobalName | back to summary |
|---|---|
| public boolean isGlobalName(String name) Returns | |
| isNameBindingPhase | back to summary |
|---|---|
| public boolean isNameBindingPhase() Name binding occurs in a separate pass before the name resolution pass, building out the scope tree and binding names in the correct scopes. In this pass, the name binding and lookup rules are slightly different. This condition is transient: no scopes will be in the name-binding phase in a completed index (or module). | |
| isNewType | back to summary |
|---|---|
| private boolean isNewType(NType curType, NType type) Returns | |
| isScope | back to summary |
|---|---|
| public boolean isScope() Returns | |
| keySet | back to summary |
|---|---|
| public Set | |
| lookup | back to summary |
|---|---|
| public NBinding lookup(String name) Look up a name (String) in the current symbol table. If not found, recurse on the parent table. | |
| lookup | back to summary |
|---|---|
| public NBinding lookup(NNode n) Specialized version for the convenience of looking up | |
| lookupAttr | back to summary |
|---|---|
| public NBinding lookupAttr(String name, boolean supersOnly) Look up an attribute in the type hierarchy. Don't look at parent link, because the enclosing scope may not be a super class. The search is "depth first, left to right" as in Python's (old) multiple inheritance rule. The new MRO can be implemented, but will probably not introduce much difference.
| |
| lookupAttr | back to summary |
|---|---|
| public NBinding lookupAttr(String name) Look up an attribute in the local scope and superclass scopes.
| |
| lookupBounded | back to summary |
|---|---|
| public NBinding lookupBounded(String name, Scope. Look up a name, but the search is bounded by a type and will not proceed to an outer scope when reaching a certain type of symbol table.
a binding, or | |
| lookupLocal | back to summary |
|---|---|
| public NBinding lookupLocal(String name) Look up a name, but only in the current scope.
| |
| lookupScope | back to summary |
|---|---|
| public NBinding lookupScope(String name) Look up a name, but bounded by a scope defining construct. Those scopes are of type module, class, instance or function. This is used in determining the locations of a variable's definition. | |
| lookupType | back to summary |
|---|---|
| public NType lookupType(String name) Look up the scope chain for a binding named | |
| lookupType | back to summary |
|---|---|
| public NType lookupType(String name, boolean localOnly) Look for a binding named
| |
| lookupTypeAttr | back to summary |
|---|---|
| public NType lookupTypeAttr(String name) | |
| merge | back to summary |
|---|---|
| public void merge(Scope other) Merge all records from another symbol table. Used by | |
| newLambdaName | back to summary |
|---|---|
| public String newLambdaName() | |
| put | back to summary |
|---|---|
| public void put(String id, NBinding b) Directly assigns a binding to a name in this table. Does not add a new
definition or reference to the binding. This form of | |
| put | back to summary |
|---|---|
| public NBinding put(String id, NNode loc, NType type, NBinding. Adds a definition and/or reference to the table.
If there is no binding for
If a binding already exists, then add either a definition or a reference
at
If the binding already exists, | |
| putAttr | back to summary |
|---|---|
| public NBinding putAttr(String id, NNode loc, NType type, NBinding. Same as
| |
| putBinding | back to summary |
|---|---|
| private void putBinding(String id, NBinding b) | |
| remove | back to summary |
|---|---|
| public void remove(String id) | |
| retargetReferences | back to summary |
|---|---|
| private void retargetReferences(NBinding b, NType curType) If the current type had a provisional binding, retarget its refs to the new type. It probably only works one level deep: need dataflow analysis in the general case. However, it does pick up some extra references, so it's reasonable for now. | |
| setNameBindingPhase | back to summary |
|---|---|
| public void setNameBindingPhase(boolean isBindingPhase) | |
| setParent | back to summary |
|---|---|
| public void setParent(Scope parent) | |
| setPath | back to summary |
|---|---|
| public void setPath(String path) | |
| setPath | back to summary |
|---|---|
| public void setPath(String a, String b) | |
| setScopeType | back to summary |
|---|---|
| public void setScopeType(Scope. | |
| setSupers | back to summary |
|---|---|
| public void setSupers(List<Scope> supers) | |
| setTable | back to summary |
|---|---|
| public void setTable(Map<String, NBinding> table) | |
| toShortString | back to summary |
|---|---|
| public String toShortString() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| update | back to summary |
|---|---|
| public NBinding update(String id, NNode loc, NType type, NBinding. Adds a new binding for | |
| update | back to summary |
|---|---|
| public NBinding update(String id, Def loc, NType type, NBinding. Adds a new binding for | |
| updateType | back to summary |
|---|---|
| private void updateType(NBinding b, NNode loc, NType type, NBinding. | |
| values | back to summary |
|---|---|
| public Collection | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Scope. | |
| public static Scope. |
| CLASS | back to summary |
|---|---|
| public static final Scope. | |
| FUNCTION | back to summary |
|---|---|
| public static final Scope. | |
| GLOBAL | back to summary |
|---|---|
| public static final Scope. | |
| INSTANCE | back to summary |
|---|---|
| public static final Scope. | |
| MODULE | back to summary |
|---|---|
| public static final Scope. | |
| SCOPE | back to summary |
|---|---|
| public static final Scope. | |
| Type | back to summary |
|---|---|
| private Type() | |
| valueOf | back to summary |
|---|---|
| public static Scope. | |
| values | back to summary |
|---|---|
| public static Scope. | |