This project is an exercise to construct parsec like library for C11.
The CPARSEC2 is a parser combinator library for C/C++ language.
Example 1 (using built-in parser) | Example 2 (using parser-combinator) |
---|---|
- Supporting C/C++ standards
-
- C11
- C++17
- Supporting OS/Environments
-
- Msys (MSYS2 on 64bit Windows)
- Mingw (MINGW64 on 64bit Windows)
- Ubuntu 18.04 (including WSL - Windows Subsystem for Linux)
- or else (probably works well but not tested)
- It’s my exercise 😆
- Maybe useful to develop C compiler written in C
- Maybe useful to develop a testing framework for C
- To research more useful usecase of
_Generic
selector of C11 - etc.
To build anything all in the CPARSEC2 project, it is convenient to use
build.sh
- a batch-make shell script.
- Usage
- build.sh [options] [target] …
build.sh [options] [target] ...
run make -C <dir> [options] [target] ...
for
all directory <dir>
in the project where a GNUmakefile
or a Makefile
exists.
To build and test anything all in the project:
# at the top of project directory
./build.sh all test
See also HOW TO BUILD to build/test each subproject individually.
- calc
- A simple calculator
- calcc
- A simple calculator (compiler version)
- excc
- An experimental C compiler subset
- digit3
-
example of user-defined parser
- See also Tutorial / How to make your parser
- digit3b
- example of user-defined parser
- mult
-
example of user-defined parser-class
- See also API / Building block of Parser-class
- extend_cparsec2
-
an example how to add user-defined type
Person
to the CPARSEC2 library.
See tutorials for making your custom parser.
See API Reference contents.