private static bool State9(FsmContext ctx)
 {
     ctx.L.GetChar();
     if (ctx.L.input_char != 0x72)
     {
         return false;
     }
     ctx.NextState = 10;
     return true;
 }
 private static bool State7(FsmContext ctx)
 {
     ctx.L.GetChar();
     if ((ctx.L.input_char >= 0x30) && (ctx.L.input_char <= 0x39))
     {
         ctx.L.string_buffer.Append((char) ctx.L.input_char);
         ctx.NextState = 8;
         return true;
     }
     switch (ctx.L.input_char)
     {
         case 0x2b:
         case 0x2d:
             ctx.L.string_buffer.Append((char) ctx.L.input_char);
             ctx.NextState = 8;
             return true;
     }
     return false;
 }
 private static bool State8(FsmContext ctx)
 {
     while (ctx.L.GetChar())
     {
         if ((ctx.L.input_char >= 0x30) && (ctx.L.input_char <= 0x39))
         {
             ctx.L.string_buffer.Append((char) ctx.L.input_char);
         }
         else
         {
             if ((ctx.L.input_char == 0x20) || ((ctx.L.input_char >= 9) && (ctx.L.input_char <= 13)))
             {
                 ctx.Return = true;
                 ctx.NextState = 1;
                 return true;
             }
             int num = ctx.L.input_char;
             if (((num != 0x2c) && (num != 0x5d)) && (num != 0x7d))
             {
                 return false;
             }
             ctx.L.UngetChar();
             ctx.Return = true;
             ctx.NextState = 1;
             return true;
         }
     }
     return true;
 }
 private static bool State5(FsmContext ctx)
 {
     ctx.L.GetChar();
     if ((ctx.L.input_char >= 0x30) && (ctx.L.input_char <= 0x39))
     {
         ctx.L.string_buffer.Append((char) ctx.L.input_char);
         ctx.NextState = 6;
         return true;
     }
     return false;
 }
 private static bool State6(FsmContext ctx)
 {
     while (ctx.L.GetChar())
     {
         if ((ctx.L.input_char >= 0x30) && (ctx.L.input_char <= 0x39))
         {
             ctx.L.string_buffer.Append((char) ctx.L.input_char);
             continue;
         }
         if ((ctx.L.input_char == 0x20) || ((ctx.L.input_char >= 9) && (ctx.L.input_char <= 13)))
         {
             ctx.Return = true;
             ctx.NextState = 1;
             return true;
         }
         int num = ctx.L.input_char;
         if (num != 0x2c)
         {
             if (num == 0x45)
             {
                 goto Label_00E5;
             }
             if (num != 0x5d)
             {
                 if (num == 0x65)
                 {
                     goto Label_00E5;
                 }
                 if (num != 0x7d)
                 {
                     return false;
                 }
             }
         }
         ctx.L.UngetChar();
         ctx.Return = true;
         ctx.NextState = 1;
         return true;
     Label_00E5:
         ctx.L.string_buffer.Append((char) ctx.L.input_char);
         ctx.NextState = 7;
         return true;
     }
     return true;
 }
 private static bool State28(FsmContext ctx)
 {
     while (ctx.L.GetChar())
     {
         if (ctx.L.input_char != 0x2a)
         {
             if (ctx.L.input_char == 0x2f)
             {
                 ctx.NextState = 1;
                 return true;
             }
             ctx.NextState = 0x1b;
             return true;
         }
     }
     return true;
 }
        private static bool State4(FsmContext ctx)
        {
            ctx.L.GetChar();
            if ((ctx.L.input_char == 0x20) || ((ctx.L.input_char >= 9) && (ctx.L.input_char <= 13)))
            {
                ctx.Return = true;
                ctx.NextState = 1;
                return true;
            }
            int num = ctx.L.input_char;
            switch (num)
            {
                case 0x2c:
                    break;

                case 0x2e:
                    ctx.L.string_buffer.Append((char) ctx.L.input_char);
                    ctx.NextState = 5;
                    return true;

                case 0x45:
                    goto Label_00D9;

                default:
                    if (num != 0x5d)
                    {
                        if (num == 0x65)
                        {
                            goto Label_00D9;
                        }
                        if (num != 0x7d)
                        {
                            return false;
                        }
                    }
                    break;
            }
            ctx.L.UngetChar();
            ctx.Return = true;
            ctx.NextState = 1;
            return true;
        Label_00D9:
            ctx.L.string_buffer.Append((char) ctx.L.input_char);
            ctx.NextState = 7;
            return true;
        }
        private static bool State25(FsmContext ctx)
        {
            ctx.L.GetChar();
            switch (ctx.L.input_char)
            {
                case 0x2a:
                    ctx.NextState = 0x1b;
                    return true;

                case 0x2f:
                    ctx.NextState = 0x1a;
                    return true;
            }
            return false;
        }
 private static bool State26(FsmContext ctx)
 {
     while (ctx.L.GetChar())
     {
         if (ctx.L.input_char == 10)
         {
             ctx.NextState = 1;
             return true;
         }
     }
     return true;
 }
Esempio n. 10
0
        private static bool State23(FsmContext ctx)
        {
            while (ctx.L.GetChar())
            {
                switch (ctx.L.input_char)
                {
                    case 0x27:
                        ctx.L.UngetChar();
                        ctx.Return = true;
                        ctx.NextState = 0x18;
                        return true;

                    case 0x5c:
                        ctx.StateStack = 0x17;
                        ctx.NextState = 0x15;
                        return true;
                }
                ctx.L.string_buffer.Append((char) ctx.L.input_char);
            }
            return true;
        }
Esempio n. 11
0
 private static bool State24(FsmContext ctx)
 {
     ctx.L.GetChar();
     if (ctx.L.input_char != 0x27)
     {
         return false;
     }
     ctx.L.input_char = 0x22;
     ctx.Return = true;
     ctx.NextState = 1;
     return true;
 }
Esempio n. 12
0
 private static bool State22(FsmContext ctx)
 {
     int num = 0;
     int num2 = 0x1000;
     ctx.L.unichar = 0;
     while (ctx.L.GetChar())
     {
         if ((((ctx.L.input_char < 0x30) || (ctx.L.input_char > 0x39)) && ((ctx.L.input_char < 0x41) || (ctx.L.input_char > 70))) && ((ctx.L.input_char < 0x61) || (ctx.L.input_char > 0x66)))
         {
             return false;
         }
         ctx.L.unichar += HexValue(ctx.L.input_char) * num2;
         num++;
         num2 /= 0x10;
         if (num == 4)
         {
             ctx.L.string_buffer.Append(Convert.ToChar(ctx.L.unichar));
             ctx.NextState = ctx.StateStack;
             return true;
         }
     }
     return true;
 }
Esempio n. 13
0
        private static bool State21(FsmContext ctx)
        {
            ctx.L.GetChar();
            int num = ctx.L.input_char;
            switch (num)
            {
                case 110:
                case 0x72:
                case 0x74:
                    break;

                case 0x75:
                    ctx.NextState = 0x16;
                    return true;

                default:
                    if ((((num != 0x22) && (num != 0x27)) && ((num != 0x2f) && (num != 0x5c))) && ((num != 0x62) && (num != 0x66)))
                    {
                        return false;
                    }
                    break;
            }
            ctx.L.string_buffer.Append(ProcessEscChar(ctx.L.input_char));
            ctx.NextState = ctx.StateStack;
            return true;
        }
Esempio n. 14
0
 private static bool State17(FsmContext ctx)
 {
     ctx.L.GetChar();
     if (ctx.L.input_char != 0x6c)
     {
         return false;
     }
     ctx.NextState = 0x12;
     return true;
 }
Esempio n. 15
0
 public Lexer(TextReader reader)
 {
     this.reader = reader;
     this.fsm_context = new FsmContext();
     this.fsm_context.L = this;
 }
Esempio n. 16
0
        private static bool State1(FsmContext ctx)
        {
            while (ctx.L.GetChar())
            {
                if ((ctx.L.input_char == 0x20) || ((ctx.L.input_char >= 9) && (ctx.L.input_char <= 13)))
                {
                    continue;
                }
                if ((ctx.L.input_char >= 0x31) && (ctx.L.input_char <= 0x39))
                {
                    ctx.L.string_buffer.Append((char) ctx.L.input_char);
                    ctx.NextState = 3;
                    return true;
                }
                int num = ctx.L.input_char;
                switch (num)
                {
                    case 0x27:
                        if (ctx.L.allow_single_quoted_strings)
                        {
                            goto Label_01BB;
                        }
                        return false;

                    case 0x2c:
                    case 0x5b:
                    case 0x5d:
                    case 0x7b:
                    case 0x7d:
                        break;

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

                    case 0x2f:
                        if (ctx.L.allow_comments)
                        {
                            goto Label_01EB;
                        }
                        return false;

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

                    default:
                        if (num != 0x22)
                        {
                            if (num != 0x3a)
                            {
                                if (num == 0x66)
                                {
                                    goto Label_018B;
                                }
                                if (num == 110)
                                {
                                    goto Label_0195;
                                }
                                if (num != 0x74)
                                {
                                    return false;
                                }
                                goto Label_019F;
                            }
                        }
                        else
                        {
                            ctx.NextState = 0x13;
                            ctx.Return = true;
                            return true;
                        }
                        break;
                }
                ctx.NextState = 1;
                ctx.Return = true;
                return true;
            Label_018B:
                ctx.NextState = 12;
                return true;
            Label_0195:
                ctx.NextState = 0x10;
                return true;
            Label_019F:
                ctx.NextState = 9;
                return true;
            Label_01BB:
                ctx.L.input_char = 0x22;
                ctx.NextState = 0x17;
                ctx.Return = true;
                return true;
            Label_01EB:
                ctx.NextState = 0x19;
                return true;
            }
            return true;
        }