Re:Lessons from Writing a Compiler
by titzer on Thursday July 14, 2022 @08:30PM
(#32103088)
Just write recursive descent, except for the infix operator precedence, and then use a tiny stack that you either push to or pop from (shift/reduce, ala LR) based on the relative precedence.
Pretty much all compilers that have fast parsers that also give good error messages are hand-written recursive descent.
Pretty much all compilers that have fast parsers that also give good error messages are hand-written recursive descent.