|
![]() |
Forking With PermissionI started playing with python recently and decided to contact the author of a nice little parser generator I used once back in 2003 called Yapps2 that really saved my ass once. Yapps2 is nice because it’s small and hackable. My motivation for forking it is to turn Yapps2 into a decent parser generator for processing protocols consistently, either binary, textual, or combined. Included in the source distribution is an example of this with the examples/stackish.g file that implements the Utu Stackish format. After contacting the original author Amit Patel he recommended that I fork the project, and even gave me a decent name: Zapps. Zed’s Additional Python Parsing System. I like it so I’m going with it. Version 0.2Going with the latest Idiopidae release I’m also putting out a new Zapps that Idiopidae needs. This release adds a fairly important grammar production that wasn’t in the original Yapps: optionals. This means you can take any part of a grammar and put a ’?’ (question mark) and it will be optionally followed in the parser if the first element is in the token stream. This is fairly primitive but implements the extent of an RDP parser’s capability in this area (more of an LL(1) than RDP). I used this in Idiopidae to implement optional formatting and langauge specifications for the export and include statements:
It should also work for productions that are just parenthetical, but I’ve only used it with named productions. Install with the usual mechanism of sudo python setup.py install and you can also get at the latest source with Bazaar by doing:
If you have patches feel free to email them to me until I move to a Launchpad account or something similar. Version 0.1This release is nothing more than a simple code reorganization to fit into the python distutils way of doing things. The original yapps2 was done as just some source files, so I wanted to modernize it for easier contribution and use by Python folks. You can grab that release here Note that the Python Pack production is there, but not implemented yet, that’ll be done most likely during PyCon so watch out. |