5 ms·
Ha, nice to see this on HN: this article was pretty helpful to me to understand the concept a few years back when extending my PEG parsing library [1] with a Pr
by zevv 3y ago
Ha, nice to see this on HN: this article was pretty helpful to me to understand the concept a few years back when extending my PEG parsing library [1] with a Pratt parser; this mitigates the problem of PEG parsers not allowing left recursion and allows for a much more concise notation of grammars with operator precedence. Thank you Bob:
1. https://github.com/zevv/npeg#precedence-operators https://github.com/zevv/npeg#precedence-operators
- vidarh 3y agoI love that way of embedding precedence tables without the "classic" repetitive EBNF pattern. I will shamelessly steal this for my next parser library. Also, your documentation is outstanding. (tiny typo - "Pratt" is spelled "Prett" in one sentence on your page)
- kragen 3y agodid you try warth's left-recursion hack for packrat parsers? i'm curious what your experience was with it if so