Currently im using ANTLR V3.1.1,now i have migrated to ANTLR V3.3. after that i'm getting the following error:
Unexpected exception occur开发者_如何学运维red: java.lang.NoSuchMethodError: org.antlr.runtime.tree.CommonTreeNodeStream.getNodeIndex(Ljava/lang/Object;)I at *.expression.antlr.FocusCommonTreeNodeStream.getNodeIndex(FocusCommonTreeNodeStream.java:16)
Please help me on this issue.. Thanks in advance..!!
Okay, by looking at the comments under your original post, I'll post the answer here for completeness sake, in case people find this Q&A after searching the web.
The reason you get this exception is because you simply replaced the ANTLR jar and did not regenerate a lexer and parser from your grammar. The compiled lexer and parser files that were generated by ANTLR v3.1.1 need the ANTLR v3.1.1 run-time classes. They won't (necessarily) work with other ANTLR run-time versions.
So, if you want to upgrade to ANTLR v3.3, you'll need to re-generate a (new) lexer and parser from your grammar file using the org.antlr.Tool
from ANTLR v3.3.
精彩评论