General Tech
Writing about pratt parsing so I remember it
The author, attempting to create a compiler, learned about Pratt parsing, a less commonly taught parsing technique, and implemented it in C, comparing it to the Shunting Yard algorithm. Pratt parsing is mentioned in Crafting Interpreters and Wikipedia, but not in the Dragon Book or typical CS courses. The author found that understanding Pratt parsing required relating it back to the Shunting Yard algorithm. The Shunting Yard algorithm is simpler but less extensible than Pratt parsing, and does not handle subexpressions or new behavior well.
Read the full article at unix.dog →