Spirit Applications Repository

This page lists some full applications that use the Spirit parser framework. We invite you to send in your applications for inclusion here. If you wish to contribute, please send an email to: joel-at-boost-consulting-dot-com. The applications listed herein are works of the respective authors. It is the author's responsibility to provide support and maintenance. Should you have any questions, please send the author an email.

Important (Post Skips):

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. See the news in Spirit's home page for details.

Some entries in the repository may not be updated for 1.34 post-skip behavior. If you find such a problem, please contact the author. If you are an author, please find some time to update your application. Thanks!


File Author Info
boolmin Gregor Mitsch
Application that minimizes Boolean functions. You can choose between three input methods. One of them is by formula. Spirit is used to parse and validate the formula the user typed in.
Arabica Jez Higgins
XPath rec parsing support to Arabica; an XML parser toolkit, providing SAX2 and DOM implementations, written in Standard C++.
spirit_sql Andy Elvey
A simple "toy SQL" parser for Spirit. This parser parses a very small subset of SQL: the "select" clause only.
Self Gregory Burd
Self is a prototype-based dynamic object-oriented programming language, environment, and virtual machine centered around the principles of simplicity, uniformity, concreteness, and liveness. It was last developed by the Self Group at Sun Microsystems Laboratories. I believe the concepts behind and the utility of the Self language warrant modernization, further development and researchers. This project uses Spirit for the new language parser as part of the a new Self Virtual Machine implementation. Without Boost Spirit this project wouldn't have gotten off the ground.
Fityk Fityk developers
A curve-fitting program. The Spirit is used for parsing mathematical expressions and Fityk mini-language. http://www.unipress.waw.pl/fityk/
spirit_chess Andy Elvey
A chess parser for Spirit. Should be able to handle any moves using algebraic notation (e.g. Nc5, b2, exf7, f8Q, Rd2 and so on).
c Hartmut Kaiser
The C grammar parser is a full working example of using the Spirit library and is able to parse the full ANSI C language.
mini Thomas Guest
thomas dot guest at ntlworld dot com
The article A Mini-Project to Decode a Mini-Language describes the development of two Spirit applications -- actually variant implementations of the same DVB Codec application. The first directly decodes DVB sections by using Spirit to parse DVB section formats at runtime. The second uses Spirit to parse the section formats at build time -- generating a C++ file which is then built into the actual codec.
wave Hartmut Kaiser
The Wave C++ preprocessor library is a C++ lexer with ISO/ANSI standard conformant preprocessing capabilities. It exposes an iterator interface, which returns the current preprocessed token from the input stream. This preprocessed token is generated on the fly while iterating over the preprocessor iterator sequence.
Ecco Kai Ludwig
The kinetic facilities of Ecco (A Compiler for (Electro-)Chemistry) translates any (electro)chemical reaction mechanism including reversible homogeneous reactions, heterogeneous electron transfers, adsorptions and surface reactions into objects representing species, reactions, rate laws, etc. Physicochemical reaction terms are generated as right hand side of ordinary differential equations or as addition to appropiate transport equations, i.e. Reaction-Diffusion-Migration-Convection ( "Nernst-Planck" )equations. Boundary conditions are assembled. All these terms share a common interface which is designed to be used in simulation studies of chemical and/or electrochemical reaction kinetics.
XEngine Martin Ecker
XEngine is a platform- and rendering-API-independent 3D engine for real- time visualization with support for programmable graphics pipeline architectures and is implemented in C++. The engine aims at flexible support for many of the shading languages available today, so that existing shaders can easily be re-used. This includes current assembler-like languages as well as high-level languages, such as NVIDIA's Cg. In addition, integration of new shading languages should be easily possible with the engine's design.

The Spirit is used in XEngine's shading language parsers.
VariantCalc Nils Springob
This calculator handles algebraic expressions and relations with variables. It supports boolean, float and string values. String values can be added and compared. Relations will result in a boolean value. The expressions are not type bound, so it's possibe to compare or add a string value to a float or boolean value.
dscript Bryan Ross
A C like syntax (what else? :-), Procedural, scripting language that supports both script defined and host environment functions with multi- dimensional arrays, 3 basic types: string, int, and double, dynamically typed variables, Language defined local and global variables. See readme.txt for more info.
quickbook Eric Niebler
Joel de Guzman
QuickBook is Eric Niebler's mod of the QuickDoc tool to generate BoostBook XML instead of HTML. In addition, Eric added a bunch of features to make it integrate well with Doxygen-generated XML. With it, you can author a rich set of cross-linked HTML docs and references with a single text file containing simple mark-up. VERY COOL!

For point of reference, the set of xpressive's docs at http://boost-sandbox.sourceforge.net/libs/xpressive was generated using QuickBook from the file at http://tinyurl.com/6zta5.

cpp_lexer Juan Carlos Arevalo-Baeza
C++ Lexer implemented with Spirit. The lexer is an iterator that iterates over tokens generated on the fly from a text input. It's implementation is done in an opaque manner by means of an abstract interface.
slex Daniel C. Nuffer
This is a simple implementation of a lexer that I did while studying the lexer chapter of the dragon book. It's a rather complicated example of using Spirit to parse regular expressions. It is fully dynamic. You can load up a bunch of regular expressions, compile the DFA and then start lexing, without having to generate a C file in the middle of the process :-)
quickdoc Joel de Guzman
Well, QuickDoc was done over the weekend, thanks to Spirit, which is just over a year old... What is it? QuickDoc is a WikiWiki style documentation tool geared towards C++ documentation using simple rules and markup for simple formatting tasks. QuickDoc extends the Wiki concept. Like the Wiki, QuickDoc documents are simple text files. A single QuickDoc document can generate a fully linked set of nice HTML documents complete with images and syntax-colorized C++ code.
xml Daniel C. Nuffer
Shows, how you may parse XML files with the help of Spirit. The different parsers implement the full XML grammar.
Letrain Antonio Araujo
Letrain (The Letter Train Simulator) Letrain is a train simulator made only with letters. Is an object oriented project writed in C++, for curses terminals with extensive use of stl containers and a little language (using boost Spirit) for map and events description. You can design infinite maps in real time crossing and forking rails automatically while the trains are moving around. You can place sensors and semaphores to programs fork changes and locomotive speeds and directions. The train movement is influenced by the number of wagons pulled or pushed, and it can detect train crashes
json_spirit John Wilkinson
A parser for JSON, http://www.json.org. JSON is a file format similar to XML.
rfc821 Martijn W. van der Lee
This is an example using Spirit to verify RFC821-compliant e-mail addresses.
rfcdate Peter Simons
A parser that will convert date and time specifications as per RFC822 (used in e-mail Date: headers, for example) into a tm structure.
polynomial Andy Elvey, Dan Nuffer
This parser parses a simple polynomial expression ( of the form aX^2 + bX^3 + ... ).
spirit_evaluator Joel Young
David Bergman
spirit_evaluator implements a command line arithmetic expression calculator supporting negation and exponentiation with standard order of operations. Furthermore, it can convert arithmetic expressions from infix notation to textual prefix, postfix, and tree representations. It was developed in g++ 4.1.2 on linux but should build in any boost compatible development environment.
cpp_to_html Joel de Guzman
Stylizes C++ code using HTML. The generated HTML file uses CSS classes to allow flexibility and easy tweaking of color/font schemes.
CliPP Peder Holt
CliPP is a C++ library which enables seamless interoperability between C++ and interpreted languages such as javascript. CliPP allows you to expose classes and functions written in C++ to Javascript with a minimum of extra code, and with a minimal impact on your existing code design.

The CliPP package also contains a complete Javascript Parser written using the Spirit library. The Javascript Parser is an independent part of the package, and can be replaced with another parser (not necessarily a javascript parser) if required.
PlainCalc James W. Walker
PlainCalc is a buttonless, algebraic-entry, mathematical calculator with variables. To use PlainCalc, type an expression or assignment and press Return or Enter. Unlike most calculators I've seen, PlainCalc allows you to indicate multiplication by juxtaposition, e.g., you can write 2πr instead of 2*π*r. It runs on OS 9 (with CarbonLib) and OS X.
pascal Hakki Dogusan
The Pascal parser demonstrates many features of the Spirit Parser. The code is fully working and is able to parse all the test files included.
YAC Angus Leeming
YAC is Yet Another Calculator. It has been written as a vehicle with which to investigate some of the Spirit parser framework's powerful facilities. As such, I've put at least as much effort into the documentation as I put into writing the code. My primary hope is that this documentation will prove useful to those thinking of using closures, lambda functions, lazy functions and the functor parser in their own code.