3 ms·
Well, I had the same epiphany 5 years ago, and I implemented it in a C++ library here: https://github.com/axilmar/parserlib https://github.com/axilmar/parserli
by axilmar 7y ago
Well, I had the same epiphany 5 years ago, and I implemented it in a C++ library here:
https://github.com/axilmar/parserlib https://github.com/axilmar/parserlib
It's nice to be able to handle left-recursive grammars in a PEG parser. It feels liberating. Although I never used it to write my dream programming language :-).
Note that the same thing can be done via a stack of alternate parsers: when the recursive parser is on top of the stack, then the one below it shall be chosen.