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.