The most common stream of tokens where every token is buffered up
and tokens are filtered for a certain channel (the parser will only
see these tokens).
Even though it buffers all of the tokens, this token stream pulls tokens
from the tokens source on demand. In other words, until you ask for a
token using consume(), LT(), etc. the stream does not pull from the lexer.
The only difference between this stream and BufferedTokenStream superclass
is that this stream knows how to ignore off channel tokens. There may be
a performance advantage to using the superclass if you don't pass
whitespace and comments etc. to the parser on a hidden channel (i.e.,
you set $channel instead of calling skip() in lexer rules.)
Skip tokens on any channel but this one; this is how we skip whitespace...
Always leave p on an on-channel token.
if ( k==0 || (p-k)<0 ) return null;
if ( k == 0 ) return null;
if ( k < 0 ) return LB(-k);
Given a starting index, return the index of the first on-channel
Reset this token stream by setting its token source.