Beispiel #1
0
        public bool MoveNext()
        {
            int la0, la1;

            // Line 161: ([\t ])*
            for (;;)
            {
                la0 = Src.LA0;
                if (la0 == '\t' || la0 == ' ')
                {
                    Src.Skip();
                }
                else
                {
                    break;
                }
            }
            _tok.StartIndex = Src.InputPosition;
            _tok.Value      = null;
            // Line 164: ( (Num | Id | [.] [n] [a] [n] | [.] [i] [n] [f]) | ([>] [>] / [<] [<] / [=] / [>] / [<] / [\^] / [*] / [/] / [+] / [\-] / [;] / [(] / [)]) )
            do
            {
                la0 = Src.LA0;
                switch (la0)
                {
                case '.':
                {
                    la1 = Src.LA(1);
                    if (la1 >= '0' && la1 <= '9')
                    {
                        goto matchNum;
                    }
                    else if (la1 == 'n')
                    {
                                                        #line 166 "Grammars.ecs"
                        _tok.Type = TT.Num;
                                                        #line default
                        Src.Skip();
                        Src.Skip();
                        Src.Match('a');
                        Src.Match('n');
                                                        #line 166 "Grammars.ecs"
                        _tok.Value = double.NaN;
                                                        #line default
                    }
                    else if (la1 == 'i')
                    {
                                                        #line 167 "Grammars.ecs"
                        _tok.Type = TT.Num;
                                                        #line default
                        Src.Skip();
                        Src.Skip();
                        Src.Match('n');
                        Src.Match('f');
                                                        #line 167 "Grammars.ecs"
                        _tok.Value = double.PositiveInfinity;
                                                        #line default
                    }
                    else
                    {
                        goto error;
                    }
                }
                break;

                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                    goto matchNum;

                case '>':
                {
                    la1 = Src.LA(1);
                    if (la1 == '>')
                    {
                        Src.Skip();
                        Src.Skip();
                                                        #line 198 "Grammars.ecs"
                        _tok.Type = TT.Shr;
                                                        #line default
                    }
                    else
                    {
                        Src.Skip();
                                                        #line 198 "Grammars.ecs"
                        _tok.Type = TT.GT;
                                                        #line default
                    }
                }
                break;

                case '<':
                {
                    la1 = Src.LA(1);
                    if (la1 == '<')
                    {
                        Src.Skip();
                        Src.Skip();
                                                        #line 198 "Grammars.ecs"
                        _tok.Type = TT.Shl;
                                                        #line default
                    }
                    else
                    {
                        Src.Skip();
                                                        #line 198 "Grammars.ecs"
                        _tok.Type = TT.LT;
                                                        #line default
                    }
                }
                break;

                case '=':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Assign;
                                                #line default
                }
                break;

                case '^':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Exp;
                                                #line default
                }
                break;

                case '*':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Mul;
                                                #line default
                }
                break;

                case '/':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Div;
                                                #line default
                }
                break;

                case '+':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Add;
                                                #line default
                }
                break;

                case '-':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Sub;
                                                #line default
                }
                break;

                case ';':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.Semicolon;
                                                #line default
                }
                break;

                case '(':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.LParen;
                                                #line default
                }
                break;

                case ')':
                {
                    Src.Skip();
                                                #line 198 "Grammars.ecs"
                    _tok.Type = TT.RParen;
                                                #line default
                }
                break;

                default:
                    if (la0 >= 'A' && la0 <= 'Z' || la0 == '_' || la0 >= 'a' && la0 <= 'z')
                    {
                                                #line 165 "Grammars.ecs"
                        _tok.Type = TT.Id;
                                                #line default
                        Id();
                    }
                    else
                    {
                        goto error;
                    }
                    break;
                }
                break;
matchNum:
                {
                                        #line 164 "Grammars.ecs"
                    _tok.Type = TT.Num;
                                        #line default
                    Num();
                }
                break;
error:
                {
                                        #line 170 "Grammars.ecs"
                    _tok.Type = TT.EOF;
                                        #line default
                    // Line 170: ([^\$])?
                    la0 = Src.LA0;
                    if (la0 != -1)
                    {
                        Src.Skip();
                                                #line 170 "Grammars.ecs"
                        _tok.Type = TT.Unknown;
                                                #line default
                    }
                }
            } while (false);
                        #line 172 "Grammars.ecs"
            return(_tok.Type != TT.EOF);

                        #line default
        }