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.
Nov ’09 27
This is another article in the series of “How To’s” providing you with shrink wrapped grammars directly usable in any project. I’m going to describe a Karma grammar you can use to generate output for quoted strings, where all contained special characters are properly escaped.
See full article here.
Tagged with: Karma
Nov ’09 26
We started to collect the information about what compilers and platforms can be used to compile applications based on Spirit V2.1. Please add any compiler and platform you have been using successfully to compile your Spirit applications.
For a list of known compilers go here.
Tagged with: Spirit
Nov ’09 24
On this new page we collect projects and products using Boost.Spirit. This list is not exhaustive as we certainly don’t know about every use. Spirit is a Boost library making it readily available to a large number of developers. If you want your product, in house use, or open source project to be included in this list, please send a note to the Spirit Mailing List or simply add a comment below and we’ll gladly add the info.
See the full list here.
Tagged with: Spirit
Nov ’09 20
Several people have been asking the question of how it would be possible to access the current iterator position from a semantic action. Different solutions have been proposed, all of them somehow abusing the predefined Qi directive raw[] which normally exposes as its attribute the pair of iterators pointing to the range in the input stream matched by the embedded parser. I thought this to be a nice incentive to write about how you can create your own parser components.
See full article here.
Tagged with: Qi
Nov ’09 20
A PDF build of the documentation for Boost-1.41 (from John Maddock) is now available here:
Thank you, John!
I extracted and uploaded the Spirit 2.1 documentation here: http://boost-spirit.com/dl_docs/spirit2_1.pdf
Have fun!
P.S. Don’t forget to visit this site every once in a while. We are posting tips, tutorials and addendum. Check out the Articles section.
Tagged with: Spirit
Nov ’09 19
Somehow, this did not make it into the 2.1 documentation. This important piece of information shouldn’t languish too far into the abyss. So here it is…
Tagged with: Addendum • Documentation
Nov ’09 19
Why would you want to upgrade to Spirit2 from “Classic” Spirit?
Here’s a teaser:
Spirit 1.x [ straight pattern matching (no actions) ]
real 0m0.359s
user 0m0.332s
sys 0m0.012s
Spirit 1.x [ parse tree generation ]
real 0m9.305s
user 0m9.209s
sys 0m0.076s
Spirit 2.1 [ AST with variant nodes generation ]
real 0m0.459s
user 0m0.432s
sys 0m0.028s
Check out this short article.
Tagged with: Spirit
Nov ’09 19

Champagne to us all
The much-awaited Spirit 2.1 is now released after more than 2 years in beta (Spirit 2.0). Boost release 1.41.0 includes Spirit 2.1. This is the official release of the new Spirit 2.1, a completely new library for parsing, lexing, and output generation.
Boost release 1.41.0 is now available!
This release contains one new library and numerous bug fixes for existing libraries. For details, including download links, see
http://www.boost.org/users/news/version_1_41_0
The release can also be downloaded directly from SourceForge. See
http://sourceforge.net/projects/boost/files/
To install this release on your system, see
http://www.boost.org/doc/libs/1_41_0/more/getting_started/index.html
Thanks,
–The Boost release team
Tagged with: Release • Spirit
Nov ’09 18
Even if it feels a bit like cheating I decided to get back to the example highlighting lists of key/value pairs I initially wrote about here. On the other hand looking at this very same problem from the standpoint of generating output allows me to highlight a couple a interesting facilities Spirit provides you with.
See full article here.
Tagged with: Karma
Nov ’09 17
Wanna make a blazingly fast rule? Use BOOST_AUTO! Check it out here. The code defines a named rule using C++0x auto when available and falls back to some template wizardry on older compilers.
See full article here.
Tagged with: Qi
Nov ’09 17
This sample is a port of the original “Nabialek trick” from classic Spirit.
See full article here.
Tagged with: Qi
Nov ’09 15
One of the goals of this blog is to provide shrink wrapped solutions for small everyday parsing and output generation problems. We hope to show how Spirit may be used to simplify the life for you as a C++ programmer related to data conversion problems from some external representation to your internal data structures and vice versa.
See full article here.
Nov ’09 14
Would you like to try the new version of Spirit but you are stuck with an older version of Boost? If yes, don’t despair, there might be help!
See full article here.
Nov ’09 06
Now, as the release of the new Spirit version is at our doorstep, I would like to whet your appetite. Let’s start with a list of high level things worth knowing.
See full article here.
Nov ’09 01
Boost 1.41 release is coming vey soon, along with it, the much awaited Spirit version 2.1. It’s about time we have a major website makeover. Check out the new site for Spirit 2.1 (in beta).
- Finally settled on WordPress. It does the job wonderfully, with minimum fuss, and it has great support.
- The new docs are uploaded. The search box should be available once Google starts to index the new site (I already submitted a sitemap) for the Google Custom Search.
Recent Comments