pega-texto
A runtime engine for Parsing Expression Grammars (PEG) in C
pega-texto

A runtime engine for Parsing Expression Grammars (PEG) in pure C, heavily inspired by LPeg.

In pega-texto, PEGs are just Expression arrays, and can be easily combined or rearranged dynamically. You can also provide a single expression (which, for C, is the same as a 1 element array) for simple pattern-matching.

To use the values matched, each Expression may have a user defined Action function that produces a value. Each Action receives as parameter the values produced by Actions executed by inner matched Expressions, reducing them into a single value down the stack.

Build

Using CMake:

$ mkdir build
$ cd build
$ cmake ..
$ make

Package

CPack is configured for packaging pega-texto. From build directory, after building:

$ cpack

By default, it uses the TGZ, STGZ and TZ generators. You may override this with other available generators if you want:

$ cpack -DCPACK_GENERATOR=<generator>

Install

From build directory:

$ make install

Test

From build directory, after building:

$ make test

Documentation

The API is documented using Doxygen and is available at github pages. Also check out the tutorial.

Change log