News for hackers. Stuff that matters.
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.
Re:Pratt parsing is a black box by YuechenLi on Tuesday November 03, 2026 @06:53PM (#50359873)
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.
Re:Pratt parsing is a black box by ogogmad on Wednesday November 04, 2026 @12:34PM (#50368849)
Pratt is a combination of recursive descent and precedence-climbing. Maybe even the combination? Those ideas are individually older than Pratt.