Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Spirit 2.5.2

Joel de Guzman

Hartmut Kaiser

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

Table of Contents

What's New
Spirit V2.5.3
Spirit V2.5.2
Spirit V2.5.1
Spirit V2.5
Spirit V2.4.2
Spirit V2.4.1
Spirit V2.4
Spirit V2.3
Spirit V2.2
Spirit V2.1
Spirit Classic
Syntax Diagram
Parsing Expression Grammar
Attributes of Primitive Components
Attributes of Compound Components
More About Attributes of Compound Components
Attributes of Rules and Grammars
Qi - Writing Parsers
Quick Start
Warming up
Parser Semantic Actions
Complex - Our first complex parser
Sum - adding numbers
Number List - stuffing numbers into a std::vector
Number List Redux - list syntax
Number List Attribute - one more, with style
Roman Numerals
Employee - Parsing into structs
Mini XML - ASTs!
Mini XML - Error Handling
Quick Reference
Common Notation
Qi Parsers
Compound Attribute Rules
Parser Semantic Actions
Parser Concepts
Parser Basics
Parser API
Semantic Actions with Parsers
Auto Parser
Auxiliary Parsers
Binary Parsers
Character Parsers
Parser Directives
Nonterminal Parsers
Numeric Parsers
Parser Operators
Stream Parsers
String Parsers
Karma - Writing Generators
Quick Start
Warming up
Generator Semantic Actions
Complex - A first more complex generator
Complex - Made easier
Complex - Fully Integrated
Number List - Printing Numbers From a std::vector
Matrix of Numbers - Printing Numbers From a Matrix
Quick Reference
Common Notation
Karma Generators
Compound Attribute Rules
Generator Semantic Actions
Generator Concepts
Generator Basics
Generator API
Semantic Actions with Generators
Auto Generator
Auxiliary Generators
Binary Generators
Char Generators
Generator Directives
Nonterminal Generators
Numeric Generators
Generator Operators
Stream Generators
String Generators
Performance Measurements
Performance of Numeric Generators
Lex - Writing Lexical Analyzers
Introduction to Spirit.Lex
Spirit.Lex Tutorials
Spirit.Lex Tutorials Overview
Quickstart 1 - A word counter using Spirit.Lex
Quickstart 2 - A better word counter using Spirit.Lex
Quickstart 3 - Counting Words Using a Parser
Lexer Primitives
Tokenizing Input Data
Lexer Semantic Actions
The Static Lexer Model
Quick Reference
Common Notation
Primitive Lexer Components
Semantic Actions
Supported Regular Expressions
Lexer Concepts
Lexer API
Token definition Primitives
In Depth
Parsers in Depth
Customization of Spirit's Attribute Handling
Determine if a Type Should be Treated as a Container (Qi and Karma)
Determine if a Type Should be Treated as a String (Qi and Karma)
Determine Whether a Component Handles Container Attributes (Qi and Karma)
Transform an Attribute to a Different Type (Qi and Karma)
Store a Parsed Attribute Value (Qi)
Store Parsed Attribute Values into a Container (Qi)
Re-Initialize an Attribute Value before Parsing (Qi)
Extract an Attribute Value to Generate Output (Karma)
Extract From a Container Attribute Value to Generate Output (Karma)
Extract Attribute Values to Generate Output from a Container (Karma)
Extract a C-Style String to Generate Output from a String Type (Karma)
Atomically Extract an Attribute Value from a Container (Karma)
Create Components from Attributes (Qi and Karma)
Supporting Libraries
The multi pass iterator
The line position iterator
The utree data structure
Spirit FAQ
Porting from Spirit 1.8.x
Style Guide
Spirit Repository

This is the documentation of the newest version of Spirit (currently, V2.5.2). If you're looking for the documentation of Spirit's previous version (formerly Spirit V1.8), see Spirit.Classic.

Last revised: December 14, 2015 at 09:09:11 GMT