[antlr-interest] Need pointers for getting comment statements in trees produced by v3 grammer files

The Researcher researcher0x00 at gmail.com
Mon Apr 11 09:31:37 PDT 2011


> Hi Ankit,


If I understand the question correctly,
then have you tried removing {$channel=HIDDEN;} from the lexer rule?

i.e.
LINE_COMMENT
   :   '//' ~('\n' | '\r')* '\r'? '\n' {$channel=HIDDEN;}
   ;

should be

 LINE_COMMENT
   :   '//' ~('\n' | '\r')* '\r'? '\n'
   ;

Eric


More information about the antlr-interest mailing list