PettitParser provides a more Pharo orientated syntax. SmaCC uses syntax
very similar to regex. SmaCC comes with a lot of parser for programming
languages.

I chose SmaCC because

a) the syntax is very compact and it allows me a bird's eye view over the
overall syntax definition, but also more difficult to read. PettitParse is
the opposite , much easier to read but more verbose.
b) It comes with a very detailed python parser and many other parsers.

For less powerful parsing you can use also regex which is what both parser
are based on as a general idea. The advantage of regex is that is already
included inside Pharo. However if you plan to extend your syntax and grow
it to something complex pettit or smacc will be a far better choice.

I use smacc to parse python data types (list, dictionaries and custom
python types) to pharo objects and so far has been working like a charm.  I
could do the same with PettitParser but having a python parser saved me
time in the short and long run. I also really like the compact syntax, it
took me time to get used to regex syntax but now I find quite easy to read.

Hope that helps you.

Reply via email to