CodeBox.CodeLexer.TokenList.Consume C# (CSharp) Метод

Consume() публичный Метод

public Consume ( ) : void
Результат void
        public void Consume()
        {
            currentTokenIndex++;
        }

Usage Example

Пример #1
0
        public static void Expect(TokenList tl, TokenType type, string value)
        {
            Token t = tl.Next();

            if ((t.Type == type) && (t.Value == value))
            {
                tl.Consume();
            }
            else
            {
                string expectedType = TokenTypeToString(type);
                string expectedValue = value;
                string foundType = TokenTypeToString(t.Type);
                string foundValue = t.Value;
                ExceptionType exceptionType = (type == TokenType.KEYWORD)
                                                ? ExceptionType.UnknownSymbol
                                                : ExceptionType.Syntax;

                throw new EngineException(exceptionType,
                                          string.Format("Expected '{0}' with Value '{1}' found '{2}' with Value '{3}'", expectedType,
                                                        expectedValue, foundType, foundValue), t);
            }
        }
All Usage Examples Of CodeBox.CodeLexer.TokenList::Consume