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
Post a Comment