Example #1
0
    public static Rule_path_absolute Parse(ParserContext context)
    {
        context.Push("path-absolute");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "/");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_segment_nz.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            while (f2)
                            {
                                int g2 = context.index;
                                List <ParserAlternative> as3 = new List <ParserAlternative>();
                                parsed = false;
                                {
                                    int s3 = context.index;
                                    ParserAlternative a3 = new ParserAlternative(s3);
                                    parsed = true;
                                    if (parsed)
                                    {
                                        bool f3 = true;
                                        int  c3 = 0;
                                        for (int i3 = 0; i3 < 1 && f3; i3++)
                                        {
                                            rule = Terminal_StringValue.Parse(context, "/");
                                            if ((f3 = rule != null))
                                            {
                                                a3.Add(rule, context.index);
                                                c3++;
                                            }
                                        }
                                        parsed = c3 == 1;
                                    }
                                    if (parsed)
                                    {
                                        bool f3 = true;
                                        int  c3 = 0;
                                        for (int i3 = 0; i3 < 1 && f3; i3++)
                                        {
                                            rule = Rule_segment.Parse(context);
                                            if ((f3 = rule != null))
                                            {
                                                a3.Add(rule, context.index);
                                                c3++;
                                            }
                                        }
                                        parsed = c3 == 1;
                                    }
                                    if (parsed)
                                    {
                                        as3.Add(a3);
                                    }
                                    context.index = s3;
                                }

                                b = ParserAlternative.GetBest(as3);

                                parsed = b != null;

                                if (parsed)
                                {
                                    a2.Add(b.rules, b.end);
                                    context.index = b.end;
                                }
                                f2 = context.index > g2;
                                if (parsed)
                                {
                                    c2++;
                                }
                            }
                            parsed = true;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_path_absolute(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("path-absolute", parsed);

        return((Rule_path_absolute)rule);
    }
    public static Rule_Minutes Parse(ParserContext context)
    {
        context.Push("Minutes");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_NumericValue.Parse(context, "%x30-35", "[\\x30-\\x35]", 1);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_NumericValue.Parse(context, "%x30-39", "[\\x30-\\x39]", 1);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_Minutes(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("Minutes", parsed);

        return((Rule_Minutes)rule);
    }
Example #3
0
    public static Rule_ls32 Parse(ParserContext context)
    {
        context.Push("ls32");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_h16.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, ":");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_h16.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_IPv4address.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_ls32(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("ls32", parsed);

        return((Rule_ls32)rule);
    }
Example #4
0
    public static Rule_reg_name Parse(ParserContext context)
    {
        context.Push("reg-name");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                while (f1)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_unreserved.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_pct_encoded.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_sub_delims.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_reg_name(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("reg-name", parsed);

        return((Rule_reg_name)rule);
    }
Example #5
0
    public static Rule_expiration_time Parse(ParserContext context)
    {
        context.Push("expiration-time");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_date_time.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_expiration_time(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("expiration-time", parsed);

        return((Rule_expiration_time)rule);
    }
Example #6
0
    public static Rule_A_to_F Parse(ParserContext context)
    {
        context.Push("A-to-F");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "A");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "B");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "C");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "D");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "E");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "F");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_A_to_F(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("A-to-F", parsed);

        return((Rule_A_to_F)rule);
    }
Example #7
0
    public static Rule_sub_delims Parse(ParserContext context)
    {
        context.Push("sub-delims");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "!");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "$");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "&");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "'");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "(");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, ")");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "*");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "+");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, ",");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "#");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "=");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_sub_delims(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("sub-delims", parsed);

        return((Rule_sub_delims)rule);
    }
    public static Rule_generic_option Parse(ParserContext context)
    {
        context.Push("generic-option");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_ALPHA.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_transformer_char.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                while (f1)
                {
                    rule = Rule_transformer_char.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 >= 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_generic_option(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("generic-option", parsed);

        return((Rule_generic_option)rule);
    }
Example #9
0
    public static Rule_hier_part Parse(ParserContext context)
    {
        context.Push("hier-part");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "//");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_authority.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_path_abempty.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_path_absolute.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_path_rootless.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_hier_part(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("hier-part", parsed);

        return((Rule_hier_part)rule);
    }
Example #10
0
    internal static Rule_sign_in_with_ethereum Parse(ParserContext context)
    {
        context.Push("sign-in-with-ethereum");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_domain.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, " wants you to sign in with your Ethereum account:");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_address.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_statement.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_LF.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, "URI: ");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_URI.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, "Version: ");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_version.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, "Chain ID: ");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_chain_id.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, "Nonce: ");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_nonce.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_LF.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringExactValue.Parse(context, "Issued At: ");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_issued_at.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_LF.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringExactValue.Parse(context, "Expiration Time: ");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_expiration_time.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_LF.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringExactValue.Parse(context, "Not Before: ");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_not_before.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_LF.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringExactValue.Parse(context, "Request ID: ");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_request_id.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_LF.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringExactValue.Parse(context, "Resources:");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_resources.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_sign_in_with_ethereum(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("sign-in-with-ethereum", parsed);

        return((Rule_sign_in_with_ethereum)rule);
    }
Example #11
0
    public static Rule_request_id Parse(ParserContext context)
    {
        context.Push("request-id");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                while (f1)
                {
                    rule = Rule_pchar.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_request_id(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("request-id", parsed);

        return((Rule_request_id)rule);
    }
Example #12
0
    public static Rule_pct_encoded_no_SQUOTE Parse(ParserContext context)
    {
        context.Push("pct-encoded-no-SQUOTE");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "%");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "0");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "1");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "3");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "4");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "5");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "6");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "8");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "9");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_A_to_F.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_HEXDIG.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "%");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "2");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "0");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "1");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "2");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "3");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "4");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "5");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "6");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "8");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "9");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_A_to_F.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_pct_encoded_no_SQUOTE(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("pct-encoded-no-SQUOTE", parsed);

        return((Rule_pct_encoded_no_SQUOTE)rule);
    }
Example #13
0
    public static Rule_did_optional_transform Parse(ParserContext context)
    {
        context.Push("did-optional-transform");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_did.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_TRANSFORM.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_path_abempty.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "?");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_query.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_StringValue.Parse(context, "#");
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_fragment.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_did_optional_transform(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("did-optional-transform", parsed);

        return((Rule_did_optional_transform)rule);
    }
Example #14
0
    public static Rule_qchar_no_AMP_EQ Parse(ParserContext context)
    {
        context.Push("qchar-no-AMP-EQ");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_unreserved.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_pct_encoded.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_other_delims.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, ":");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "@");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "/");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "?");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "$");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Terminal_StringValue.Parse(context, "'");
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_qchar_no_AMP_EQ(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("qchar-no-AMP-EQ", parsed);

        return((Rule_qchar_no_AMP_EQ)rule);
    }
Example #15
0
    public static Rule_Hours Parse(ParserContext context)
    {
        context.Push("Hours");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_NumericValue.Parse(context, "%x30-31", "[\\x30-\\x31]", 1);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_NumericValue.Parse(context, "%x30-39", "[\\x30-\\x39]", 1);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_NumericValue.Parse(context, "%x32", "[\\x32]", 1);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Terminal_NumericValue.Parse(context, "%x30-33", "[\\x30-\\x33]", 1);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_Hours(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("Hours", parsed);

        return((Rule_Hours)rule);
    }
Example #16
0
    public static Rule_Clock Parse(ParserContext context)
    {
        context.Push("Clock");

        Rule rule;
        bool parsed = true;
        ParserAlternative b;
        int s0 = context.index;
        ParserAlternative a0 = new ParserAlternative(s0);

        List <ParserAlternative> as1 = new List <ParserAlternative>();

        parsed = false;
        {
            int s1 = context.index;
            ParserAlternative a1 = new ParserAlternative(s1);
            parsed = true;
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_Hours.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_Separator.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    rule = Rule_Minutes.Parse(context);
                    if ((f1 = rule != null))
                    {
                        a1.Add(rule, context.index);
                        c1++;
                    }
                }
                parsed = c1 == 1;
            }
            if (parsed)
            {
                bool f1 = true;
                int  c1 = 0;
                for (int i1 = 0; i1 < 1 && f1; i1++)
                {
                    int g1 = context.index;
                    List <ParserAlternative> as2 = new List <ParserAlternative>();
                    parsed = false;
                    {
                        int s2 = context.index;
                        ParserAlternative a2 = new ParserAlternative(s2);
                        parsed = true;
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_Separator.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            bool f2 = true;
                            int  c2 = 0;
                            for (int i2 = 0; i2 < 1 && f2; i2++)
                            {
                                rule = Rule_Seconds.Parse(context);
                                if ((f2 = rule != null))
                                {
                                    a2.Add(rule, context.index);
                                    c2++;
                                }
                            }
                            parsed = c2 == 1;
                        }
                        if (parsed)
                        {
                            as2.Add(a2);
                        }
                        context.index = s2;
                    }

                    b = ParserAlternative.GetBest(as2);

                    parsed = b != null;

                    if (parsed)
                    {
                        a1.Add(b.rules, b.end);
                        context.index = b.end;
                    }
                    f1 = context.index > g1;
                    if (parsed)
                    {
                        c1++;
                    }
                }
                parsed = true;
            }
            if (parsed)
            {
                as1.Add(a1);
            }
            context.index = s1;
        }

        b = ParserAlternative.GetBest(as1);

        parsed = b != null;

        if (parsed)
        {
            a0.Add(b.rules, b.end);
            context.index = b.end;
        }

        rule = null;
        if (parsed)
        {
            rule = new Rule_Clock(context.text.Substring(a0.start, a0.end - a0.start), a0.rules);
        }
        else
        {
            context.index = s0;
        }

        context.Pop("Clock", parsed);

        return((Rule_Clock)rule);
    }