Antlr4.Runtime.BufferedTokenStream.GetHiddenTokensToRight C# (CSharp) Method

GetHiddenTokensToRight() public method

Collect all tokens on specified channel to the right of the current token up until we see a token on Lexer.DefaultTokenChannel or EOF. If channel is -1 , find any non default channel token.
public GetHiddenTokensToRight ( int tokenIndex, int channel ) : IList
tokenIndex int
channel int
return IList
        public virtual IList<IToken> GetHiddenTokensToRight(int tokenIndex, int channel)
        {
            LazyInit();
            if (tokenIndex < 0 || tokenIndex >= tokens.Count)
            {
                throw new ArgumentOutOfRangeException(tokenIndex + " not in 0.." + (tokens.Count - 1));
            }
            int nextOnChannel = NextTokenOnChannel(tokenIndex + 1, Lexer.DefaultTokenChannel);
            int to;
            int from = tokenIndex + 1;
            // if none onchannel to right, nextOnChannel=-1 so set to = last token
            if (nextOnChannel == -1)
            {
                to = Size - 1;
            }
            else
            {
                to = nextOnChannel;
            }
            return FilterForChannel(from, to, channel);
        }

Same methods

BufferedTokenStream::GetHiddenTokensToRight ( int tokenIndex ) : IList