Skip to content

CPARSEC3 - a parser-combinator library for C11, 3rd generation.

License

Notifications You must be signed in to change notification settings

mori0091/cparsec3

Repository files navigation

CPARSEC3 - a parser combinator library for C language

https://img.shields.io/codacy/grade/52aa85279ec5451b94fec5924651362f.svg?logo=codacy https://circleci.com/gh/mori0091/cparsec3.svg?style=shield https://codecov.io/gh/mori0091/cparsec3/branch/master/graph/badge.svg

Feature

  • Generics - Generic programming for C11
    • Generic Data Types
    • Traits
    • Generic Macros
  • Parsec - parsers and parser combinators
    • Stream
    • Parser
    • Parser combinator
    • Parser invocation (applying a parser to input stream)

How to build

See build-instruction contents for the below:

  • How to build
  • Directory structure of source tree

Sample Applications

Here is a sample application powered by CPARSEC3.

pug-lang
The Pug programming language interpreter.
That is one of the best usecase of CPARSEC3 Parsec library.
VM
A Virtual Machine based on the lazy Krivine machine.
That is also a usecase of CPARSEC3 Base library.

API references

The CPARSEC3 library consists of the following portions:

Base library
CPARSEC3 Base library provides basic functionality of general purpose Generic Data Types, Traits, and Generic Macros.
  • Generic Data Types : Array(T), List(T), Maybe(T), and so on.
  • Traits : Eq(T), Ord(T), and so on.
  • Generic Macros : g_array(T, ...), g_eq(a, b), g_itr(c), and so on.
Parsec library
CPARSEC3 Parsec library provides functionality of parser-combinators.
  • Stream
  • Built-in parsers
  • Built-in parser combinators
  • Parser invocation APIs
Misc.
Other miscellernious APIs
  • TYPESET macro
  • Primitive types