Package docutils :: Module nodes :: Class GenericNodeVisitor
[frames | no frames]

Class GenericNodeVisitor

NodeVisitor --+
              |
             GenericNodeVisitor

Known Subclasses:
RestXmlDocument

Generic "Visitor" abstract superclass, for simple traversals.

Unless overridden, each visit_... method calls default_visit(), and each depart_... method (when using Node.walkabout()) calls default_departure(). default_visit() (and default_departure()) must be overridden in subclasses.

Define fully generic visitors by overriding default_visit() (and default_departure()) only. Define semi-generic visitors by overriding individual visit_...() (and depart_...()) methods also.

NodeVisitor.unknown_visit() (NodeVisitor.unknown_departure()) should be overridden for default behavior.


Method Summary
  default_departure(self, node)
Override for generic, uniform traversals.
  default_visit(self, node)
Override for generic, uniform traversals.
    Inherited from NodeVisitor
  __init__(self, document)
  dispatch_departure(self, node)
Call self."depart_ + node class name" with node as parameter.
  dispatch_visit(self, node)
Call self."visit_ + node class name" with node as parameter.
  unknown_departure(self, node)
Called before exiting unknown Node types.
  unknown_visit(self, node)
Called when entering unknown Node types.

Class Variable Summary
    Inherited from NodeVisitor
tuple optional = ()

Method Details

default_departure(self, node)

Override for generic, uniform traversals.

default_visit(self, node)

Override for generic, uniform traversals.


Generated by Epydoc 2.1 on Wed Jul 12 11:20:40 2006 http://epydoc.sf.net