Hacker News new | past | comments | ask | show | jobs | submit login

Debugging a complex PEG is a nightmarish task. I use various tools, but I couldn't find anything out there that will let you set a breakpoint in a file that's being parsed and let you explore the parsing state.

The most useful tools I found were adjacent to the cpp-peglib library: https://github.com/yhirose/cpp-peglib

This comes with a PEG playground: https://yhirose.github.io/cpp-peglib/

I really liked pegdebug: https://mqnc.github.io/pegdebug/

With sample output here: https://mqnc.github.io/pegdebug/example/output.html

pegdebug is nice for small sets of data, but it rapidly gets swamped by anything over about 50 lines.

If anyone has other suggestions for debugging PEGs, please reply and let me know,.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: