[Compiler-sig] progress on new AST

Jeremy Hylton jeremy@alum.mit.edu
Wed, 10 Apr 2002 00:04:08 -0400 (EDT)


I've been working on a new AST defined in ASDL (the Zephyr abstract
syntax definition language).  I've checked in the current work in
python/nondist/sandbox/ast. 

There is a python.asdl that defines an AST that is reasonably
complete, although it has rough edges (slices, etc.).  I've also
written a simple C code generator that turns the ast definition into C
code that defines structs and constructor functions.

I think the next step is to work on a transformer that translates that
concrete syntax into the AST.  I'd also like to write a code to
generate ASDL pickles, but that's a lower priority.

Note that while there is a next step, I don't think any of the earlier
steps is done.  I expect the AST will change several times before
we're done.  

I expect the C representation will also change.  I belive, for
example, that Guido prefers something more like the current
representation which uses a variable length array of child pointers.
And the NCH(), CHILD(), and REQ() macros.  I've been trying to avoid
this style, because it leaves the author stuck with a bunch of small
integers in place of names.

Anyone interested in pitching in?  I'd be happy to have feedback or
help.

Jeremy