SCons :: Node :: Walker :: Class Walker
[hide private]
[frames] | no frames]

Class Walker

source code

object --+
         |
        Walker

An iterator for walking a Node tree.

This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and returns the next node on the descent with each get_next() call. 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called when a cycle is detected.

This class does not get caught in node cycles caused, for example, by C header file include loops.

Instance Methods [hide private]
 
__init__(self, node, kids_func=<function get_children at 0x2d4fc80>, cycle_func=<function ignore_cycle at 0x2d4fcf8>, eval_func=<function do_nothing at 0x2d4fd70>)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
get_next(self)
Return the next node for this walk of the tree.
source code
 
is_done(self) source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, node, kids_func=<function get_children at 0x2d4fc80>, cycle_func=<function ignore_cycle at 0x2d4fcf8>, eval_func=<function do_nothing at 0x2d4fd70>)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

get_next(self)

source code 

Return the next node for this walk of the tree.

This function is intentionally iterative, not recursive, to sidestep any issues of stack size limitations.