parsing - How to draw a parse tree when a small python file is parsed? -


my objective understand how abstract syntax tree works. able parse file using ast not able imagine how parse tree constructed.i explain scenario:

#a.py  class parse_tree :    def move():       print "hello"  #parse.py  import ast  open('a.py') f:    tree = ast.parse(f.read()) 

so "a.py" file parsed ast in "parse.py". want know how following example transformed tree. how tree constructed ?


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -