Pure-Python コードを解析して、元のコードのさまざまな部分を表す特定のクラスのインスタンスのリストのようなものにしたいと考えています。
例:
>>> text = '''
... for x in range(100):
... print x
... '''
>>> tree = parse(text)
>>> print tree
Tree( ForLoop(x,Range(100), [Stmt(Print(x))]) )
# here ForLoop, Range, Stmt, Print are all custom classes