[pypy-dev] Re: Notes on compiler package

Samuele Pedroni pedronis at bluewin.ch
Thu Jan 23 13:59:16 CET 2003


From: "Michael Hudson" <mwh at python.net>
> > 2) Internal CPython ASTs are transformed into "compiler"'s own ASTs.
> > These nodes are smarter than the internal ones; they attach appropriate
> > info to "attributes".  CPython AST nodes just have a list of children,
> > this module identifies and breaks out important data (for example, the
> > arguments in a function def become an "args" attribute instead of
> > guessing it's the first child)
>
> Yep.  This is compiler.transformer.  It has to be said, if you were
> writing a parser for Python in Python, I'd shoot for generating the
> output of the transformer module rather than aping what the parser
> module produces.
>

yes, btw there have been undergoing work to substitute parser module and what
is used internally by CPython with a (new) AST format:

[Compiler-sig] compiler-sig project for Python 2.3: new AST
http://mail.python.org/pipermail/compiler-sig/2002-March/000091.html

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/sandbox/as
t/

there should be also a CVS branch

Finn Bock has already incorparated this in Jython, OTOH I think work on CPython
has stalled. The idea is that future versions of (e.g) PyChecker ought to use
the (new) AST format.

Jeremy Hylton should be asked on the status of this.

regards.



More information about the Pypy-dev mailing list