Contact

Email (PGP key), Homepage

Address: IBISC, 1st floor, room 16,
University of Évry
Tour Évry 2
523 place des terrasses de l'Agora
91000 Évry, France

Tel: (+33)160873718
Fax: (+33)160873789


Search

Rss Posts

Rss Comments

Login

 

SNAKES 0.9.14 released

Monday, April 18, 2011

This new version features a complete rewrite of the ABCD compiler. The main visible changes are:

  • internal error on syntax errors should be gone!  :-) 
  • a few new keywords (task, enum, typedef, const, symbol)
  • enumerated types formerly declared as in(value, ...) should be rewritten as enum(value, ...)
  • new types can be declared using typedef name = type and reused in a buffer declaration
  • comprehensions can be used in a buffer fill access, as in buff<<(x for x in ...)
  • an Emacs mode is available (abcd-mode)
Beside these changes, the main update concerns the internals: SNAKES now features a full parser generator for Python-like languages. All parsing tasks are now handled using SNAKES' own code, thus removing the dependencies with ast module and making parsing independent from the Python version SNAKES runs on. You may have a look a snakes/lang/ directory to see more, in particular: snakes/lang/abcd/abcd.pgen declares the concrete syntax for ABCD and snakes/lang/abcd/abcd.asdl declares the abstract syntax. (Both extend the syntax defined in snakes/lang/python/ for Python.) A LL(1) parser is generated using the pgen file and a translator from concrete syntax trees to abstract syntax trees is hand-written in snakes.lang.abcd.parser. A hierarchy of classes is generated from the asdl file to mimic the content of Python ast module. Most of this code is adapted from Mython project. (Thanks!) I'll try to post something about how to generate your own parsers.

Because of these changes, there may be some new bugs. But hopefully many old ones have disappeared and the new ones should be now much easier to fix!

As usual, Ubuntu packages have been updated and the source code is available here

Post a comment