News Archive

October 20, 2008.


Regarding the evil post-skip (see news Post-skips (Important for Boost 1.34 and above users) below), here’s an ***IMPORTANT UPDATE***: I just found out that g >> eps_p is wrong. eps_p does not do a pre-skip, so the code will do nothing. The correct code is:

parse ( str , g >> !end_p , skipper );

October 19, 2008.


Phoenix has been accepted into Boost!!! There are 15 votes, 11 of which vote for acceptance and 4 vote for conditional acceptance.

All reviewers stated that the outstanding quality of the library and its documentation fully merit immediate acceptance. There is no direct concern with regard to the library itself. Phoenix V2 is already in the Boost distribution as a Spirit sub-library and has matured for a long time, proving its stability and usability. On the other hand, Phoenix provides functionality already covered by Boost.Bind and Boost.Lambda. It is the general intention to use Phoenix as the development ground for a new unified Boost library in this area. The review discussions revealed quite some details and certain problems which have to be resolved for this merger to happen. Joel has a full list of these details and promised to address all of them before adding Phoenix to the Boost SVN.

–Hartmut Kaiser, Review Manager

August 17, 2008.

Spirit2 and Boost 1.36.0

Boost 1.36.0 has been released. Along with it, comes Spirit 1.8.7, integrated with Spirit V2, “The New Generation”. Even if the directory structure has changed (the Spirit Classic headers are now moved to the ‘$BOOST_ROOT/boost/spirit/home/classic’ directory), we created forwarding headers allowing to compile existing applications without any change. These forwarding headers are deprecated, though, which will result in corresponding warnings generated for each of the headers. The forwarding headers are expected to be removed in the future. The recommended way of using Spirit Classic is now to include header files from the directory ‘$BOOST_ROOT/boost/spirit/include’. All files of Spirit Classic have now a ‘classic_’ prefixed to their name. For example the include

#include <boost/spirit/core/core.hpp>

now should be written as:

#include <boost/spirit/include/classic_core.hpp>

To avoid namespace conflicts with the new Spirit V2 library we moved Spirit Classic into the namespace boost::spirit::classic . This change will be automatically deactivated whenever the deprecated include files are being used. This ensures full backwards compatibility for existing applications. For more details about this change please consult the documentation.

Spirit2 is in beta. For the adventurous only. The interface is stable (and has been for almost 2 years now). The documentation is still sparse, but there are tons of examples in there. Also, don’t complain about compile times. We haven’t optimized on compile times yet. There’s lots of room for improvement in that area still.

April 18, 2008.

Spirit2 development

FYI, Spirit2 development has been moved to Boost SVN trunk. We successfully merged with Spirit 1.8.x which is called “classic” Spirit now. Users of “classic” Spirit should not have to do anything; it’s fully backward compatible. However, there are changes in the include structure to accommodate different versions under one spirit directory at the same time. While the old includes will still work, they are deprecated with a warning message:

“This header is deprecated. Please use: xxx.hpp”

The new include scheme is easy to use. We have an “include” directory where we place all forwarding headers to the actual files. For classic spirit, the files are prepended with “classic_”. For example, what used to be:


is now:


November 28, 2007.

Post-skips (Important for Boost 1.34 and above users)


In boost 1.34, if there is a trailing white space characters in an input sequence, parse returns with info.full set to false, even though parsing was (essentially) full. The skip parser is ignored for the last sequence. In 1.33 parsing succeeds as expected.

The change in behavior was intentional. It was made on the grounds of consistency (parsers shouldn’t consume any more output than what they have matched), as well as to avoid a hang when directly parsing stdin: namely, parse() would hang waiting for a non-whitespace character at the end of a match.

You may workaround this change by adding eps_p or end_p after your grammar, as in:

my_grammar g ;
my_skipper skipper ;
parse ( str , g >> eps_p , skipper ); // 1
parse ( str , g >> end_p , skipper ); // 2

The 2nd option requires a full match, while the first one gets you the previous behaviour without making a full match obligatory.

Here’s where the change was first announced, for context:

***IMPORTANT UPDATE***: I just found out that g >> eps_p is wrong. eps_p does not do a pre-skip, so the code will do nothing. The correct code is:

parse ( str , g >> !end_p , skipper );

September 02, 2007.

Spirit 1.8.5 and 1.6.4 released

It is my pleasure to announce the release of Spirit 1.8.5 and 1.6.4 .

Spirit 1.8.5 is a standalone variant of the version that is included in Boost 1.34.1; it doesn’t provide new features, but contains all the fixes that were applied since Spirit 1.8.4 . You can download Spirit 1.8.5 here.

Spirit 1.6.4 is the latest in a series of releases that are based on an earlier implementation that is friendlier towards older, less standard compliant compilers. This is a bug fix only release and is likely to be the final 1.6.x version. Spirit 1.6.4 is available here.

Both Spirit 1.8.5 and 1.6.4 are available in the following variants:

  • Library only (the / spirit-1.x.y.tar.gz files) – These contain only Spirit itself and require an existing Boost installation. Both were tested only with Boost 1.34.0 and 1.34.1, but should work with other reasonably recent releases.
  • Miniboost (the / spirit-1.x.y-miniboost.tar.gz files) – These contain also the minimal subset of Boost that is needed to use Spirit. This is a new version of the Miniboost that is based on Boost 1.34.1 and has the same directory structure as Boost itself.


— Nicola Musatti

April 05, 2007.

BoostCon ’07

Have you heard? Boost will be having its inaugural conference. It will be in Aspen, Colorado, May 14-18 2007. Spirit2 will debut at the Boost conference. It will be a complete parsing and output generation system that attempts to cover the whole spectrum from lexing to output generation.

Spirit2 will be ready before the Boost conference where Hartmut and I will give a talk titled “A cookbook approach to parsing and output generation with Spirit2”. Dan Marsden and I will also have a talk on Boost.Fusion. Oh yeah, Eric Niebler will also give a talk on Text processing with Boost in general, and the much anticipated Proto library with which Spirit2 is built on.

I invite you all to come:

BoostCon ’07

See the sessions here. You’ll see people like Kevlin Henney, Scott Meyers, Sean Parent (Adobe ASL), Dave Abrahams, etc — all these amazing people. It will be an amazing event — the first ever Boost Conference! Register now to secure your place at BoostCon 2007. Space is limited.

It will be fun to meet up with “Spiritistas” 🙂 as one of the pioneers, JCAB, puts it. Let’s have lods of fun and lotsa pizzas! And of course, not to forget beer!

Spirit 1.8.4 Released

October 29, 2006.

We just released Spirit v1.8.4. The files are available here:

This is mainly a bugfix release.

Spirit 1.8.4 Release candidate + Roadmap

October 1, 2006.

Spirit 1.8.4 will be released in the next few days. You can get a beta snapshot here:

These betas are provided to make sure that all is ok. We appreciate feedback and reporting of problems encountered. We’d like to make sure that the packages are in perfect shape before we do the final release.


  • Spirit 1.8.4 release
  • Soon after the release of Spirit 1.8.4, Spirit 1.8.5 will follow. Spirit 1.8.5 is the bridge to Spirit-2. Spirit 1.8.5 integrates Fusion2 and Phoenix2. It is already in the final stages of development. Spirit 1.8.5 is not 100% backward compatible to Spirit 1.8.4. We shall provide some documents to make the transition as smooth as possible. The difference is minimal. Hopefully, 1.8.5 (and subsequent releases) will ease the transition to 2.0.
  • Development of Spirit-2 shall proceed parallel to Spirit 1.8.5++.

We welcome comments and feedback.


September 16, 2006. Fusion2 was recently accepted into Boost. See this link.

It’s been a year. Most of the time was spent on infrastructure development for the planned Spirit2 development. This includes Phoenix2 and Fusion2 plus a documentation tool called Quickbook. These are major developments. Fusion2 will be the core infrastructure on which Spirit2 will be built. Phoenix2 is already built on top of Fusion2.

What is it? Fusion is a library for working with heterogenous collections of data, commonly referred to as tuples. Collectively the containers and views are referred to as sequences, and Fusion has a suite of algorithms that operate upon the various sequence types, using an iterator concept that binds everything together.

Special thanks to Ronald Garcia, and the review manager and to all the people in the boost community who participated in the review: Andreas Pokorny, Andreas Huber, Jeff Flinn, David Abrahams, Pedro Lamarao, Larry Evans, Ryan Gallagher, Andy Little, Gennadiy Rozental, Tobias Schwinger, Joao Abecasis, Eric Niebler, Oleg Abrosimov, Gary Powell, Eric Friedman, Darren Cook, Martin Bonner and Douglas Gregor.

New Web Page

August 26, 2005. What you are looking at now is a completely redesigned web page. Now that Boost has a brand new web page design, so should Spirit.

Spirit 1.8.3 and Spirit 1.6.3 Released

August 20, 2005. Spirit 1.8.3 and 1.6.3 released. You can download the files here and view the change log here. As far as 1.8.3 is concerned, this release contains exactly the same files as the Boost 1.33.0 release.

Boost 1.33.0

August 11, 2005. Boost 1.33.0 has been released. See Boost’s Site. Boost 1.33.0 includes Spirit 1.8.3. Go get it. As usual, a stand-alone Spirit package with a Mini-Boost 1.33 (just enough to get Spirit going) will be released here.


February 23, 2005. Wave has been accepted into Boost!

With special thanks to Tom Brinkman, who volunteered to be the review manager.

With thanks to:

David Abrahams, Beman Dewes, Reece Dunn, Larry Evans, Doug Gregor, Joel de Guzman, Baptiste Lepilleur, Andy Little, Paul Mensonides, Dan Nuffer, Andreas Pokorny, Vladimir Prus, Gennadiy Rozental, Michiel Salters, Jonathan Turkanis, Chris Uzdavinis, Pavel Vozenilek, Michael Walter.

for bug reports, fixes and hints during the review process.

Spirit 1.8.2 and Spirit 1.6.2 Released

December 9, 2004. You can get it here . What’s new? You can view the change log here .

Boost 1.32.0

November 21, 2004. Ok, Boost 1.32 has been released. See Boost’s Site . Along with it is Spirit 1.8.1 . Go get it. Right now, we are preparing a stand-alone Spirit package with a Mini-Boost 1.32 (just enough to get Spirit going) for release here. Almost there….

Spirit 1.8.1

August 1, 2004. Watch this space. Spirit 1.8.1 will soon be released coinciding with the latest Boost 1.32. Coming very soon …

Spirit Repository Available

February 9, 2004. See the “Repository” link at the left. Check it out This page lists some full applications that uses the Spirit parser framework. To those who wish to contribute stuff to the repository, please send an email to: joel-at-boost-consulting-dot-com. You can send me a zip file, a cpp file, or even a simple link to your application. Please also send some info regarding the submission (author, overview). Thanks!

Boost 1.31.0 Released

February 9, 2004. Boost 1.31.0 has been released (at last) . Spirit v1.8.0 is part of the release. See the Boost’s home page for latest news about what’s in the release.
What’s new with Spirit 1.8.0:

  • Multiple grammar start rules
  • Multiple Scanner rules (no more scanner business woes)
  • More dynamic parsers
  • Predefined actors
  • Numerous bug fixes and QOI stuff
  • …and more…

So go right here to download.

Wave 1.0.0 released

January 6, 2004. The new V1.0.0 of the Wave library is released.

This is the first release of this library, which is considered stable. The main changes from the previous version are bug fixes (and a lot of them). But there were some minor functionality additions too:

  • Added support for #pragma once.
  • Added support for #pragma wave timer() and the –timer command line switch, which allows for rough timings during preprocessing.
  • Added a generic interface, which allows to add custom #pragma directives easily.
  • Included a finite state machine, which supresses not needed whitespace. This makes the generated output much more dense.
  • Added an optional IDL mode, which besides not recognizing C++ specific tokens doesn’t recognise any keywords (except true and false), but only identifiers.
  • Incorporated a couple of changes, which improve the overall performance.
  • Switched licensing to use the Boost Software License, Version 1.0.

The Wave preprocessor library has shown to be very stable and Standards conformant now. It is able to compile the strict pp-lib (Chaos by Paul Mensonides) and the Order library recently published by Vesa Karvonen and was tested to correctly preprocess different system headers of different compilers.

Besides Wave there is currently only one preprocessor, which is able to compile both mentioned libraries (Chaos and Order): gcc.

To successfully build Wave you will still need to install at least the Boost 1.30.2 release ( download here ) and the program_options library from Vladimir Prus ( download here ).

Merry Christmas and a Happy New Year !!!

December 23, 2003.

Spirit in C#… Spart

December 18, 2003. Jonathan de Halleux has been playing a lot with C# lately so he wondered if it was possible to port (partially) spirit to C#… and the answer is yes! The result is called Spart and maps as much as possible the Spirit ideas. Of course, there are a lot of things remaining to do, but he managed to implement the famous calculator grammar, so he’s optimistic.

There were a number of limitations that he had to tackle but the results look statisfying. The main limitation is that C# has no templates (until C# 2.0 is out). This is a big problem when you think spirit is based on TMP (template metaprogramming). He got rid of templates by using abstract classes and interfaces. Another limitation is that C# has a strict policy for defining operators, so a lot of operators simply cannot be overloaded! For those interrested to see the result, you can check his article on or download Spart from

Release of 1.8.0

Hi Y’all,

November 5, 2003. We are nearing the release of 1.8.0 stable. This will coincide with the boost 1.31 release due probably by early December. The pre-release code is branched in RELEASE_1_8_0 in the CVS. The library is in very good shape and is a candidate for release. I would like to get some initial feedback. Most importantly:

Historically, Spirit supported a lot of compilers, including (to some extent) poorly conforming compilers such as VC6. Spirit v1.6.x will be the last release that will support older poorly conforming compilers. Starting from Spirit v1.8.0, ill conforming compilers will not be supported. If you are still using one of these older compilers, you can still use Spirit v1.6.x.

The reason why Spirit v1.6.x worked on old non-conforming compilers is that the authors laboriously took the trouble of searching for workarounds to make these compilers happy. The process takes a lot of time and energy, especially when one encounters the dreaded ICE or “Internal Compiler Error”. Sometimes searching for a single workaround takes days or even weeks. Sometimes, there are no known workarounds. This stifles progress a lot. And, as the library gets more progressive and takes on more advanced C++ techniques, the difficulty is escalated to even new heights.

Spirit v1.6.x will still be supported. Maintenance and bug fixes will still be applied. There will still be active development for the back-porting of new features introduced in Spirit v1.8.0 (and Spirit 1.9.0) to lesser able compilers; hopefully, fueled by contributions from the community (VC++ and Borland experts, we need your help!) . For instance, there is already a working AST tree back-port for VC6 and VC7 by Peder Holt.

Please post feedback to:
Spirit-general mailing list

CUJ article

September 1, 2003.


If you got here from reading the CUJ September 2003 article “The Spirit Parser Library: Inline Parsing in C++”, well… things have changed quite a bit since the article was written. If you want to try out some of the code from the article, it is best to either use version 1.2 or download a special CUJ version following this link .

Later on, if you want to try out the latest version (1.6.1), feel free to get it here. If you do, I invite you to read the docs first to get a feel of what’s new and what’s been changed. It’s always nice to start here: Quick Start .

Spirit v1.7.0 and v1.6.1 Released!

July 13, 2003.

Get it here:
Spirit v1.7.0
Spirit v1.6.1

Take note that by convention, odd minor version releases (e.g. 1.7.0) are developmental while even minor version releases (e.g. 1.6.1) are stable.

See What’s new.

Wave 0.9.3 released

May 15, 2003. The new V0.9.3 of the Wave library is released.

During the last couple of weeks in the Wave preprocessor were implemented several C++ preprocessor extensions to the current Standard, as recently proposed on the Boost list . This was done to support the preparation of a Standards proposal, which is currently under way.

Concretely this paper will propose to:

  • add variadics and placemarkers to C++ as standardized in the C99 language
  • add macro scopes as proposed by Paul Mensonides (slightly changed after heavy discussions with Paul Mensonides)
  • add well defined token-pasting of unrelated tokens as proposed by Paul Mensonides
  • the __comma__, __lparen__ and __rparen__ alternative tokens as proposed by Vesa Karvonen

These proposals are now implemented in Wave (for details see the documentation ). Additionally there were several bug fixes and minor changes and additions, which are documented in the Changelog file contained in the distribution.

To successfully build Wave you will still need to install the Boost 1.30.0 release ( download here ) and the program_options library from Vladimir Prus ( download here ).

News flash! Wave got a tracing facility

April 7, 2003. If you ever had the need to debug a macro expansion you had to discover, that your tools provide only little or no support for this task. For this reason the Wave C++ preprocessor library got a unique tracing facility, which allows to get selectively some information from the expansion of a certain macro.

The tracing facility is plugged into the library through a policy, which allows for its easy customization. The Wave command line driver utilizes this new feature to generate a complete log containing information about every stage of the expansion of a macro under inspection, which allows to easily analyze foreign code or to debug your own problematic macros.

As always, the Wave library may be downloaded here.

Wave 0.9.1 released

March 25, 2003. A new version of the Wave library is available. You can download it here .

The highlights:

  • Full compliance with the C++ Standard reached and verified with the help of a ‘strict’ version of the Boost.Preprocessor library of Paul Mensonides, which couldn’t be used even with EDG based compilers (Comeau/Intel).
  • Implemented variadics (macros with variable parameter count) and placemarkers (empty macro arguments) usable as an optional extension to the C++ Standard
  • Implemented a C99 mode, which has variadics and placemarkers enabled by default (as mandated by the C99 Standard and which additionally rejects certain C++ tokens (the alternative keywords as ‘and’, ‘or’ etc. and the ‘::’, ‘->*’, ‘.*’ operators), which are invalid for C99
  • Updated the documentation
  • Major speedup (this depends on the complexity of the compiled code and may reach upto 3-5 times if compared to the Wave V0.9.0 code)
  • The interface of the library has settled, there were fixed a lot of minor and major bugs
  • Added Jamfile.v2 to allow a convenient build process for gcc based environments

To successfully build Wave you will need to install the Boost 1.30.0 release ( download here ) and the program_options library from Vladimir Prus ( download here ).

Spirit v1.6.0 Released

March 21, 2003. Download it from here

Boost 1.30.0

March 20, 2003. Boost version 1.30.0 has been released. The highlights include Spirit v1.6.0 (the latest stable release) and MPL (Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes, from Aleksey Gurtovoy). Spirit v1.6.0 has started using MPL, an awesome libary very well suited for template metaprogramming libraries such as Spirit

Spirit v1.6.0 (stable) and Spirit v1.7.0 (developmental) will also be released here, as usual, with a miniboost package that includes only the minimal subset of boost needed to compile Spirit.

Spirit v1.6 and v1.7

March 12, 2003. Watch this space… Spirit v1.6 will very soon be released. This IS the official Boost release version that comes bundled with the upcoming Boost 1.30.0 release. It has been a while since we released a stable version. This IS it.

Spirit v1.7 (developmental version) will also be released. All new experimental features will be developed on v1.7 (only for the adventurous among us :-).

Wave! What a rave!

March 12, 2003. If you want the BEST C++ preprocessor in town, get Wave! In terms of conformance to the standard, nothing beats Wave. 100% certified by none other than Paul Mensonides, the Boost.Preprocessor meister. This Spirit application totally ROCKS!

Wave 0.9.0 released

March 8, 2003. The Wave library is a C++ Standard conformant preprocessing C++ lexer, which exposes a [forward] iterator interface that iterates over the preprocessed C++ tokens. It is built with the help of the Spirit library.

A sample driver is included which fully utilizes the capabilities of the library and provides the functionality of a full blown text stream –> text stream C++ preprocessor.

You can download Wave here

The main goals of this project are:
– full conformance to the C++ standard (INCITS/ISO/IEC 14882/1998)
– usage of Spirit for the parsing parts of the game (certainly 🙂
– maximal usage of STL and/or Boost libraries (for compactness and maintainability)
– straightforward extendability for the implementation of additional features (e.g. variadics and placemarkers)
– building a flexible library for different C++ lexing and preprocessing needs.

To successfully build Wave you will need to install the Boost 1.30.0 release ( download here ) and the program_options library from Vladimir Prus ( download here ).

Boost Spirit

October 26, 2002. Boost Spirit Oh, what a name…
Spirit has now been accepted into boost!

Thanks to all who participated in the review:
John Maddock, our review manager
Aleksey Gurtovoy
Andre Hentz
Beman Dawes
Carl Daniel
Christopher Currie
Dan Gohman
Dan Nuffer
Daryle Walker
David Abrahams
David B. Held
Dirk Gerrits
Douglas Gregor
Hartmut Kaiser
Iain K.Hanson
Juan Carlos Arevalo-Baeza
Larry Evans
Martin Wille
Mattias Flodin
Noah Stein
Nuno Lucas
Peter Dimov
Peter Simons
Petr Kocmid
Ross Smith
Scott Kirkwood
Steve Cleary
Thorsten Ottosen
Tom Wenisch
Vladimir Prus

Spirit v1.5.1 released

October 10, 2002.

Download it from here
Changes from 1.5.0:
Added –enable-spirit-threadsafe and –with-boost= configure script options.
Use BOOST_STATIC_CONSTANT in Phoenix to increase portability.
Rearranged Spirit debug code so it would always work regardless of include order.
Added new group_d directive.
Added capability for subrules to have contexts.
Added DEBUG support for subrules.
Fixed compile problems with SPIRIT_THREADSAFE.
Fixed symbols add() free function.
Adjustments to refactoring parser.
Fix ast_xml.cpp example.
Added tests for object_with_id class.
Added phoenix_subrule_calc.cpp example.
Added grouping_calc.cpp example.

Spirit v1.5.0 released

October 5, 2002. It’s official! Get it from the download page: here

Spirit v1.5.0

August 28, 2002. Watch this space. Spirit v1.5.0 will soon be released. Coming soon to a compiler near you 🙂 Where is v1.4? Spirit v1.3 has been merged with Spirit-X and the result is v1.5. There will be a minor version skip.

Spirit 1.2.9 released

May 20, 2002. This release fixes the following bugs:
multi_pass.hpp: Added some missing typename keywords.
exceptions.ipp: Added some missing inline to fix multiple symbol definition linker errors when using spirit in more than one translation unit.
loops.ipp: in finite_loop::parse() changed assert(n1 < n2); to assert(n1 <= n2);

This release has been tested with gcc 3.1


May 10, 2002. Here’s the semi-final candidate for Spirit-X. This will be the basis of a formal submission to boost . Still, this is an experimental version. This is not an official release. As yet, it does not have all the bells and whistles of v1.3.2. However, it has some new concepts and features that were not available before. For instance Spirit-X has subrules which are efficient versions of the rule. Subrules allow us to write one-expression grammars. Yes, subrules push the limit of C++ much further. Also, the scanner is now policy based. This allows extreme flexibility and ease of extension over the full parsing process.

You can get it here: .

***This is not an official release*** but feedback is most appreciated.

Tested on:.
1) g++ 2.95.2
2) g++ 3.0.4
3) g++ 3.1
4) Borland 5.5.1
5) Comeau 4.2.45
6) Microsoft VC++ 6
7) Microsoft VC++ 7
8) Intel 5.0
9) Intel 6.0

Virtual Machine (VM) alpha released

April 15, 2002. First alpha release of the virtual machine released. It can be downloaded at: Included are a number of regression tests, and a spirit/VM implementation of Stella Finite Difference Equations used in systems modeling.

Bugfix Release: 1.2.8

March 23, 2002. This release fixes a bug in the tst class which caused a possible false match in the symbol table class. Download the .tar.gz. here or the .zip here

Bugfix Release: 1.2.7

March 15, 2002. This release fixes a rare problem that may cause the scanner to scan past the end of the input. Download the tar.gz or the zip

MSVC Port for 1.3.1

March 11, 2002. Thanks to Ragav Satish! The long awaited port to MSVC is here.
It has been tested on Microsoft Visual C++ 6.0 sp3.
Most of the features of 1.3.1 are supported with the exception of tree generation and the 1.3.1 policy based multi_pass (The older multi_pass is supported instead)
Here’s the link:

1.3.2 Released

March 7, 2002. Finally a new release of the development code! This release contains a lot of new features since 1.3.1, including the amazing Phoenix library.

Bugfix Release: 1.2.6

March 1, 2002. Thanks to Yogesh Ketkar for finding a bug in spirit 1.2.5 🙂
1.2.6 fixes a bug in finite_loop which may happen when using the .repeat(min, max) construct. Download the patch , the .tar.gz , or the .zip

Phoenix framework

February 21, 2002. Please take note that the Phoenix framework is still alpha and subject to change (v0.9). For the adventurous only 🙂

New SEs (named Phoenix)

February 19, 2002. Joel Said:
Here’s a first shot of the SE framework. This version can be used outside Spirit (e.g. STL algorithms). It is more or less complete. The only thing that’s missing are the control structures (statements) and the lazy_casts. You can get a glimpse on what’s new at:

I should complete the full sub-framework this week (best effort, no promises) unless Borland or G++ ICEs again (darn! )

There is a test program that demonstrates the features. The library header files are fully commented with Spirit style inline documentations before every major class interface.


January 30, 2002. We’ve added a WikiWikiWeb to the site, this will allow Spirit users and developers to openly discuss topics and work on documentation, tutorials and more. Take a look at the WikiWikiWeb for instructions and to participate.

Spirit V1.2.5 Released

January 12, 2002. This release fixes a bug where repeat(0) would return a non-match, when it should return a 0 length match. Thanks to Nicholas Charles Leippe for reporting the bug.

Download the tarball or the zip

Spirit V1.3.1 Released

December 7, 2001. This release has a TON of cool new features that you’ve been waiting for! Here’s the list:

  • Added closures which are the enabler behind inherited/synthetic attribute processing.
  • Created attr_rule which supports inherited and synthetic attributes.
  • Improved debug output and granularity.
  • Fixed numeric parsers for gcc 2.95.2.
  • Added list utility parser.
  • Reworked multi_pass iterator to be a policy driven template. Now it supports different policies such as ref-counted, first owner, checked/non-checked, infinite lookahead with a std::deque or fixed size lookahead. There is now a class called look_ahead that is a multi_pass with these policies: first owner, non-checked with a fixed size queue. The template parameter N specifies the amount of static storage to use for lookahead. For example usage see the multi_pass.cpp test case.
  • Added AST generation via ast_parse methods which return an ast_match (NOTE: This interface may change in the future.)
  • New examples:
    • grammar_capsule (how to use grammar class and synthetic attributes with closures)
    • list_parser (shows usage of the new list parser)
    • calc_ast (a simple calculator that uses AST generation)
    • attributed_rules (an RPN calculator that uses new attr_rule)
    • parameters (uses parser parameters and closure to process a type declaration. This shows usage of both inherited and synthetic attributes)
    • xml/ast_xml (shows AST usage. It parses an XML document into an AST and then prints the document out)
    • multi_pass (A test case, but it’s the best example so far of how to parameterize multi_pass.)
  • Added more tests and now ‘make check’ will run the tests to make sure they pass.

Download links:


V1.3.x and V1.2.x

November 28, 2001. To avoid further confusion, if you haven’t noticed yet, please take note that starting from V1.2, odd numbered minor versions (e.g. V1.3.x) are development (alpha/beta) releases while even numbered versions (e.g. V1.2.x) are stable releases. Thanks…

Spirit V1.2.4 released

November 24, 2001. This is a bugfix release for the 1.2 stable branch.

The following has changed since 1.2.3:

  • Fixed some bugs with multi_pass operator++ and operator==
  • Fixed a compilation problem with primitives.ipp and STLport.

Download the .tar.gz here or the .zip here

V1.3.0 on Borland

November 18, 2001. Please be informed that V1.3.0 “numerics.hpp” and “numerics.ipp” does not work yet on Borland. If you want to tryout V1.3.0 on Borland , 1) comment out the “numerics.hpp” and “numerics.ipp” #includes in “spirit.hpp” or 2) reinstall the previous numerics.hpp/ipp from V1.2.x. Thank you.

Spirit V1.3.0 released

November 18, 2001. 1.3.0 is the first release of the spirit development branch.
This branch should not be considered final or stable. Interfaces or library elements may change at any time. This branch was created so that users may have a look at new features as soon as possible and we can all benefit from “release early, release often”

Download the zip here or the tar.gz here

This release contains the following new features since the 1.2.x branch:

  • New numerics parser: more generic, handles octal, hex, differing separators, and more.
  • Regex parser: Wrapper around boost::regex (not distributed w/spirit), will recognize regular expressions. See RegExpr.cpp sample.
  • New static parsers: s_chlit, s_strlit and s_rxlit (character, string or regular expression to be recognized is part of the type via template parameters.)
  • Escape character parsers and associated action: lex_escape_ch_p and c_escape_ch_p, will recognize c-style or lex-style character escapes and decode them.
  • Confix and comment parsers.
  • Grammar class that simplifies writing grammars and decouples the iterator from the rule.
  • Closures: very useful for semantic action processing.
  • New examples: RegExpr.cpp, closure.cpp, escape_char_parser.cpp, comments.cpp, grammar.cpp, roman.cpp rfc821.cpp


Side dish

November 14, 2001. Stephen Baker sent a trivial bug fix for “primitives.ipp” for those who are using GCC with STLport 4.5. You can get it here . This should replace the file of the same name in the directory boost/spirit/impl/.

Spirit V1.2.3 has been released

November 12, 2001.

This is a maintenance release of the stable 1.2 branch. It fixes a few bugs. This is what changed from version 1.2.2:
Added a zipdist rule to the top-level Makefile
Fixed a memory leak in multi_pass
Fixed a problem with multi_pass::operator==
Added add and find methods for symbol tables.
Fix for gcc 3.0.1 + STLport 4.5
Other symbol table fixes.
Fixed the documentation to not encourage bad usage of multi_pass
Fixed some typos in the documentation reported by Robert Kindred
Fixed filexml.cpp sample to correctly use multi_pass.

Fast Food for Borland C++ Builder 5

November 2, 2001. A complete ready to run package for Borland C++ Builder 5 with Project files for all Spirit V1.2 examples has been contributed by Thomas Schittli. See V1.2 download section.

A Borland Quirk

October 22, 2001. Chris Uzdavinis has reported that there is a problem with Borland 5.5 compilers. It happens in the IDE ( C++ Builder ) but not on the free command line tool because the default compiler options are different. (Actually, the IDE invokes the compiler with options that override the “stock” default settings.)
If the -Ve flag is set to your build, the compiler reports an “internal compiler error”. -Ve is the setting for the “zero-length empty base class” setting. It should be on by default, but it shouldn’t be causing any internal errors (so maybe it’s best left off when using Spirit until Borland fixes the bug).

Spirit V1.2.2 has been released

October 22, 2001. This is basically the same as the general public release with some code tweaks for CodeWarrior 7 (thanks to Rémi Delcos). Mac programmers, this one’s for you. See the download pages.

Spirit V1.2.1 has been released

October 20, 2001. This is the general public release. This release includes Hartmut’s C parser in addition to Dan’s XML parsers and Hakki’s Pascal parser. Spirit V1.2.1 has been tested on the following compilers: * Borland C++ V5.5.1 * GCC 3.0 / 2.95.2 * Intel Compiler 5.01 * Comeau 4.2.45.

C Parser available

October 19, 2001. Hartmut Kaiser’s C Parser has been commited to CVS. This will be included in the final v1.2 general release.

Spirit 1.2.0rc1 has been released

October 1, 2001. Spirit 1.2.0rc1 has been released with a TON of cool new features (character sets, symbol tables, an STL-like iterator interface, more examples, debugging output, numeric parsers, and string parsers). See download page.

Spirit V1.1 Documentation is ready

July 25, 2001. Better late than never :-). See download page.

The SourceForge mailing list is now open to the public

June 14, 2001. Boost’s mailing list continues to be the medium for Spirit-development related topics while the SourceForge mailing list opens up another “friendly” window for other issues to be discussed. You can subscribe to the list here: .

Spirit V1.1 Documentation is almost ready

June 14, 2001. The documentation is now in sync with the new 1.1 features. This will be uploaded as soon as possible.

News Flash! Bruce Florman did it again

June 9, 2001. The MSVC port has been included in the common code base. His port works well with or without STLport. See download page.


June 9, 2001. Joel has managed to get Hakki Dogusan’s Pascal code to work! He says – “This has opened up some issues that I want to address soon.

This has more to do with optimisations. Would anyone be interested to join me and collaborate in developing a byte code interpreter and a scripting language using Spirit, as a proof of concept? Maybe this is premature. I will bring this topic up again (also in boost) in the future as we gain more experience with Spirit.”

News Flash!

June 7, 2001. Remi Delcos noted that Spirit code compiles “out the box” with Metrowerks CodeWarrior 6.2 on Mac OS (the latest shipping version). “All tests compiled and seemed to run fine.”


June 7, 2001. Static sets are parameterized sets that can conceptually hold up to 256 boolean keys. Yet, like magic does not hold any data at all, nil, zilch! The data is encoded completely in its type. Download here [ The documentation is in the single header file, comments welcome. ]

Common Spirit code-base ready!

June 6, 2001. After a day of code crunching, the common code base is already up and running. It has been tested on Metrowerks CodeWarrior 5.3, Borland C++ 5.5.1 and GCC 2.95.2. See the download page for details.

Spirit version 1.1 coming

June 5, 2001. The latest release of Spirit (Version 1.1) will be released after some compatibility checks with various compilers. V1.1 addresses some of the problems with V1.0 as well as adding numerous new features. V1.0 is stable as far as the test programs are concerned. Yet, there are already some known bugs that were not previously visible with the tests. These are all fixed with V1.1. A more thorough test program is being written now to ensure the robustness of Spirit.

Spirit V1.1 is already stable and should be available shortly after checking the code for compatibility with GCC 2.95.2 and BCC 5.5.1 (with or without STLport). Bruce Florman’s (and Changzhe Han’s) MSVC code will be updated to reflect the changes. Once V1.1 is released, the next step is to merge all versions into a single code base.

Spirit has been accepted for SourceForge!

June 4, 2001. SourceForge have accepted the application for a Spirit site there. Many thanks go to Changzhe Han for the work on this. We are preparing the SourceForge site now – as soon as it’s ready, we’ll give you the URL.

News Flash!

June 4, 2001. Spirit syntax change The latest version of Spirit now uses the “post-brackets” for semantic actions (as was suggested in the boost mailing list ) . The new syntax will break existing code. For example –

Old syntax:   action(expr)
New syntax:   expr[action]
The "test1.cpp" and "test2.cpp" files have been updated to use the new syntax.

Latest version of Spirit has been uploaded

June 4, 2001. Latest version of Spirit has been uploaded : This version adds the “micro-parser” functionality and numerous bug fixes that were exposed when compiling Hakki Dogusan’s Pascal grammar in Spirit. The problem arises when a rule aliases another rule which is not yet defined. For example:

Rule<> a, b;
b = a;
a = StrLit<>("Hello") >> StrLit<>("World");

With the old code, b is undefined. With the corrected code, b is an alias of a. Also, all line endings are unix-encoded (lf). versus the Mac’s (cr) or Dos(cr-lf). Most Mac and Window’s editors can detect the unix line endings anyway, so for consistency the unix end-line encoding is used.

New header file included in Spirit

June 4, 2001. A new header file <Spirit_Numerics.h> is added to include numeric parsing features used by the micro-parsing capabilites of Spirit.

Micro parser

June 3, 2001. Micro parser functionality as hinted by Vesa Karvonen is already implemented in the Spirit parser framework. Here’s a working code snippet:

int main() {
    int a, b;
    char const* str = "( -123456, 654321 )";
    Scanner<> scanner(str, space);
    bool ok = ('(' >> int_p(a) >> ','
                   >> int_p(b) >> ')').Parse(scanner);
/*... if successful, a and b will hold the parsed numbers */
/* if not, scanner will point to error in the input */

News Flash!

June 1, 2001. Colin McPhail noted that Spirit code compiles “out the box” with the Edinburgh Portable Compilers, the compiler is EC++ 5.3.2 on Windows NT.

Spirit soon to be on SourceForge

June 1, 2001. An application has been sent to SourceForge to set up a Spirit site there, courtesy of Changzhe Han. If all goes well , things should be up and running there sometime in the next few days. We’ll let you know as soon as its “all go” ……

MSVC vanilla

June 1, 2001. Changzhe Han did a couple of modifications to Bruce Florman’s MSVC port to allow it to be compiled and used on vanilla MSVC 6.0. Bruce Florman’s port relied on STLPort to compile and work correctly.

Cleanup time

June 1, 2001. Colin McPhail reported a silly bug in the StrLit<>and NCStrLit<>classes. It was a hectic week for me. The response from people all over the world is overwhelming. Before I embarked on this project, I promised myself to answer all email. Well, I did, but I virtually had no time anymore for coding, much less documenting.

So much to do, so little time

June 1, 2001. I am again asking help from people. Andy Elvey already pledged to be the news editor (this page). Some people volunteered to help in porting and maintaining the code. There’s talk of a ailing list apart from the discussion Boost’s mailing list could be used (as it is at present) for quite advanced discussion of Spirit, whereas a Spirit mailing list would be a good place for beginner / intermediate level discussion. Email me if you want to help push the Spirit project forward.

No more …cpp files

May 30, 2001. Following Bruce Florman’s suggestion, all of the global extern object declarations are now const declarations. Since there are no non-const operations being done on these objects, and since const objects default to internal linkage, doing this eliminates the need for the ..cpp files that were there just to instantiate the objects. So the whole framework is now composed of just header files.

GCC 2.95.2 port by Dan Nuffer

May 30, 2001. Dan noted that “G++ 3.0 [, it] hasn’t been released yet”. Anyway, I’ll upload his changes to the code as soon as I possibly can. BTW, again, please do send in complete project files and make files. This will make it easier for people out there who just want to try Spirit out of the box. Cheers.

Iterators everywhere!

May 30, 2001. Iterators everywhere! OK. So this is the initial release of Spirit with iterators as proposed in boost mailing list. The Kleene star (*, zero or more) and the positive operator (+, one or more) remain as is. In addition, the new iterator syntax generalizes repetitions. We have:

a.Repeat(8);        // repeat a 8 times
a.Repeat(8, 20);    // repeat a 8 to 20 times
a.Repeat(8, more);  // repeat a 8 or more times

And shorthands:

a(8);        // repeat a 8 times
a(8, 20);    // repeat a 8 to 20 times
a(8, more);  // repeat a 8 or more times

One more header file <Spirit_Iterators.h> has been added into the code base. The additional code is non-obtrusive: the client does not pay for this feature if he/she does not intend to use it (true to the spirit of Spirit). The documentation will be updated to reflect these additions. Rule<> toDo = (code >> document)(1, more);

The Spirit “port” of sorts

May 29, 2001. Bruce Florman agreed to release his MSVC port of Spirit. If you find his port useful, please do send him a thank you note or anything if you have some time to spare (through Porting to MSVC which does not support template partial specialization yet is not trivial. The very preliminary version can be downloaded here for those who want to do beta testing.

Also, I am releasing the original Macintosh project file here (this is where it all started). I must confess, I am forever in love with the Mac and CodeWarrior is my primary tool of choice. Please do send in complete project files and make files. This will make it easier for people out there who just want to try Spirit out of the box without much fuss.

Spirit is undergoing major revisions

May 27, 2001. Always download the latest version. Changes to the code will, as much as possible, be downward compatible. The only possible exception to this is the proposal to change the sequencing >> operator, which some consider ugly, to one of: + / % *. Examples:

a >> b;    //  Classic Spirit, arrows denote sequencing
           //  (I still prefer this :-)
a + b;     //  Same as string concatenation. Clashes with
           //  the positive iterator (+)
a / b;     //  Used in unix filepaths and URLs e.g.
           //  root/development/c++/myfile.cpp.
a % b;     //  Eye sore for me but some sayit's
           //  better than >>
a * b;     //  a common substitute in computer languages
           //  for: a b, clashes with the Kleene star (*).

I always keep an open mind. I need your feedback regarding this issue. For now the >> operator stands as is.

Email problems

May 27, 2001. I had some email problems while switching servers. Both and are not valid anymore. If anyone sent me email using this address after Friday, May 27, I’d appreciate it if you could re-send your email to either or

The new iteration syntax is almost final

May 26, 2001. The new iteration syntax is almost final. I am currently busy adding this facility into the framework. Expect this to be included in the code sometime soon. The documentation will be updated in sync with this. Some members of Boost’s mailing list took note of some mistakes in the documentation. In particular, Greg Colvin noted Spirit’s similarities to a prior work of Dr. Damian Conway. And indeed, after reading Dr. Conway’s papers, I realize I have to give credit where credit is due.

I am indebted to the folks at Boost’s mailing list especially Greg Colvin, Larry Evans, John (EBo) David, Douglas Gregor, Ross Smith, David Abrahams, Vladimir Prus, John Max Skaller, Andy Elvey, Reuben Fries, George A. Heintzelman, Vesa Karvonen and many more. These people are very helpful and continue to be instrumental in steering Spririt in the right direction. I learn a lot from these people, especially the theoretical aspects of parsing, that I admittedly have to brush up on (Hey Dragon Book, where art thou…).

News Flash!

May 26, 2001. A Spirit “port” of sorts. I am elated. Bruce Florman [ ] just sent in a working version of Spirit ported to Visual C++ 6.0. Radical! I never thought someone would want to tackle such a port (MSVC does not have template partial specialization yet). Thanks a lot Bruce, I highly appreciate what you have done. Your detailed log is quite something. I should take some time to digest what you just did. I’ll surely learn a lot from this. I’ll upload his port ASAP.

News Flash!

May 26, 2001. Intel compiles as well. Jan Bares [ ] has compiled Spirit on Intel Compiler 5.0 (build 001120) + STLPort 4.0 on Win32.

Exhaustive backtracking parser

May 26, 2001. John Max Skaller noted that Spirit is not really an exhaustive backtracking parser. So we shall take the E and the B, thus we strip that down to LL(inf) RDP. Stay tuned!

News Flash!

May 25, 2001. Spirit has been ported to g++ 3.0 and bcc 5.5.1 thanks to Vladimir Prus. He is currently proposing a very cool automata building library in that could potentially be used to extend Spirit to have many back-ends that can generate more efficient parsers, all “in-place”, such as LALR(1), SLR(1), LR(1), LL(1) and more, in addition to Spirit’s default exhaustive back-tracking recursive descent parsing engine (whew, that was long. I need an acronym for that. EBRDP?). This was first suggested by Douglas Gregor. Way to go Vladimir, now the high priests will be happy 🙂 You may download the documentation and code here but please remember that Spirit is undergoing major changes.

There’s discussion going on at Boost

May 24, 2001. There’s discussion going on at re: Spirit. You may simply view the current mailing list archive at: Better yet, you might be interested to join in and share your thoughts, wish lists and contribute to the future direction of Spirit. Boost is a repository of free, portable, peer-reviewed C++ libraries. It acts as a proving ground for new libraries, particularly those which work well with the ISO C++ Standard Library.

I am in the process of looking for a home for Spirit

May 23, 2001. Some people report difficulties accessing the site. Sorry for the inconveniences that this might have caused. http://isis-tech.n3.netwill be permanent. This URL will redirect to wherever the current host is located. The current host is


May 22, 2001. Help. I’ve got a sudden influx of email requesting for a port to compiler X. As of now, I haven’t compiled Spirit yet with other compilers. I use Metrowerks Code Warrior 5.x. As far as I know, the code is C++ compliant. Yet the code uses modern C++ features such as member templates and template partial specialisations. I would appreciate help if someone out there is interested on porting Spirit to other compilers. I’ll certainly give credit where credit is due.

Comments are closed.

preload preload preload