Exemple #1
0
        private static bool State6(FsmContext ctx)
        {
            while (ctx.L.GetChar())
            {
                if (ctx.L.input_char >= 48 && ctx.L.input_char <= 57)
                {
                    ctx.L.string_buffer.Append((char)ctx.L.input_char);
                    continue;
                }
                if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
                {
                    ctx.Return    = true;
                    ctx.NextState = 1;
                    return(true);
                }
                switch (ctx.L.input_char)
                {
                case 44:
                case 93:
                case 125:
                    ctx.L.UngetChar();
                    ctx.Return    = true;
                    ctx.NextState = 1;
                    return(true);

                case 69:
                case 101:
                    ctx.L.string_buffer.Append((char)ctx.L.input_char);
                    ctx.NextState = 7;
                    return(true);

                default:
                    return(false);
                }
            }
            return(true);
        }
Exemple #2
0
        private static bool State1(FsmContext ctx)
        {
            while (ctx.L.GetChar())
            {
                if (ctx.L.input_char == 32 || (ctx.L.input_char >= 9 && ctx.L.input_char <= 13))
                {
                    continue;
                }
                if (ctx.L.input_char >= 49 && ctx.L.input_char <= 57)
                {
                    ctx.L.string_buffer.Append((char)ctx.L.input_char);
                    ctx.NextState = 3;
                    return(true);
                }
                switch (ctx.L.input_char)
                {
                case 34:
                    ctx.NextState = 19;
                    ctx.Return    = true;
                    return(true);

                case 44:
                case 58:
                case 91:
                case 93:
                case 123:
                case 125:
                    ctx.NextState = 1;
                    ctx.Return    = true;
                    return(true);

                case 45:
                    ctx.L.string_buffer.Append((char)ctx.L.input_char);
                    ctx.NextState = 2;
                    return(true);

                case 48:
                    ctx.L.string_buffer.Append((char)ctx.L.input_char);
                    ctx.NextState = 4;
                    return(true);

                case 102:
                    ctx.NextState = 12;
                    return(true);

                case 110:
                    ctx.NextState = 16;
                    return(true);

                case 116:
                    ctx.NextState = 9;
                    return(true);

                case 39:
                    if (!ctx.L.allow_single_quoted_strings)
                    {
                        return(false);
                    }
                    ctx.L.input_char = 34;
                    ctx.NextState    = 23;
                    ctx.Return       = true;
                    return(true);

                case 47:
                    if (!ctx.L.allow_comments)
                    {
                        return(false);
                    }
                    ctx.NextState = 25;
                    return(true);

                default:
                    return(false);
                }
            }
            return(true);
        }