[antlr-interest] Re: Found a BUG ! (maybe)
rigpa_man
maswann at verizon.net
Fri Mar 19 20:29:52 PST 2004
Thanks for responding, Ter.
I do recall trying charVocab='\003'..'\377' without success. I will
try it again in case my memory is not serving me.
However! It still does not make sense that the generated code would
do an LA(1) for a semi-colon after the semi-colon had already been
matched, especially since the rule did not make explicit mention of
caring about semi-colons after finding the first one. It also makes
no sense to detect a semi-colon in the look-ahead queue if you are
going to turn right around and do a matchNot('\n').
I give much humble prostration to the great ANTLR guru but this time
I think he has a bug.
Your humble servant and student of the divine ANTLR scriptures, ;-)
Mark Swann
--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...>
wrote:
> On Mar 19, 2004, at 4:54 PM, rigpa_man wrote:
>
> > Hi all,
> >
> > I used ANTLR (PCCTS) a few years ago and loved it. I have a use
for
> > it again so I'm picking it up to play with one more time.
>
> welcome back, rigpa_man!
>
> > Here is my problem:
> > (bug appears in both antlr-2.7.2 and antlr-2.7.3rc2)
> >
> > The following lex rule...
> >
> > SCOLN
> > : ';' (~'\n')* '\n'
> > ;
> >
> > ...gets converted to this... (parts removed for brevity)
> >
> > . . .
> > match(';');
> > {
> > _loop6:
> > do {
> > if ((LA(1)==';')) {
> > matchNot('\n');
> > }
> > else {
> > break _loop6;
> > }
> > } while (true);
> > }
> > match('\n');
> > . . .
> >
> > ...which does not work.
>
> This indicates that you have not specified a
charVocab='\003'..'\377'
> option in your lexer to tell it was ~'\n' means. Give that a shot.
>
> Ter
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Cofounder, http://www.jguru.com
> Cofounder, http://www.knowspam.net enjoy email again!
> Cofounder, http://www.peerscope.com pure link sharing
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list