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
Arabica Jez Higgins
jez-at-jezuk.co.uk
XPath rec parsing support to Arabica; an XML parser toolkit, providing SAX2 and DOM implementations, written in Standard C++.
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.
Ecco Kai Ludwig
kml-at-users-sourceforge.net
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.
Fityk Fityk developers
http://www.unipress.waw.pl/fityk/
A curve-fitting program. The Spirit is used for parsing mathematical expressions and Fityk mini-language. http://www.unipress.waw.pl/fityk/
Letrain Antonio Araujo
antoniovazquezaraujo-at-gmail-dot-com
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
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.
Self Gregory Burd
http://ossus.com/~gburd
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.
VariantCalc Nils Springob
nils-at-crazy-idea-de
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.
XEngine Martin Ecker
ecker-at-liwest-dot-at
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.
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.
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.
c Hartmut Kaiser
hartmut.kaiser-at-gmail-dot-com
The C grammar parser is a full working example of using the Spirit library and is able to parse the full ANSI C language.
cpp_lexer Juan Carlos Arevalo-Baeza
jcab-at-jcabs-Rumblings-dot-com
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.
cpp_to_html Joel de Guzman
joel-at-boost-consulting-dot-com
Stylizes C++ code using HTML. The generated HTML file uses CSS classes to allow flexibility and easy tweaking of color/font schemes.
dscript Bryan Ross
daerid-at-gmail-dot-com
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.
json_spirit John Wilkinson
john-dot-wilk161c5-at-googlemail-dot-com
A parser for JSON, http://www.json.org. JSON is a file format similar to XML.
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.
pascal Hakki Dogusan
dogusanh-at-tr-dot-net
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.
polynomial Andy Elvey, Dan Nuffer
andy-dot-elvey-at-paradise-dot-net-dot-nz
dan-at-nuffer-dot-org
This parser parses a simple polynomial expression ( of the form aX^2 + bX^3 + ... ).
quickbook Eric Niebler
eric-at-boost-consulting-dot-com
Joel de Guzman
joel-at-boost-consulting-dot-com
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.

quickdoc Joel de Guzman
joel-at-boost-consulting-dot-com
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.
rfc821 Martijn W. van der Lee
martijn-at-v-d-l.com
This is an example using Spirit to verify RFC821-compliant e-mail addresses.
rfcdate Peter Simons
simons-at-computer-dot-org
A parser that will convert date and time specifications as per RFC822 (used in e-mail Date: headers, for example) into a tm structure.
slex Daniel C. Nuffer
dan-at-nuffer-dot-org
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 :-)
spirit_chess Andy Elvey
andy-dot-elvey-at-paradise-dot-net-dot-nz
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).
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.
spirit_sql Andy Elvey
andy-dot-elvey-at-paradise-dot-net-dot-nz
A simple "toy SQL" parser for Spirit. This parser parses a very small subset of SQL: the "select" clause only.
wave Hartmut Kaiser
hartmut.kaiser-at-gmail-dot-com
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.
xml Daniel C. Nuffer
dan-at-nuffer-dot-org
Shows, how you may parse XML files with the help of Spirit. The different parsers implement the full XML grammar.