3 """Print names of all methods defined in module
5 This script demonstrates use of the visitor interface of the compiler
12 """Print the names of all the methods
14 Each visit method takes two arguments, the node and its current
15 scope. The scope is the name of the current class or None.
18 def visitClass(self
, node
, scope
=None):
19 self
.visit(node
.code
, node
.name
)
21 def visitFunction(self
, node
, scope
=None):
23 print "%s.%s" % (scope
, node
.name
)
24 self
.visit(node
.code
, None)
32 ast
= compiler
.parse(buf
)
33 compiler
.walk(ast
, mf
)
35 if __name__
== "__main__":