PEGTL 0.32

A parsing expression grammar template library
PEGTL (The Parsing Expression Grammar Template Library) is a C++0x library that allows for creating parsers according to a PEG (Parsing Expression Grammar).

Grammars are embedded as regular C++ code, created with template programming (not template meta programming).

These hierarchies naturally correspond to the inductive definition of PEGs. The library extends on the subject of PEGs with new expression types, actions that can be attached to grammar rules, and mechanisms to ensure helpful diagnostics in case of parsing errors.

PEGs are superficially similar to Context-Free Grammars (CFGs); for a description see Wikipedia page on PEGs or this paper on PEGs by Bryan Ford.

Detailed instructions on how to install and use the PEGTL utility on your Mac are available HERE.

Main features:

  • Comprehensive set of parsing rules.
  • Grammars and actions embedded in C++.
  • C++ compiler-optimised parsing grammars.
  • Some generic actions, like sub-expression capturing.
  • Some trivial automatic optimisations, to be extended.
  • Diagnostics with readable printing of grammar rules.
  • Examples that show how to use the features of the library.
  • User-defined input abstractions, supplied:
  • files via mmap(2),
  • strings (and files via strings),
  • ranges of forward iterators, and
  • input iterators w/automatic minimal buffering.
  • User-defined debug abstractions, supplied:
  • 'full speed, bool result',
  • 'less speed, readable error messages',
  • 'try full-speed, re-parse w/less-speed on error',
  • plus optionally full trace of all invoked rules.
  • User-defined logging abstractions, supplied:
  • simple logging to std::cerr.

last updated on:
January 12th, 2013, 13:19 GMT
file size:
41 KB
license type:
MIT License 
developed by:
Colin Hirsch
operating system(s):
Mac OS X
binary format:
Home \ Development \ Libraries
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!
What's New in This Release:
  • Removed superfluous includes ( issue 5 ).
  • Fixed bug in not_at rule regarding wrong propagation of errors ( issue 3 ).
read full changelog

Add your review!