[antlr-interest] ANTLR 3 & hidden token management?

Kay Roepke kroepke at classdump.org
Sun Aug 6 18:40:15 PDT 2006


On 7. Aug 2006, at 3:10 Uhr, Prashant Deva wrote:

> A newcomer looking at a grammar would get really confused when he sees
> channel=99.
> even something like channel=hidden would convey more information.

I forgot to add:

Channel 99 really doesn't mean anything beyond that this token is not  
on the default channel. So calling that channel "hidden" would
plainly be wrong if someone made a TokenStream subclass that did not  
filter tokens according to the original implementation.
Heck, people could even use the channelOverrideMap in the default  
implementation, changing the discard behavior.
FWIW, the whitespace channel could also be 42 or 666. Or the  
TokenStream subclass could implement some more complex algorithm to  
decide
whether or not to hide a token from the parser.

-k
-- 
Kay Röpke <kroepke at classdump.org>
classdump Software




More information about the antlr-interest mailing list