Re:Pratt parsing is a black box
by direwolf20 on Tuesday November 03, 2026 @06:43PM
(#50359789)
Is this the same algorithm commonly known as "recursive descent" parsing? The array index example is just recursive descent and the expression parsing is recursive descent with abstracted operators instead of a parsing function per precedence level.
[ Parent
| on HN ]
Recursive descent and Pratt are two different but related parsing methods. Pratt is simpler and recursive descent is more explicit, but it's not an "either/or" thing since a parser can use both methods.