If things look a little dusty around here, it's because I'm away on a mission for two years. I'll be back in August 2012, but in the mean time feel free to fork my projects on github.
Comparing parser generators in Python
Jul 17, 2010
by Jared
http://jaredforsyth.com/media/uploads/battle.png

One of the comments on reddit when I announced codetalker was "what's wrong with pyparsing?"

So I thought I'd run some comparisons, detailing why I felt the need to reinvent this particular wheel.

My favorite entry-level parsing project is JSON; it's about as simple as a grammar gets while still having a great deal of real world value. So I looked around for some examples of parsing JSON with pyparsing, and thought I'd throw in PLY for good measure.

Implementations

[of course, these represent one person's usage and are not the only possible implementations, but I think they are a good example of each library]

Anyway, here are the stats: [live online graph]

http://jaredforsyth.com/media/uploads/parsers_json_graph.jpeg

If it's not clear, lower is better.

And in addition to the raw stats, I think codetalker's way of defining grammars if more intuitive & has a better correlation to the traditional BNF style.

Of course, to each their own -- just because codetalker is more intuitive to me doesn't mean it will be for you -- take a look at the code, and take your pick.

What experience do you have with parser generators? Is there some killer library I left out? Feel free to tell me in the comments.

blog comments powered by Disqus