Esempio n. 1
0
        private string GetNumberString()
        {
            var stringBuilder = new StringBuilder();

            while (CurrentSymbol.IsDigitOrDecimalPoint())
            {
                stringBuilder.Append(CurrentSymbol);

                NextSymbolCore();
            }

            return(stringBuilder.ToString());
        }
Esempio n. 2
0
        protected override void NextTokenCore()
        {
            if (CurrentSymbol.IsDigitOrDecimalPoint())
            {
                var numberString = GetNumberString();

                var number = double.Parse(numberString, CultureInfo.InvariantCulture);

                CurrentToken = new Token(numberString.ToCharArray(), number);

                return;
            }

            CurrentToken = new Token(new[] { CurrentSymbol });

            NextSymbolCore();
        }