3 ms·
Interesting, thanks for the feedback. It seems like the lesson is analogous to what I learned from Crockford's JavaScript parser. That is, regardless of wheth
by chubot 9y ago
Interesting, thanks for the feedback. It seems like the lesson is analogous to what I learned from Crockford's JavaScript parser.
That is, regardless of whether you're doing it top-down or bottom-up, using an
operator precedence algorithm for statements is painful.
I think the reason is simply that there is a fundamental relationship between the language you are parsing (the data) the algorithm you choose to parse it with (the code). Those 2 things are tightly linked.
I think this isn't emphasized enough in introductory texts. They usually only have time to teach one parsing method, and the language being parsed is chosen to fit that. Or maybe you choose one problem like shift-reduce conflicts, but you don't get the comparison / contrast to other methods.