[Compiler-sig] progress on new AST

Finn Bock bckfnn@worldonline.dk
Wed, 10 Apr 2002 17:05:25 GMT


[Jeremy Hylton]

>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.

Thanks.

>There is a python.asdl that defines an AST that is reasonably
>complete, although it has rough edges (slices, etc.). 

Keep in mind that I'm a newbie at reading asdl, but how is it expressed
that a 'Module' contain a list of 'stmts', while a FunctionDef only
contain one 'name'?

>I've also
>written a simple C code generator that turns the ast definition into C
>code that defines structs and constructor functions.

I'm playing around with generating java code and all the needed
information seems to be available, but I can't quite make sense of the
basic idea behind the datastructures we are generating from. What is a
Sum and what is a Product in this sense?

regards,
finn