[antlr-interest] When a comment not a comment

Michael Bedward michael.bedward at gmail.com
Thu Feb 19 18:52:29 PST 2009


2009/2/20 Jim Idle wrote:
> COMMENT : '#'
>                          (
>                               ( 'ABCD')=> 'ABCD'
>                             | ~('\r' | '\n')* NEWLINE
>                          )
>                          { $channel = HIDDEN; }
>                       ;
>
> NEWLINE     : '\r' ('\n')? | '\n';
>

Mmmm... I tried that one after seeing Joe's previous message, but
doesn't it have the same problem ?  ie. it will eats a line:
    #ABCD foo
...as a comment ?  Does for me in ANTLRWorks.  I must be missing something...

cheers
Michael


More information about the antlr-interest mailing list