Re:Super Tiny Compiler
by bluetomcat on Thursday March 31, 2016 @03:38PM
(#11399954)
I wrote a shift-reduce parser for a minimalistic C-like language where the grammar is entirely specified as a static table. The precedence rules are resolved through a "should_shift" function where the parser asks whether it should perform the reduction for a matched rule, or shift one token more:
https://github.com/bbu/simple-interpreter