[antlr-interest] "Actions, however, can ask for the hidden channel tokens."

Terence Parr parrt at cs.usfca.edu
Mon Mar 17 09:15:20 PDT 2008


the token stream has a buffer of all tokens on all channels.  if your  
token is t, then i=t.getTokenIndex() or whatever will give you an  
index. Then look at tokensStream.get(i-1) and -2 etc... to see if  
their t.getChannel() is hidden.
Ter
On Mar 17, 2008, at 8:52 AM, Martin Probst wrote:

> Hi,
>
> the online documentation at:
>
> http://www.antlr.org/wiki/display/ANTLR3/Grammars#Grammars-Lexerrules
>
> Mentions: "Actions, however, can ask for the hidden channel tokens.".
>
> But I cannot find any documentation on _how_ exactly rules can ask  
> for the hidden tokens. Any pointers?
>
> Thanks in advance,
> Martin



More information about the antlr-interest mailing list