This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients brett.cannon, eli.bendersky, ncoghlan
Date 2013-11-19.14:01:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384869696.09.0.547082157855.issue19655@psf.upfronthosting.co.za>
In-reply-to
Content
It was mentioned in one of the recent python-dev threads that making the Python code-base simpler to encourage involvement of contributors is a goal, so I figured this may be relevant.

I've recently written a new parser for the ASDL specification language from scratch and think it may be beneficial to replace the existing parser we use:

* The existing parser uses an external parser-generator (Spark) that we carry around in the Parser/ directory; the new parser is a very simple stand-alone recursive descent, which makes it easier to maintain and doesn't require a familiarity with Spark.
* The new code is significantly smaller. ~400 LOC for the whole stand-alone parser (asdl.py) as opposed to >1200 LOC for the existing parser+Spark.
* The existing asdl.py is old code and was only superficially ported to Python 3.x - this shows, and isn't a good example of using modern Python techniques. My asdl.py uses Python 3.4 with modern idioms like dict comprehensions, generators and enums.

For a start, it may be easier to review the parser separately and not as a patch file. I split it to a stand-alone project here: https://github.com/eliben/asdl_parser

The asdl.py there is a drop-in replacement for Parser/asdl.py; asdl_c.py is for Parser/asdl_c.py - with tiny modifications to interface the new parser (mainly getting rid of some Spark-induced quirks). The AST .c and .h files produced are identical. The repo also has some tests for the parser, which we may find useful in adding to the test suite or the Parser directory.
History
Date User Action Args
2013-11-19 14:01:36eli.benderskysetrecipients: + eli.bendersky, brett.cannon, ncoghlan
2013-11-19 14:01:36eli.benderskysetmessageid: <1384869696.09.0.547082157855.issue19655@psf.upfronthosting.co.za>
2013-11-19 14:01:36eli.benderskylinkissue19655 messages
2013-11-19 14:01:35eli.benderskycreate