4 ms·
boost::spirit Directly implement a parser for a language by writing its grammar in C++ code. Spectacular, and very easy to use once you practice on a few smal
by pjkundert 14y ago
boost::spirit
Directly implement a parser for a language by writing its grammar in C++ code. Spectacular, and very easy to use once you practice on a few small languages. I implemented a fairly complete HTTP/1.1 parser using it, for an embedded application's web interface, but it really shines for implementing tiny one-line single-use parsers for strictly validating arbitrary program inputs; instead of hacking it with a sub-par hand-written parser, you can implement a completely specified grammar in a small inline block of C++, and it "reads" like a YACC parser definition.
Wonderful invention.
And, might I add -- since it's C++, it is easy to use it for only your parsers, and provide a 1st class C linkable API.