class documentation
class ScopedVisitor(ast_visitor.BaseVisitor): (source)
Known subclasses: pytype.tools.xref.indexer.IndexVisitor
An AST node visitor that keeps track of scopes and environments. A "scope" is the abstract namespace (represented by a string key that tracks the nested path of namespaces from the module root, e.g. module:class A:f). An "environment" holds data for the current scope. self.envs is not hierarchical, it's just a flat mapping of scope keys to environments.
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | enter_ |
Undocumented |
Method | enter_ |
Undocumented |
Method | enter_ |
Undocumented |
Method | get |
Construct an id based on node type. |
Method | iprint |
Print messages indented by scope level, for debugging. |
Method | leave |
If the node has introduced a new scope, we need to pop it off. |
Method | leave_ |
Undocumented |
Method | scope |
Undocumented |
Instance Variable | class |
Undocumented |
Instance Variable | envs |
Undocumented |
Instance Variable | module |
Undocumented |
Instance Variable | stack |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Inherited from BaseVisitor
:
Method | enter |
Does a pre-order traversal of the AST. |
Method | generic |
Called when no visit function is found for a node type. |
Method | visit |
Does a post-order traversal of the AST. |
Method | _call |
Undocumented |
Method | _children |
Children to recurse over. |
Instance Variable | _ast |
Undocumented |
Instance Variable | _node |
Undocumented |
overrides
pytype.ast.visitor.BaseVisitor.__init__
overridden in
pytype.tools.xref.indexer.IndexVisitor
Undocumented
overrides
pytype.ast.visitor.BaseVisitor.leave
If the node has introduced a new scope, we need to pop it off.