Efficient Parsing with Boost.Spirit


Details
Special Update: Christmas Comes Early to Utah C++ Programmers!
Microsoft has graciously sponsored our user group with a Visual Studio Ultimate with MSDN Universal Subscription (http://www.visualstudio.com/en-us/products/how-to-buy-vs#Fragment_BuyFromMSHeading), a $13,300 value. Thank you, Microsoft!
This subscription will be raffled off at the end of our meeting. You must be present to win. You must be present at the beginning of the meeting to enter the raffle.
In our regular meeting for this month, Richard Thomson will present an overview of Boost.Spirit 2.5.2 (http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/index.html), a library for producing very efficient recursive-descent parsers using only C++.
Spirit manifests itself as an embedded domain-specific language (https://en.wikipedia.org/wiki/Domain-specific_language#Usage_patterns). Embedded because the DSL is expressed in the syntax of the host language, C++. Domain-specific because the resulting C++ looks very much like a BNF (https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form) grammar and describes the problem of parsing using a natural notation.
This is in contrast to other parser generator tools like lex (https://en.wikipedia.org/wiki/Lex_(software)) and yacc (https://en.wikipedia.org/wiki/Yacc) which use an external file written in a language distinct from C++ that must be preprocessed to generate a source file that is included in your application. The generated source file is generally not human reader friendly.
We'll look at an example parser for the JSON (https://en.wikipedia.org/wiki/JSON) encoding of data and try out the library in a simple parsing exercise.
To participate in the programming exercise, please bring a laptop (or be prepared to pair program) and have the following installed:
• A modern C++ compiler (gcc 4.8, clang 3.4, Visual Studio 2013 or later)
• Boost 1.55 or later


Efficient Parsing with Boost.Spirit