Spirit Parser

I needed a C++ parser today, and discovered the Spirit Parser Framework.  Wow – this is very impressive.  I was inclined to use good old lex/yacc; but this seems a lot better.

It took a while to get started as I don’t doing grammar work often.  But all in all, I found this toolkit easy to use, has good documentation, fast, and it just worked.  It’s a recursive-descent parser written using C++ templates.  You define the grammar directly in your C++ code, and it uses template magic to auto-generate the code.

I’m still waiting to discover it’s Achilles Heel.  The compilation is a little slow; but the runtime seems snappy.  I don’t have a benchmark, though.

Leave a Reply

Your email address will not be published. Required fields are marked *