[antlr-interest] runtime error running Java 1.5 Grammar on 3.1b1..

Adam Cooney ad_cooney at hotmail.com
Wed Apr 9 14:44:55 PDT 2008


Hi, I've been trying to use John Ridgyway's Improved javaAST grammar and have come across an error when i use it. Just so everythings clear heres the console for everything I did (ie grammars,etc):
 
C:\antlr-3.0b7\lib\Java\project\Grammar>java org.antlr.Tool JavaAST.gANTLR Parser Generator  Version 3.1b1 (??)  1989-2007
 
C:\antlr-3.0b7\lib\Java\project\Grammar>java org.antlr.Tool JavaPrinterTree.gANTLR Parser Generator  Version 3.1b1 (??)  1989-2007
 
C:\antlr-3.0b7\lib\Java\project\Grammar>javac *.javaNote: Some input files use unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.
 
C:\antlr-3.0b7\lib\Java\project\Grammar>java Test Input1b.java!!!!!!!!! memo size is 2, but rule index is 92!!!!!!!!! memo size is 2, but rule index is 91!!!!!!!!! memo size is 2, but rule index is 90!!!!!!!!! memo size is 2, but rule index is 68!!!!!!!!! memo size is 2, but rule index is 41!!!!!!!!! memo size is 2, but rule index is 28!!!!!!!!! memo size is 2, but rule index is 27!!!!!!!!! memo size is 2, but rule index is 25!!!!!!!!! memo size is 2, but rule index is 10!!!!!!!!! memo size is 2, but rule index is 9!!!!!!!!! memo size is 2, but rule index is 5!!!!!!!!! memo size is 2, but rule index is 4Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4        at org.antlr.runtime.BaseRecognizer.memoize(BaseRecognizer.java:806)        at JavaASTParser.typeDeclaration(JavaASTParser.java:1132)        at JavaASTParser.compilationUnit(JavaASTParser.java:674)        at Test.main(Test.java:35)
 
Heres my classpath(incase its useful):
.;C:\antlr-3.0b7\lib\antlr-3.1.jar;C:\antlr-3.0b7\lib\antlr-2.7.7.jar;C:\antlr-3.0b7\lib\stringtemplate-3.0.jar; C:\antlr-3.0b7\lib\stringtemplate-3.1b1.jar; C:\antlr-3.0b7\lib\runtime-3.1.jar;
 
When I upgrade I've kept the same folder since everytime I changed folder it gave errors (hence why the current version is 3.0b7 folder wise). When I upgraded this time to "antlr-2008-04-09.10" I extracted the whole thing, then I extracted each JAR, and copied the org/antlr.. folder that generated into source. Then I copied the new ANTLR over the old one (thats how I upgraded last time and it worked perfectly lol).
But yeah, any ideas at all? I'm assuming its something I've done since as far as I know it works fine for John.
_________________________________________________________________
The next generation of Windows Live is here
http://www.windowslive.co.uk/get-live
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080409/c61ea842/attachment-0001.html 


More information about the antlr-interest mailing list