AjTalk.Compiler.Lexer.NextInteger C# (CSharp) Метод

NextInteger() приватный Метод

private NextInteger ( char firstdigit ) : Token
firstdigit char
Результат Token
        private Token NextInteger(char firstdigit)
        {
            string value = new string(firstdigit, 1);

            int ch;

            ch = this.NextChar();

            while (ch >= 0 && char.IsDigit((char)ch))
            {
                value += (char)ch;
                ch = this.NextChar();
            }

            if (ch == '.')
            {
                int ch2 = this.PeekChar();

                if (ch2 >= 0 && char.IsDigit((char)ch2))
                    return this.NextReal(value + ".");
            }

            if (ch >= 0 && ch == 'r')
            {
                value += (char)ch;

                for (ch = this.NextChar(); ch >= 0 && char.IsLetterOrDigit((char)ch); ch = this.NextChar())
                    value += (char)ch;
            }

            this.PushChar(ch);

            Token token = new Token();
            token.Type = TokenType.Integer;
            token.Value = value;

            return token;
        }