4 ms·
Yeah but no. That is no longer a recursive descent parser it is a hand written Shift-Reduce parser. Nothing wrong with that just a totally different parsing tec
by timtadh 12y ago
Yeah but no. That is no longer a recursive descent parser it is a hand written Shift-Reduce parser. Nothing wrong with that just a totally different parsing technique. He also covers several other interesting techniques on his blog. However, the "standard" solution is the one given in my comment above. As long as you can transform your grammar in to the correct form. Aho et. al give the fully general algorithm for conversion as I mentioned.
- qznc 12y agoOk, I agree that "standard" is grammar transformation. I'd argue that precedence climbing is "better", which means it provides a bunch of benefits and nearly no downsides in practice.