Lines Matching refs:visitor
396 A node visitor base class that walks the abstract syntax tree and calls a
397 visitor function for every node found. This function may return a value
400 This class is meant to be subclassed, with the subclass adding visitor
403 Per default the visitor functions for the nodes are ``'visit_'`` +
406 the `visit` method. If no visitor function exists for a node
407 (return value `None`) the `generic_visit` visitor is used instead.
410 traversing. For this a special visitor exists (`NodeTransformer`) that
417 visitor = getattr(self, method, self.generic_visit)
418 return visitor(node)
421 """Called if no explicit visitor function exists for a node."""
441 visitor = getattr(self, method)
448 return visitor(node)
458 visitor methods to replace or remove the old node. If the return value of
459 the visitor method is ``None``, the node will be removed from its location,
480 statement nodes), the visitor may also return a list of nodes rather than