I've uploaded to pypi pydsl version 0.2.0.

The changes included are:

  •  support for translators (again!)
  • improved ply support
  • binary (bin/ folder) cleanup
Next release 0.3.0 is schedule for equinox, see the issue list.


A new version of pydsl is available! The new version simplifies the relation between Grammars and Alphabets. Now Alphabets are Grammars, and every grammar has an alphabet to recognize from.

I also deleted a lot of unused code related with the repository implementation and the incomplete weighted parser. See Changelog, Pypi package

0.4.1 The base_alphabet refactoring and Parsley support

The latest pydsl release (0.4.1) contains a big step towards code sanity: the alphabet conversion is handled outside the parsers/checkers/lexers... Before this version, each function attempted to do an implicit conversion:


     1 2 3 4 5 (ascii) -> f(x) (expects an integer and will cast to integer if it is not an integer)


     1 2 3 4 5 (ascii) -> 12345 (integer) -> f(x) (fails if input is not tokenized with integers)

this affects every pydsl function (checker, extract, translate) and it is required to generate a meaningful first element for a given grammar. Before, because the input was converted into the expected type, first always returned a set of cast elements. Now, first() will fail if the input is not recognized as part of the base alphabet of the target grammar.

This change is a requirement to fix the bottom-up parser implementation (LR0) and to add new algorithms.

Another milestone for the project is the addition of parsley support by @ptolom . Parsley is probably the best option to implement a quick PEG grammar in python. The error reporting is very good.