[antlr-interest] When a comment not a comment

Peterson, Joe joe.peterson at intel.com
Fri Feb 20 12:46:41 PST 2009


This works perfectly.  Thanks!  I don't know why I thought that syntactic predicates didn't work on lexer rules.


COMMENT : '#'
                         (
                              ( 'ABCD')=> 'ABCD'
                            | ~('\r' | '\n')* NEWLINE
                         )
                         { $channel = HIDDEN; }
                      ;



NEWLINE     : '\r' ('\n')? | '\n';



-JEEP


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090220/4dc513bb/attachment.html 


More information about the antlr-interest mailing list