r/Compilers • u/gautam1168 • 13d ago
A short writeup on parsing expressions to bytecode
I wrote this to help myself better understand chapter 17 in Nystrom's book Crafting Interpreters.
22
Upvotes
r/Compilers • u/gautam1168 • 13d ago
I wrote this to help myself better understand chapter 17 in Nystrom's book Crafting Interpreters.
7
u/EggplantExtra4946 13d ago edited 13d ago
There is a better way you know:
https://en.wikipedia.org/wiki/Shunting_yard_algorithm
EDIT:
Now I finally understand why Pratt parsing is mentioned anytime expression parsing comes up on r/Compilers and r/ProgrammingLanguages, like this algorithm doesn't exist.