Ancestry.QueryProcessor.Parse.Lexer.NextToken C# (CSharp) Method

NextToken() public method

Advances the current token.
public NextToken ( ) : LexerToken
return LexerToken
        public LexerToken NextToken()
        {
            ReadNext(_currentIndex);
            _currentIndex = (_currentIndex + 1) % LookAheadCount;
            LexerToken token = _tokens[_currentIndex];
            if (token.Type == TokenType.EOF)
                throw new LexerException(LexerException.Codes.UnexpectedEOF);
            if (token.Type == TokenType.Error)
                throw token.Error;
            return token;
        }