using Python's AST generator for other languages

Benjamin musiccomposition at gmail.com
Fri Jul 11 08:28:56 EDT 2008


On Jul 11, 12:27 am, eliben <eli... at gmail.com> wrote:
> <snip>> > 2) What is the meaning of the comment in astgen.py ? Are the Python
> > > maintainers unhappy with the design of the AST ?3
>
> > Node, I think, is talking about a node in the parse tree. (AST is
> > generated from another parse tree.) See PEP 339 for details.
>
> <snip>
>
> Thanks, PEP 339 clarified a lot to me. I wonder, though, at the need
> for two Python compilation frameworks in the same code base. While
> CPython uses the flow described in PEP 339 (parsing to an AST
> generated from ASDL), the compiler module of the standard library
> takes a different approach, with a custom AST description syntax in
> ast.txt
> Why aren't the two methods unified. I.e. can't the compiler.ast module
> be also generated from ASDL, and provide a more unified interface to
> the real thing ?

You are correct on all points and this is one of the main reasons that
the compiler package is going away in 3.0.
>
> Eli




More information about the Python-list mailing list