Classes
NodeVisitor | A base class for implementing node visitors. |
Bases: object
A base class for implementing node visitors.
Subclasses should implement visitor methods using the naming scheme ‘visit_<name>’ where <name> is the type name of a given node.
The main entry point of the visitor class.
This method should be called to execute the visitor. It will call the setup and teardown methods before and after invoking the visit method on the node.
Parameters : | node : object
|
---|---|
Returns : | result : object
|
Perform any necessary setup before running the visitor.
This method is invoked before the visitor is executed over a particular node. The default implementation does nothing.
Parameters : | node : object
|
---|
Get the results for the visitor.
This method is invoked after the visitor is executed over a particular node and the result() method has been called. The default implementation returns None.
Parameters : | node : object
|
---|---|
Returns : | result : object
|
Perform any necessary cleanup when the visitor is finished.
This method is invoked after the visitor is executed over a particular node and the result() method has been called. The default implementation does nothing.
Parameters : | node : object
|
---|
The main visitor dispatch method.
Parameters : | node : object
|
---|
The default node visitor method.
This method is invoked when no named visitor method is found for a given node. This default behavior raises an exception for the missing handler. Subclasses may reimplement this method for custom default behavior.
list of weak references to the object (if defined)