Spirit and Karma

 

Welcome to the development site for Spirit V2

Spirit is an object oriented recursive descent parser framework implemented using template meta-programming techniques. Expression templates allow us to approximate the syntax of Extended Backus Normal Form (EBNF) completely in C++. Parser objects are composed through operator overloading and the result is a backtracking, top down parser that is capable of parsing rather ambiguous grammars.

Spirit is part of Boost Libraries, a peer-reviewed, open collaborative development effort.

The Spirit framework consists out of different parts:

  • the Qi framework for creating parsers
  • the Karma framwork for creating generators
  • the Lex framework for the integration of tokenizers or lexers into the parser

The Qi framework enables a target grammar to be written exclusively in C++. Inline EBNF grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable.

Karma is the dual library to Spirit. Karma is a library for flexible generation of arbitrary character or token sequences. It's very similar to Spirit in the sense, that it uses a 'grammar' describing the structure of the expected output. It is based on the idea, that a grammar used for parsing of a certain input sequence may well be used to regenerate this input sequence. We use very similar implementation techniques as for Spirit as well, we actually use partially the same code base.

Lex integrates token description, tokenization of character streams and token value management with parsers built using Qi.

The bug tracker

Before submitting a bug report, please check the known bug list and current bug reports.

If you don't have an account, to submit a report you'll need to login as guest, password guest. (Sorry about that, but we've been getting ticket spam.) If you use the guest login, it would be helpful if you could sign your report in case we need more details.

Starting Points

For a complete list of local wiki pages, see TitleIndex.