On 10/21/05, Neil Schemenauer <nas at arctrix.com> wrote: > Also, the concrete syntax tree (CST) generated by Python's parser is > not a convenient data structure to deal with. Anyone who's used the > 'parser' module probably experienced the pain: > > >>> parser.ast2list(parser.suite('a = 1')) > [257, [266, [267, [268, [269, [320, [298, [299, [300, [301, > [303, [304, [305, [306, [307, [308, [309, [310, [311, [1, > 'a']]]]]]]]]]]]]]], [22, '='], [320, [298, [299, [300, [301, [303, > [304, [305, [306, [307, [308, [309, [310, [311, [2, > '1']]]]]]]]]]]]]]]]], [4, '']]], [0, '']] That's the fault of the 'parser' extension module though, and this affects tools using the parser module, not the bytecode compiler itself. The CST exposed to C programmers is slightly higher level. (But the new AST is higher level still, of course.) BTW, Elemental is letting me open-source a reimplementation of pgen in Python. This also includes a nifty way to generate ASTs. This should become available within a few weeks. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4