You've not LPeg but thereis the "re" module where you can write in a
kind of EBNF, I would recomend https://github.com/edubart/lpegrex the
author has done a parser for Lua
https://github.com/edubart/lpegrex/blob/main/parsers/lua.lua and C11
https://github.com/edubart/lpegrex/blob/main/parsers/c11.lua that really
parses real C projects like sqlite3 amalgamation.
For manipulating C structures then there is a somehow pure Luajit
implementation of LPeg https://github.com/sacek/LPegLJ .
An also in pure Lua https://github.com/pygy/LuLPeg .
Then there is tools to analyze/visualize grammars
https://www.bottlecaps.de/rr/ui and https://www.bottlecaps.de/convert/
and it's parser generator https://www.bottlecaps.de/rex/ in several
languages.
For easy iterative testing grammars there is several online playgrounds:
- cpp-peglib https://yhirose.github.io/cpp-peglib/
- peggy https://peggyjs.org/online.html
- pest https://pest.rs/
I'm looking at this lightweight project that's promising too
https://github.com/ChrisHixon/chpeg/ .
Then there is this ones
https://en.wikipedia.org/wiki/Comparison_of_parser_generators