3 ms·
Pratt-parsers is a very underrated style of parsing. Years ago when I was at Mozilla we built PrattParser utils in JS: https://github.com/taskcluster/json-e/bl
by jopsen 6y ago
Pratt-parsers is a very underrated style of parsing.
Years ago when I was at Mozilla we built PrattParser utils in JS:
https://github.com/taskcluster/json-e/blob/386ae415d807eb066a603007253fd9d316dadc1b/src/interpreter.js#L317 https://github.com/taskcluster/json-e/blob/386ae415d807eb066...
It probably had short comings, because it's been rewritten since (I haven't kept up).
But with a few rules and simple functions a pratt parser is rather intuitive, and easy to write and port to other languages.
I'd be very curious to see the next article :)