3 ms·
That's one way to hack it. Another way to hack it is to write an ambiguous grammar, but annotate the productions with precedences to tell your LALR parser gener
by kragen 16y ago
That's one way to hack it. Another way to hack it is to write an ambiguous grammar, but annotate the productions with precedences to tell your LALR parser generator how to resolve the ambiguities. And of course you can do what apenwarr suggests — parse with a grammar that is unambiguous but assigns the wrong precedence, and then rewrite the parse tree once it's built.