Home | History | Annotate | Download | only in compiler

Lines Matching refs:node

15         tree: an instance of ast.Node
19 correct order. For each node, it checks the visitor argument for
21 node's class, e.g. Class. If the method exists, it is called
22 with the node as its sole argument.
24 The visitor method for a particular node type can control how
29 be used to visit a child node of arbitrary type.
35 self.node = None
38 def default(self, node, *args):
39 for child in node.getChildNodes():
42 def dispatch(self, node, *args):
43 self.node = node
44 klass = node.__class__
57 return meth(node, *args)
74 def dispatch(self, node, *args):
75 self.node = node
76 meth = self._cache.get(node.__class__, None)
77 className = node.__class__.__name__
80 self._cache[node.__class__] = meth
84 meth(node, *args)
86 klass = node.__class__
92 for attr in dir(node):
94 print "\t", "%-12.12s" % attr, getattr(node, attr)
96 return self.default(node, *args)
109 def dumpNode(node):
110 print node.__class__
111 for attr in dir(node):
113 print "\t", "%-10.10s" % attr, getattr(node, attr)