Mix-in supporting walks of Particle trees.
This invokes a provided function on each node in a tree defining the
content model of a particle, both on the way down the tree and on the way
back up. A standard implementation would be:
def _walkParticleTree (self, visit, arg):
visit(self, True, arg)
self.__term.walkParticleTree(visit, arg)
visit(self, False, arg)
- Parameters:
visit - A callable with parameters node, entering, arg where
node is an instance of a class inheriting _ParticleTree_mixin,
entering indicates tree transition status, and
arg is a caller-provided state parameter.
entering is True if node
has particle children and the call is before they are visited;
None if the node has no particle
children; and False if node has
particle children and they have been visited.
arg - The caller-provided state parameter to be passed along with the
node and entry/exit status in the invocation of
visit .
|