Exemple #1
0
        /// <summary> returns the lexer that's gonna parse a decimal number (valid patterns are: 1, 2.3, 000, 0., .23),
        /// and convert the string to a TokenDecimal.
        /// </summary>
        /// <returns> the lexer.
        /// </returns>
        public static Lexer LexDecimal()
        {
            string name = "decimal literal";

            return(Lex(Scanners.Delimited(
                           Scanners.IsPattern(name, Patterns.IsDecimal(), "decimal number")),
                       Tokenizers.ForDecimal).Rename(name));
        }