Lines Matching full:visitor
219 A node visitor base class that walks the abstract syntax tree and calls a
220 visitor function for every node found. This function may return a value
223 This class is meant to be subclassed, with the subclass adding visitor
226 Per default the visitor functions for the nodes are ``'visit_'`` +
229 the `visit` method. If no visitor function exists for a node
230 (return value `None`) the `generic_visit` visitor is used instead.
233 traversing. For this a special visitor exists (`NodeTransformer`) that
240 visitor = getattr(self, method, self.generic_visit)
241 return visitor(node)
244 """Called if no explicit visitor function exists for a node."""
260 visitor methods to replace or remove the old node. If the return value of
261 the visitor method is ``None``, the node will be removed from its location,
282 statement nodes), the visitor may also return a list of nodes rather than