Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/messer-cpp/messer
REPL for C preprocessor of C++17
https://github.com/messer-cpp/messer
cpp cpp17 cpreprocessor repl
Last synced: 21 days ago
JSON representation
REPL for C preprocessor of C++17
- Host: GitHub
- URL: https://github.com/messer-cpp/messer
- Owner: messer-cpp
- License: mit
- Created: 2019-12-28T13:32:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-26T01:50:24.000Z (11 months ago)
- Last Synced: 2024-02-17T10:36:35.086Z (10 months ago)
- Topics: cpp, cpp17, cpreprocessor, repl
- Language: C++
- Homepage:
- Size: 128 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-c-preprocessor - `messer-cpp/messer` - - REPL for C preprocessor of C++17. (Debuggers)
README
# Messer
Messer is an interactive environment for evaluating C preprocessing macros conforming to C++17 standard with showing macro replacement steps.
## Prerequisites
- You need to install below manually:
- C++17 supported GNU C++ Compiler
- Boost
- Boost.Coroutine2
- Boost.Preprocessor
- `sed`
- `awk`
- `make`
- You can get the following prerequisites as git-submodules:
- Veiler
- Linse## Build
```shell-session
$ make
```It takes **extremely** long time.
For example, it takes 4 minutes to build messer on an AMD Ryzen7 2700X.
It is recommended to take coffee while building.```
...patience...
...patience...
...patience...
```## Usage
You can input programs following the prompt (`>>>`).
`#pragma step tokens` shows macro replacement steps for `tokens`.
You can exit Messer with `C-d`.### Example
```
>>> #define CAT_I(a, b) a ## b
>>> #define ID(x) x
>>> CAT_I(a, ID(b))
aID(b)
>>> #pragma step CAT_I(a, ID(b))
CAT_I(a, ID(b))
-> a ## ID(b)
-> aID(b)
>>> #define CAT(a, b) CAT_I(a, b)
>>> CAT(a, ID(b))
ab
>>> #pragma step CAT(a, ID(b))
CAT(a, ID(b))
-> CAT_I(a, ID(b))
-> CAT_I(a, b)
-> a ## b
-> ab
>>>
```## License
MIT License (see `LICENSE` file)
### License of dependent libraries
see `LICENSES` directory.