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

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

                NextSymbolCore();
            }

            return(stringBuilder.ToString());
        }
Exemplo 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();
        }