问题
Have you used either of these or both? Which do you prefer, and for what reason?
For example, I learned v2 recently and am probably going to stick with it because of the high performance implementation provided by the netbeans team (yeah, I'm stuck with java). In this case would there be any compelling reason to switch?
回答1:
To find what's changed between v2 and v3 check out this link: http://www.antlr.org/wiki/pages/viewpage.action?pageId=719
I should note that we still use 2.7.6 with C++ where I work and we don't really feel the need to upgrade right now.
We did use v3.0 when we did a C# port of our language because we found a few bugs that were fixed in 3.0 and weren't back ported to 2.7.6
To summarize the changes:
- Auto LL(*), no need to specify the lookahead
- Auto-backtracking,
- allows most non-left recursive grammer rules
来源:https://stackoverflow.com/questions/633224/antlr2-vs-antlr3