[antlr-interest] for grammar tail recursion

femto gary femtowin at gmail.com
Wed Apr 4 06:45:03 PDT 2007


Hi all, I'm trying to migrate from antlr 2.7.6 to antlr 3 for XRuby project,
I'm reading the antlr beta book and trying something from book
'compiler construction principles and practice', that's  example 3.7:
(rewritten using antlr's
grammar and make it compact).
slist:s';'slist | ;
s:'s';
//ignore WS rule
but when I try it in antlrWorks, it would tell me the second
alternative is unreachable, and it will misintepret 's;' to
NoViableAltException, (which
should be correct). generating the Lexer/Parser to test is also
not correct. anyone has any ideas about this? Thanks.


More information about the antlr-interest mailing list