Parser developer andyc highlights mutual recursion in Pratt implementations
6 Nov 1 3:35 PM · 10d ago · 1 comment · 1 source · development 6 of 8
A Lobsters commenter with prior parsing writing emphasizes that both nud() and led() functions typically call back into expression(), making Pratt parsing fundamentally mutually recursive like recursive descent.
“In the opening code snippet, I think a VERY important point is that both `nud()` and `led()` will typically call back into `expression()` (after the Pratt logic dispatches to the right one).”
andyc, Lobsters commenter, parser developer · lobsters ↗Vini Psmaker Blog post author, compiler developerDouglas Crockford Parser theorist (cited)
The whole story postscomments the bright band is this development · numbered dots are the others · click one to jump
What people said 1 voice · verbatim
-
I'm glad to see more explorations of Pratt parsing :-) And thanks for referring to previous writing, including my own! In the opening code snippet, I think a VERY important point is that both `nud()` and `led()` will typically call back into `expression()` (after the Pratt logic dispatches to the right one). There's no getting around that…
All 8 developments of Vini Psmaker argues Pratt parsing tutorials miss the point →
LobstersHacker NewsMastodonNewswires