Fw: Re[2]: [antlr-interest] A little trouble with single line comments andEOFs

Alexey Demakov demakov at ispras.ru
Wed Mar 16 01:15:38 PST 2005


Alexey, don't forget to "reply all" to send message in list!
And change, please, your name in message header because cyrillics is unreadably
for many list readers.

Yes, it's just a little trick :) See at generated code - ANTLR check LA(1) automatically.

Regards,
Alexey

-----
Alexey Demakov
TreeDL: Tree Description Language: http://treedl.sourceforge.net
RedVerst Group: http://www.unitesk.com


----- Original Message ----- 
From: "Alexey Sedov" <alexsedow at mail.ru>
To: "Alexey Demakov" <demakov at ispras.ru>
Sent: Wednesday, March 16, 2005 11:57 AM
Subject: Re[2]: [antlr-interest] A little trouble with single line comments andEOFs


> > protected
> > NL : (   {LA(2) == '\n'}? '\r' '\n'
> >        | '\r'
> >        | '\n'
> >      )
> >      { newline(); }
> >    ;
> 
> Is this Right?
> 
> I suppose, should be
> 
> protected
> NL : (   {LA(1) == '\r' && LA(2) == '\n'}? '\r' '\n'
>        | '\r'
>        | '\n'
>      )
>      { newline(); }
>    ;




More information about the antlr-interest mailing list