Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
docutils.nodes.NodeVisitor Class Reference
Inheritance diagram for docutils.nodes.NodeVisitor:
Inheritance graph
[legend]

Public Member Functions

 __init__ (self, document)
 
 dispatch_visit (self, node)
 
 dispatch_departure (self, node)
 
 unknown_visit (self, node)
 
 unknown_departure (self, node)
 

Public Attributes

 document
 
 optional
 

Static Public Attributes

tuple optional = ('meta',)
 

Detailed Description

A list of names of all concrete Node subclasses.
"Visitor" pattern [GoF95]_ abstract superclass implementation for
document tree traversals.

Each node class has corresponding methods, doing nothing by
default; override individual methods for specific and useful
behaviour.  The `dispatch_visit()` method is called by
`Node.walk()` upon entering a node.  `Node.walkabout()` also calls
the `dispatch_departure()` method before exiting a node.

The dispatch methods call "``visit_`` + node class name" or
"``depart_`` + node class name", resp.

This is a base class for visitors whose ``visit_...`` & ``depart_...``
methods must be implemented for *all* compulsory node types encountered
(such as for `docutils.writers.Writer` subclasses).
Unimplemented methods will raise exceptions (except for optional nodes).

For sparse traversals, where only certain node types are of interest, use
subclass `SparseNodeVisitor` instead.  When (mostly or entirely) uniform
processing is desired, subclass `GenericNodeVisitor`.

.. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of
   Reusable Object-Oriented Software*. Addison-Wesley, Reading, MA, USA,
   1995.

Member Function Documentation

◆ dispatch_departure()

docutils.nodes.NodeVisitor.dispatch_departure (   self,
  node 
)
Call self."``depart_`` + node class name" with `node` as
parameter.  If the ``depart_...`` method does not exist, call
self.unknown_departure.

◆ dispatch_visit()

docutils.nodes.NodeVisitor.dispatch_visit (   self,
  node 
)
Call self."``visit_`` + node class name" with `node` as
parameter.  If the ``visit_...`` method does not exist, call
self.unknown_visit.

Reimplemented in docutils.writers.odf_odt.ODFTranslator.

◆ unknown_departure()

docutils.nodes.NodeVisitor.unknown_departure (   self,
  node 
)
Called before exiting unknown `Node` types.

Raise exception unless overridden.

◆ unknown_visit()

docutils.nodes.NodeVisitor.unknown_visit (   self,
  node 
)
Called when entering unknown `Node` types.

Raise an exception unless overridden.

Reimplemented in docutils.transforms.peps.PEPZeroSpecial, and docutils.transforms.references.DanglingReferencesVisitor.


The documentation for this class was generated from the following file: