[antlr-interest] Problem using the Java 1.5 grammar available in antlr site

luciano mantuaneli mantu_lists at yahoo.com.br
Thu Sep 21 07:59:29 PDT 2006


Greetings!
I tried to use the Java 1.5 grammar available at antlr site (The grammar under the
"Java 1.5 + Java preprocessor" option in the grammar page), but i had an odd problem: The parser generated seems to just don't recognize java source!!!
I tried to submit the content of this simple .java file, but the Lexer generated by the mentioned grammar(JavaLexer class) throws the following exception stack trace:

 Character.isLetter(LA(1))
    at antlr.metrics.parsers.java.tiger.JavaLexer.nextToken(JavaLexer.java:382)
    at antlr.TokenBuffer.fill(TokenBuffer.java:69)
    at antlr.TokenBuffer.LA(TokenBuffer.java:80)
    at antlr.LLkParser.LA(LLkParser.java:52)
    at antlr.metrics.parsers.java.tiger.JavaRecognizer.compilationUnit(JavaRecognizer.java:296)
    at antlr.metrics.parsers.java.tiger.Test.getTree(Test.java:51)
    at antlr.metrics.parsers.java.tiger.Test.main(Test.java:64)

All content under antlr.metrics package is of my authoring. The gramar file and the genereted classes are in the antlr.metrics.parsers.java.tiger package

What is going on here?  Why the Lexer throws that exception? am I doing something wrong?

Here you can find my java program files

My best regards!
Mantu


 		
---------------------------------
 Yahoo! Search
 Música para ver e ouvir: You're Beautiful, do James Blunt
 		
---------------------------------
 O Yahoo! está de cara nova. Venha conferir!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060921/23193473/attachment.html 


More information about the antlr-interest mailing list