Welcome to Spirit
Spirit is a set of C++ libraries for parsing and output generation
implemented as Domain Specific Embedded Languages (DSEL) using
Expression templates and Template Meta-Programming. The Spirit
libraries enable a target grammar to be written exclusively in C++.
Inline grammar specifications can mix freely with other C++ code and,
thanks to the generative power of C++ templates, are immediately executable.
Spirit is part of Boost Libraries, a
peer-reviewed, open collaborative development effort.
Jul ’11 24
Spirit is 10 years old!
It’s hard to pinpoint exactly the birthday of Spirit. Looking back, Spirit 1.0 which was uploaded to SourceForge in July 27, 2001 contains this comment in its main header file:
8/28/1999 Original Implementation [ run time polymorphic version ] (JDG)
4/30/2001 Template meta-programming implementation (JDG)
5/13/2001 Major redesign using iterators (JDG)
5/26/2001 Port to G++3.0 and BCC 5.5.1 thanks to Vladimir Prus
5/27/2001 Bug fixes in Difference and Xor classes (JDG)
5/30/2001 Added Iterators (JDG)
Continue reading »
Jul ’11 23
Mike Lewis posted a marvelous experience report dubbed ‘Optimizing Boost Spirit – Blazing fast AST generation using boost::spirit’. He describes how he took an old compiler for the Epoch programming language (which was based on Spirit.Classic) and tuned it for performance using Spirit.Qi and Spirit.Lex. His results are exceptional, he got roughly a thousand fold speedup compared to the old version. The complete code for his compiler can be downloaded from here.
Continue reading »
Jul ’11 12
Spirit V2.5 is now available as part of the recently released Boost V1.47. I suggest you look at the What’s New documentation page for a list of things changed. This is a very important release for Spirit, mostly in the area of feature consolidation and less so by adding new functionality. It brings a lot of unification and quite some speedup in the area of attribute handling, both for parsers (Qi) and generators (Karma). Most of the newly added features are in the area of unification of the overall user experience as well. The things added to the Lexer should finally resolve some long standing requests. Most importantly, we are very excited about having added full compatibility with the newly released Phoenix V3 library.
Generally, all changes are supposed to be fully backwards compatible. If you run into problems with your existing code, please tell us by leaving a comment or by sending a message to the Spirit mailing list (as described on our Support page).