class BaseVisitor: (source)
Known subclasses: pytype.pyi.conditions.ConditionEvaluator
, pytype.pyi.visitor.BaseVisitor
, pytype.tools.traces.traces.MatchAstVisitor
, pytype.tools.xref.indexer.ScopedVisitor
, pytype.ast.visitor_test._EnterVisitor
, pytype.ast.visitor_test._GenericVisitVisitor
, pytype.ast.visitor_test._VisitOrderVisitor
, pytype.ast.visitor_test._VisitReplaceVisitor
, pytype.directors.parser._ParseVisitor
, pytype.tools.traces.traces._LineNumberVisitor
A base class for writing AST visitors. Subclasses should define {visit,enter,leave}_X to process nodes of type X. If a visit method returns a non-None value, the visited node is replaced with that value. Attributes: _ast: Any module whose interface matches the standard ast library, such as typed_ast. The same module must be used to generate the AST to visit.
Method | __init__ |
Undocumented |
Method | enter |
Does a pre-order traversal of the AST. |
Method | generic |
Called when no visit function is found for a node type. |
Method | leave |
Called after visit() to do any cleanup that enter() needs. |
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 |
pytype.pyi.conditions.ConditionEvaluator
, pytype.pyi.visitor.BaseVisitor
, pytype.tools.traces.traces.MatchAstVisitor
, pytype.tools.xref.indexer.ScopedVisitor
, pytype.ast.visitor_test._EnterVisitor
, pytype.ast.visitor_test._GenericVisitVisitor
, pytype.ast.visitor_test._VisitOrderVisitor
, pytype.directors.parser._ParseVisitor
, pytype.tools.traces.traces._LineNumberVisitor
Undocumented
pytype.ast.visitor_test._GenericVisitVisitor
, pytype.directors.parser._ParseVisitor
, pytype.tools.traces.traces._LineNumberVisitor
, pytype.tools.traces.traces_test._TestVisitor
Called when no visit function is found for a node type.