[Python-Dev] ast-objects branch created (original) (raw)
Jeremy Hylton jeremy at alum.mit.edu
Thu Dec 1 14:11:37 CET 2005
- Previous message: [Python-Dev] ast-objects branch created
- Next message: [Python-Dev] ast-objects branch created
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Martin,
I'm not sure what your intent for this work is, but I'd like to create a parallel arena branch and compare the results. I'll start work on that tomorrow.
Jeremy
On 11/30/05, "Martin v. Löwis" <martin at v.loewis.de> wrote:
I created
http://svn.python.org/projects/python/branches/ast-objects/ You can convert your repository to that branch with svn switch svn+ssh://pythondev@svn.python.org/python/branches/ast-objects in the toplevel directory. In particular, this features http://svn.python.org/projects/python/branches/ast-objects/Parser/asdlc.py http://svn.python.org/projects/python/branches/ast-objects/Include/Python-ast.h http://svn.python.org/projects/python/branches/ast-objects/Python/Python-ast.c The status is currently this: - asdlc generates a type hierarchy: "Sum" productions have one type per constructor, inheriting from a type for the sum; plain products only have a type for the product. - attributes are in the base type, accessible through o->base.attr; projections of the product types are accessible directly through member names. - all projections must be non-NULL. Sequences are represented through potentially empty lists; optional types are potentially represented through PyNone. bool is gone; use PyTrue/PyFalse. The only primitive type remaining is int (which only occurs in lineno) - the types currently have only a constructor, a dealloc function, and an Check macro. - Naming is this: for cross-object-file visible symbols (functions and global variables), a Py prefix is used. Otherwise, I use the type name or constructor name directly. There is a #define for the PyNew function, so you can also write (params). Parameter order for the types is: projections first, then attributes. - For compatibility with the current code, the Sum base types also have the kind enumeration (although that appears not to get initialized right now). For asdlc, I see the following things as TODOs: - add support for traversing the types from C, through tpmembers (read-only). Optionally add support for pickling. - add support for garbage collection. I don't expect this to be necessary right now, but will be if the API is exposed, and it doesn't cost much. The bigger chunk of necessary changes is in using these, starting with ast.c. Feel free to commit any changes to that branch that you consider helpful. To avoid duplicated work, posting a note here might also help. Regards, Martin
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/jeremy%40alum.mit.edu
- Previous message: [Python-Dev] ast-objects branch created
- Next message: [Python-Dev] ast-objects branch created
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]