[antlr-interest] What are channels and what are they used for?

Terence Parr parrt at cs.usfca.edu
Tue Jun 5 09:01:48 PDT 2007


Hi. :)  token channels are a way to avoid discarding tokens (still  
send tokens to the parser) w/o having the parser see them.  So, you  
could send whitespace on one channel, javadoc on another, and the  
java tokens on the default channel.  Then actions can access the  
hidden channels for translation.

Ter

On Jun 5, 2007, at 6:58 AM, Luke A. Guest wrote:

> On Tue, 2007-06-05 at 13:29 +0200, Johannes Luber wrote:
>> Luke A. Guest wrote:
>>> Hi,
>>>
>>> I think the subject says it all really, I have come across it,  
>>> but don't
>>> know what it's all about? Can anyone enlighten me?
>>
>> The channels are supposed to make tokens invisible so one doesn't  
>> have
>> to deal e.g. with whitespace in the parser. It is possible to access
>> those hidden tokens, but I didn't figure out how to to do that  
>> exactly.
>
> Is that all it's used for? I would've thought there'd be more to it  
> than
> that.
>
> Thanks,
> Luke.
>
>



More information about the antlr-interest mailing list