8 ms·
I used to entirely use hand-written recursive-descent parsers, until I discovered packrat style parsers. They are crazy fast and so easy to write. Also, the p
by aidenn0 12y ago
I used to entirely use hand-written recursive-descent parsers, until I discovered packrat style parsers. They are crazy fast and so easy to write. Also, the parser generator I use (esrap) lets you fall-back on recursive decent for parsing rules.
- Nitramp 12y agoThey are crazy fast Do you have a link/citation for that? I always thought they were asymptotically linear due to the memoization, so comparable to LL, LALR etc, but in practice much slower due to the overhead compared to those more traditional approaches.
- aidenn0 12y agoFor me, I expect Esrap to end up within a factor of 2-4 of a hand-tuned recursive decent parser on sbcl.