Parser Generators

Posted: Sun, 11 September 2005 | permalink | No comments

Adrian Sutton's blog entry " ANTLR Is Not As Cool As I'd Hoped" reminded me of my days playing with (in my case) bison and flex, and generating parsers for almost anything and everything that involved structured text-type stuff.

I don't do that anymore, for much the same reasons as Adrian described -- for a lot of grammars, designing, coding, debugging, and maintaining the parser definition was more of a pain than just putting together some regexes and a simple state machine. Bison, especially, can be really tricky to work out why something isn't working as it's supposed to. By the time you add on the fact that most programmers out there don't understand bison and flex, so it's harder for random people to maintain, there is very little benefit to be gained by using a structured parser syntax.

I will certainly say, though, that if you ever have need to design a programming language or other heavy-handed structured format, the parser generation tools out there will make your day infinitely easier.

Possibly the scariest thing to consider now, though, is that everyone seems to be encoding absolutely everything in XML -- which means no more dealing with bison, but libxml2 instead. Aiee!


Post a comment

All comments are held for moderation; markdown formatting accepted.

This is a honeypot form. Do not use this form unless you want to get your IP address blacklisted. Use the second form below for comments.
Name: (required)
E-mail: (required, not published)
Website: (optional)
Name: (required)
E-mail: (required, not published)
Website: (optional)