Current Path : /compat/linux/proc/68247/root/usr/local/lib/python2.5/compiler/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/68247/root/usr/local/lib/python2.5/compiler/visitor.pyo |
³ò h”Rc @ s[ d d k l Z d d d „ ƒ YZ d e f d „ ƒ YZ e Z d d d „ Z d „ Z d S( iÿÿÿÿ( t astt ASTVisitorc B s8 e Z d Z d Z d „ Z d „ Z d „ Z d „ Z RS( s Performs a depth-first walk of the AST The ASTVisitor will walk the AST, performing either a preorder or postorder traversal depending on which method is called. methods: preorder(tree, visitor) postorder(tree, visitor) tree: an instance of ast.Node visitor: an instance with visitXXX methods The ASTVisitor is responsible for walking over the tree in the correct order. For each node, it checks the visitor argument for a method named 'visitNodeType' where NodeType is the name of the node's class, e.g. Class. If the method exists, it is called with the node as its sole argument. The visitor method for a particular node type can control how child nodes are visited during a preorder walk. (It can't control the order during a postorder walk, because it is called _after_ the walk has occurred.) The ASTVisitor modifies the visitor argument by adding a visit method to the visitor; this method can be used to visit a child node of arbitrary type. i c C s d | _ h | _ d S( N( t Nonet nodet _cache( t self( ( s, /usr/local/lib/python2.5/compiler/visitor.pyt __init__"