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

John Ridgway john at jacelridge.com
Wed Apr 9 15:09:02 PDT 2008


Adam -
One thing you might try is running java -Xm256M org.antlr.tool JavaAST.g

On Apr 9, 2008, at 5:44 PM, Adam Cooney wrote:

> 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.g
> ANTLR Parser Generator  Version 3.1b1 (??)  1989-2007
>
> C:\antlr-3.0b7\lib\Java\project\Grammar>java org.antlr.Tool  
> JavaPrinterTree.g
> ANTLR Parser Generator  Version 3.1b1 (??)  1989-2007
>
> C:\antlr-3.0b7\lib\Java\project\Grammar>javac *.java
> Note: 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 4
> Exception 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.
>
> Get fish-slapping on Messenger Play now!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080409/e39c4c12/attachment.html 


More information about the antlr-interest mailing list