[antlr-interest] Get tokens in the Hidden channel

Jayani Withanawasam jayaniw at ecollege.com
Tue Sep 6 08:40:22 PDT 2011


Hi all,

 

In my lexer, the comments (single line and multi line) are sent to
hidden channel, thus prevent them from passing to the parser.

 

Here's the related code:

 

COMMENT     :     '--' (~('\r' | '\n'))* NLfrag { $channel = HIDDEN; }
;

 

Is there any way to get these tokens from hidden channel and do some
processing on them?

My target language is C# .Net 2.0 and ANTLR version is 3.1.

 

Appreciate your help on this.

 

Thanks,

Jayani Withanawasam

 



More information about the antlr-interest mailing list