2 ms·
I believe Pratt, TDOP, and precedence climbing are all just different names for the same technique that involves comparing precedences in a loop. The fact that
by userbinator 4y ago
I believe Pratt, TDOP, and precedence climbing are all just different names for the same technique that involves comparing precedences in a loop. The fact that it's basic principle is so simple is probably what lead to multiple independent reinventions.
If anything, after reading about the aforementioned algorithms, the technique in the article seems to show that using parser combinators is a lot of work for very little gain --- I've read much shorter articles on recursive descent, and those do handle precedence correctly.
- jakear 4y agoWhat is your complaint re precedence in Pratt parsing? The linked code properly implements precedence fairly trivially.
- userbinator 4y agoI think you misunderstood. I'm referring to the original article of this item, not your linked code.
- jakear 4y agoThat’s more a critique of the author than the concept - I gave up midway through the article but order combinators remain a useful tool, particularly as a library. To my eyes, the logic here https://github.com/JacksonKearl/RollDice-Discord/blob/master/src/dice-bot.ts https://github.com/JacksonKearl/RollDice-Discord/blob/master... is much simpler than the equivalent recursive descent code would be. I’d be interested in an article comparing them in greater detail.