Antlr4.Runtime.UnbufferedTokenStream.Fill C# (CSharp) Method

Fill() protected method

Add n elements to the buffer. Returns the number of tokens actually added to the buffer. If the return value is less than n , then EOF was reached before n tokens could be added.
protected Fill ( int n ) : int
n int
return int
        protected internal virtual int Fill(int n)
        {
            for (int i = 0; i < n; i++)
            {
                if (this.n > 0 && tokens[this.n - 1].Type == TokenConstants.EOF)
                {
                    return i;
                }
                IToken t = TokenSource.NextToken();
                Add(t);
            }
            return n;
        }