[antlr-interest] [3.0b4] StackOverflowError report
Robert Baruch
autophile at zoominternet.net
Tue Oct 24 10:15:57 PDT 2006
Hi all,
I have found a grammar which, although admittedly ridiculous,
nevertheless passes through ANTLR but throws a StackOverflowError
when parsing anything (in this case, the sentence "nn").
Is there something wrong with the grammar? ANTLR?
Thanks,
--Rob
grammar TestParser;
options { superClass = GeneratedParser; }
@parser::header {
import grammatotron.*; }
start : r0 EOF ;
r0 : r1 r0 ;
r1 : N ;
N : 'n';
V : 'v';
Exception in thread "main" java.lang.StackOverflowError
at org.antlr.runtime.BaseRecognizer.combineFollows
(BaseRecognizer.java:388)
at org.antlr.runtime.BaseRecognizer.computeContextSensitiveRuleFOLLOW
(BaseRecognizer.java:376)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedElement
(BaseRecognizer.java:478)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken
(BaseRecognizer.java:445)
at org.antlr.runtime.BaseRecognizer.mismatch(BaseRecognizer.java:98)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:80)
at TestParser.r1(TestParser.java:92)
at TestParser.r0(TestParser.java:63)
at TestParser.r0(TestParser.java:67)
at TestParser.r0(TestParser.java:67)
at TestParser.r0(TestParser.java:67)
at TestParser.r0(TestParser.java:67)
at TestParser.r0(TestParser.java:67)
(etc)
--Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061024/65cc6ad9/attachment.html
More information about the antlr-interest
mailing list