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 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.
GD Star Rating
loading...
Tagged with: Karma
Nov 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.
GD Star Rating
loading...
Tagged with: Spirit
Nov 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.
GD Star Rating
loading...
Tagged with: Spirit
Nov 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.
GD Star Rating
loading...
Tagged with: Qi
Nov 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.
GD Star Rating
loading...
Tagged with: Spirit
Nov 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…
GD Star Rating
loading...
Tagged with: Addendum • Documentation
Nov 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.
GD Star Rating
loading...
Tagged with: Spirit
Nov 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
GD Star Rating
loading...
Tagged with: Release • Spirit
Nov 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.
GD Star Rating
loading...
Tagged with: Karma
Nov 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.
GD Star Rating
loading...
Tagged with: Qi
Recent Comments