Exemplo n.º 1
0
 private int Scan()
 {
     while (true)
     {
         bool flag = false;
         this._state = this._currentStart;
         while (this.NextState() == this._state)
         {
             this.GetChr();
         }
         this.MarkToken();
         while (true)
         {
             int num  = this.NextState();
             int num1 = num;
             if (num == this._currentStart)
             {
                 break;
             }
             if (!flag || num1 <= 22)
             {
                 this._state = num1;
                 this.GetChr();
                 if (this._state <= 22)
                 {
                     flag = true;
                 }
             }
             else
             {
                 Scanner.Context context = new Scanner.Context();
                 Scanner.Result  result  = this.Recurse2(context, num1);
                 if (result != Scanner.Result.noMatch)
                 {
                     break;
                 }
                 this.RestoreStateAndPos(context);
                 break;
             }
         }
         if (this._state <= 22)
         {
             this.MarkEnd();
             int num2 = this._state;
             if (num2 == 0)
             {
                 return(2);
             }
             else if (num2 == 1)
             {
                 continue;
             }
             else if (num2 == 2)
             {
                 return(29);
             }
             else if (num2 == 3 || num2 == 12 || num2 == 13 || num2 == 15)
             {
                 this.yyerror("Illegal input", new object[0]);
                 continue;
             }
             else if (num2 == 4)
             {
                 return(13);
             }
             else if (num2 == 5)
             {
                 return(14);
             }
             else if (num2 == 6)
             {
                 return(15);
             }
             else if (num2 == 7)
             {
                 return(16);
             }
             else if (num2 == 8)
             {
                 return(17);
             }
             else if (num2 == 9)
             {
                 return(18);
             }
             else if (num2 == 10)
             {
                 return(19);
             }
             else if (num2 == 11)
             {
                 return(20);
             }
             else if (num2 == 14)
             {
                 this.yylval.StringValue = this.Yytext;
                 string lower = this.Yytext.ToLower(CultureInfo.InvariantCulture);
                 string str   = lower;
                 if (lower != null)
                 {
                     if (str == "issue")
                     {
                         return(5);
                     }
                     else
                     {
                         if (str == "type")
                         {
                             return(8);
                         }
                         else
                         {
                             if (str == "value")
                             {
                                 return(9);
                             }
                             else
                             {
                                 if (str == "valuetype")
                                 {
                                     return(10);
                                 }
                                 else
                                 {
                                     if (str == "claim")
                                     {
                                         return(12);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 return(3);
             }
             else if (num2 == 16)
             {
                 this.yylval.StringValue = this.Yytext;
                 string lower1 = this.Yytext.ToLower(CultureInfo.InvariantCulture);
                 string str1   = lower1;
                 if (lower1 != null)
                 {
                     if (str1 == "\"int64\"")
                     {
                         return(21);
                     }
                     else
                     {
                         if (str1 == "\"uint64\"")
                         {
                             return(22);
                         }
                         else
                         {
                             if (str1 == "\"string\"")
                             {
                                 return(23);
                             }
                             else
                             {
                                 if (str1 == "\"boolean\"")
                                 {
                                     return(24);
                                 }
                             }
                         }
                     }
                 }
                 return(4);
             }
             else if (num2 == 17)
             {
                 return(30);
             }
             else if (num2 == 18)
             {
                 return(26);
             }
             else if (num2 == 19)
             {
                 return(28);
             }
             else if (num2 == 20)
             {
                 return(25);
             }
             else if (num2 == 21)
             {
                 return(7);
             }
             else if (num2 == 22)
             {
                 break;
             }
         }
         else
         {
             this._state = this._currentStart;
         }
     }
     return(27);
 }
Exemplo n.º 2
0
        private int Scan()
        {
            int result2;

            try
            {
                for (;;)
                {
                    bool flag = false;
                    this.state = this.currentStart;
                    while (this.NextState() == this.state)
                    {
                        this.GetChr();
                    }
                    this.MarkToken();
                    int num;
                    while ((num = this.NextState()) != this.currentStart)
                    {
                        if (flag && num > 40)
                        {
                            Scanner.Context ctx    = new Scanner.Context();
                            Scanner.Result  result = this.Recurse2(ctx, num);
                            if (result == Scanner.Result.noMatch)
                            {
                                this.RestoreStateAndPos(ctx);
                                break;
                            }
                            break;
                        }
                        else
                        {
                            this.state = num;
                            this.GetChr();
                            if (this.state <= 40)
                            {
                                flag = true;
                            }
                        }
                    }
                    if (this.state > 40)
                    {
                        this.state = this.currentStart;
                    }
                    else
                    {
                        this.MarkEnd();
                        switch (this.state)
                        {
                        case 0:
                            goto IL_154;

                        case 1:
                        case 7:
                            goto IL_15C;

                        case 2:
                        case 11:
                        case 12:
                            goto IL_162;

                        case 3:
                            goto IL_167;

                        case 4:
                            goto IL_16C;

                        case 5:
                            goto IL_172;

                        case 6:
                            goto IL_178;

                        case 8:
                            goto IL_17E;

                        case 9:
                        case 10:
                            goto IL_183;

                        case 13:
                        case 14:
                        case 15:
                        case 16:
                        case 17:
                        case 18:
                        case 19:
                        case 20:
                        case 24:
                        case 26:
                        case 27:
                        case 28:
                        case 34:
                        case 35:
                            goto IL_188;

                        case 21:
                            goto IL_18E;

                        case 22:
                            goto IL_194;

                        case 23:
                            goto IL_19A;

                        case 25:
                            goto IL_1A0;

                        case 29:
                            goto IL_1A6;

                        case 30:
                            goto IL_1AC;

                        case 31:
                            goto IL_1B2;

                        case 32:
                            goto IL_1B8;

                        case 33:
                            goto IL_1BE;

                        case 36:
                            goto IL_1C4;

                        case 37:
                            goto IL_1CA;

                        case 38:
                        case 39:
                            goto IL_1D0;

                        case 40:
                            goto IL_1D5;
                        }
                    }
                }
IL_154:
                return(2);

IL_15C:
                return(22);

IL_162:
                return(6);

IL_167:
                return(3);

IL_16C:
                return(9);

IL_172:
                return(10);

IL_178:
                return(24);

IL_17E:
                return(7);

IL_183:
                return(8);

IL_188:
                return(22);

IL_18E:
                return(12);

IL_194:
                return(11);

IL_19A:
                return(14);

IL_1A0:
                return(19);

IL_1A6:
                return(21);

IL_1AC:
                return(17);

IL_1B2:
                return(15);

IL_1B8:
                return(18);

IL_1BE:
                return(16);

IL_1C4:
                return(20);

IL_1CA:
                return(13);

IL_1D0:
                return(5);

IL_1D5:
                result2 = 4;
            }
            finally
            {
                this.LoadYylval();
            }
            return(result2);
        }