Package lepl :: Package support :: Module graph :: Class Visitor
[hide private]
[frames] | no frames]

Class Visitor

source code


The interface required by the walkers.

loop is value returned when a node is re-visited.

type_ is set with the node type before constructor() is called. This allows constructor() itself to be invoked with the Python arguments used to construct the original graph.

Instance Methods [hide private]
 
loop(self, value)
Called on nodes that belong to a loop (eg.
source code
 
node(self, node)
Called when first visiting a node.
source code
 
constructor(self, *args, **kargs)
Called for node instances.
source code
 
leaf(self, value)
Called for children that are not node instances.
source code
 
postprocess(self, result)
Called after walking, passed the match to the initial node.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

loop(self, value)

source code 

Called on nodes that belong to a loop (eg. in the ConstructorWalker nodes are visited in postorder, and this is called when a node is first found as a constructor argument (before bing found in the "postorder" traversal)).

By default, do nothing.

node(self, node)

source code 

Called when first visiting a node.

By default, do nothing.

constructor(self, *args, **kargs)

source code 

Called for node instances. The args and kargs are the values for the corresponding child nodes, as returned by this visitor.

By default, do nothing.

leaf(self, value)

source code 

Called for children that are not node instances.

By default, do nothing.