2013-09-19 20:57:40 +01:00
Micro Parser Combinators
========================
_mpc_ is a lightweight Parser Combinator library for C.
2013-09-23 22:41:58 +01:00
Features
--------
2013-09-19 20:57:40 +01:00
2013-09-23 22:41:58 +01:00
* Full Type Generic Parser Combinator
2013-09-19 20:57:40 +01:00
* Error Message Support
* Regular Expression Support
2013-09-23 22:41:58 +01:00
* Packaged with AST generator
* Easy to including in source
2013-09-19 20:57:40 +01:00
* Written in clean ANSI C
2013-09-23 22:41:58 +01:00
Alternatives
------------
The current main alternative is a branch of (https://github.com/wbhart/Cesium3)[Cesium3].
The main advantages of _mpc_ over this are:
* Works for Generic Types
2013-09-19 20:57:40 +01:00
* Doesn't rely on Boehm-Demers-Weiser Garbage Collection
* Doesn't use `setjmp` and `longjmp` for errors
* Doesn't pollute namespace
Example
-------
```c
2013-09-23 22:41:58 +01:00
2013-09-19 20:57:40 +01:00
```
Parsers
-------
Combinators
-----------
Regular Expressions
-------------------
Combinator Grammars
-------------------
Abstract Syntax Tree
--------------------
2013-09-23 22:41:58 +01:00
If you want to do all the data processing after the parsing stage _mpc_ comes packaged with a basic AST type which makes the grammar declaration much cleaner as you don't have to pass around destructors and fold functions. All these functions reside under `mpca_*` .
This also allows for the use of parser grammars that can be declared directly in C strings similarly to regular expressions.
```c
```
2013-09-19 20:57:40 +01:00
Reference
---------