Exemplo n.º 1
0
        private static PassiveExpression RAdd(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new Pattern(new ExpressionVariable("e.1")), new Pattern("0".ToCharArray()));

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build(pattern2.GetVariable("e.1")));
            }
            ;

            Pattern pattern3 = new Pattern(new Pattern(new ExpressionVariable("e.1")), new Pattern(new ExpressionVariable("e.2"), "\'".ToCharArray()));

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(RAdd(PassiveExpression.Build(PassiveExpression.CreateSubexpression(pattern3.GetVariable("e.1")), PassiveExpression.CreateSubexpression(pattern3.GetVariable("e.2")))), "\'".ToCharArray()));
            }
            ;

            Pattern pattern4 = new Pattern(new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build());
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 2
0
        private static PassiveExpression _Read__in(PassiveExpression expression)
        {
            Pattern pattern8 = new Pattern();

            if (RefalBase.Match(expression, pattern8))
            {
                return(PassiveExpression.Build());
            }
            ;

            Pattern pattern9 = new Pattern(0);

            if (RefalBase.Match(expression, pattern9))
            {
                return(PassiveExpression.Build());
            }
            ;

            Pattern pattern10 = new Pattern(new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern10))
            {
                return(PassiveExpression.Build(" ".ToCharArray(), pattern10.GetVariable("e.1"), _Read__in(PassiveExpression.Build(_Card(PassiveExpression.Build())))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 3
0
        private static PassiveExpression _Parse1(PassiveExpression expression)
        {
            Pattern pattern91 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), "L".ToCharArray(), new ExpressionVariable("e.A1"), new ClosingBrace(), new SymbolVariable("s.A"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern91))
            {
                return(PassiveExpression.Build(_Word(PassiveExpression.Build(new OpeningBrace(), pattern91.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern91.GetVariable("s.A"), new ClosingBrace(), pattern91.GetVariable("e.2")))));
            }
            ;

            Pattern pattern92 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), "D".ToCharArray(), new ExpressionVariable("e.A1"), new ClosingBrace(), new SymbolVariable("s.A"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern92))
            {
                return(PassiveExpression.Build(_Number(PassiveExpression.Build(new OpeningBrace(), pattern92.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern92.GetVariable("s.A"), new ClosingBrace(), pattern92.GetVariable("e.2")))));
            }
            ;

            Pattern pattern93 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new SymbolVariable("s.T"), new ExpressionVariable("e.A1"), new ClosingBrace(), new SymbolVariable("s.A"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern93))
            {
                return(PassiveExpression.Build(_Parse(PassiveExpression.Build(new OpeningBrace(), pattern93.GetVariable("e.1"), pattern93.GetVariable("s.A"), new ClosingBrace(), pattern93.GetVariable("e.2")))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 4
0
        private static PassiveExpression _Number(PassiveExpression expression)
        {
            Pattern pattern102 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.N"), new ClosingBrace(), new SymbolVariable("s.X"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern102))
            {
                expression = PassiveExpression.Build(_Type(PassiveExpression.Build(pattern102.GetVariable("s.X"))));
                Pattern pattern103 = new Pattern("D".ToCharArray(), new ExpressionVariable("e.X1"));
                pattern103.CopyBoundVariables(pattern102);
                if (RefalBase.Match(expression, pattern103))
                {
                    return(PassiveExpression.Build(_Number(PassiveExpression.Build(new OpeningBrace(), pattern103.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern103.GetVariable("e.N"), pattern103.GetVariable("s.X"), new ClosingBrace(), pattern103.GetVariable("e.2")))));
                }
            }
            ;

            Pattern pattern104 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.N"), new ClosingBrace(), new ExpressionVariable("e.X"));

            if (RefalBase.Match(expression, pattern104))
            {
                return(PassiveExpression.Build(_Parse(PassiveExpression.Build(new OpeningBrace(), pattern104.GetVariable("e.1"), _Numb(PassiveExpression.Build(pattern104.GetVariable("e.N"))), new ClosingBrace(), pattern104.GetVariable("e.X")))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 5
0
        private static PassiveExpression Chpm(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern("+".ToCharArray(), new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build("-".ToCharArray(), Chpm(PassiveExpression.Build(pattern2.GetVariable("e.1")))));
            }
            ;

            Pattern pattern3 = new Pattern(new SymbolVariable("s.1"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(pattern3.GetVariable("s.1"), Chpm(PassiveExpression.Build(pattern3.GetVariable("e.2")))));
            }
            ;

            Pattern pattern4 = new Pattern();

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build());
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 6
0
        private static PassiveExpression PreAlph(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.1"));

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build(true));
            }
            ;

            Pattern pattern3 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.2"));

            if (RefalBase.Match(expression, pattern3))
            {
                PassiveExpression expression4 = PassiveExpression.Build(Alphabet(PassiveExpression.Build()));
                Pattern           pattern4    = new Pattern(new ExpressionVariable("e.A"), new SymbolVariable("s.1"), new ExpressionVariable("e.B"), new SymbolVariable("s.2"), new ExpressionVariable("e.C"));
                pattern4.BindVariables(pattern3);
                if (RefalBase.Match(expression4, pattern4))
                {
                    return(PassiveExpression.Build(true));
                }
                ;
            }
            ;

            Pattern pattern5 = new Pattern(new ExpressionVariable("e.Z"));

            if (RefalBase.Match(expression, pattern5))
            {
                return(PassiveExpression.Build(false));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 7
0
        private static PassiveExpression _Prout__lm(PassiveExpression expression)
        {
            Pattern pattern45 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), "*".ToCharArray(), new ClosingBrace(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern45))
            {
                return(PassiveExpression.Build(_Prout__lm(PassiveExpression.Build(pattern45.GetVariable("e.1"))), _Prout(PassiveExpression.Build("*** *(".ToCharArray(), pattern45.GetVariable("e.2")))));
            }
            ;

            Pattern pattern46 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern46))
            {
                return(PassiveExpression.Build(_Prout__lm(PassiveExpression.Build(pattern46.GetVariable("e.1"))), _Prout(PassiveExpression.Build("*** (".ToCharArray(), pattern46.GetVariable("e.2")))));
            }
            ;

            Pattern pattern47 = new Pattern("$".ToCharArray(), new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern47))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("*** ".ToCharArray(), pattern47.GetVariable("e.1")))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 8
0
        private static PassiveExpression _Check__end(PassiveExpression expression)
        {
            Pattern pattern3 = new Pattern();

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("End of session".ToCharArray()))));
            }
            ;

            Pattern pattern4 = new Pattern("*".ToCharArray(), "Error");

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build(_Job(PassiveExpression.Build())));
            }
            ;

            Pattern pattern5 = new Pattern(new ExpressionVariable("e.X"));

            if (RefalBase.Match(expression, pattern5))
            {
                return(PassiveExpression.Build(_Out(PassiveExpression.Build(_UpD(PassiveExpression.Build(pattern5.GetVariable("e.X")))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 9
0
        private static PassiveExpression _Checkf(PassiveExpression expression)
        {
            Pattern pattern38 = new Pattern("+".ToCharArray());

            if (RefalBase.Match(expression, pattern38))
            {
                return(PassiveExpression.Build("Add"));
            }
            ;

            Pattern pattern39 = new Pattern("-".ToCharArray());

            if (RefalBase.Match(expression, pattern39))
            {
                return(PassiveExpression.Build("Sub"));
            }
            ;

            Pattern pattern40 = new Pattern("*".ToCharArray());

            if (RefalBase.Match(expression, pattern40))
            {
                return(PassiveExpression.Build("Mul"));
            }
            ;

            Pattern pattern41 = new Pattern("/".ToCharArray());

            if (RefalBase.Match(expression, pattern41))
            {
                return(PassiveExpression.Build("Div"));
            }
            ;

            Pattern pattern42 = new Pattern(new SymbolVariable("s.F"));

            if (RefalBase.Match(expression, pattern42))
            {
                expression = PassiveExpression.Build(_Type(PassiveExpression.Build(pattern42.GetVariable("s.F"))));
                Pattern pattern43 = new Pattern("Wi".ToCharArray(), new ExpressionVariable("e.F1"));
                pattern43.CopyBoundVariables(pattern42);
                if (RefalBase.Match(expression, pattern43))
                {
                    return(PassiveExpression.Build(pattern43.GetVariable("s.F")));
                }
            }
            ;

            Pattern pattern44 = new Pattern(new SymbolVariable("s.F"));

            if (RefalBase.Match(expression, pattern44))
            {
                return(PassiveExpression.Build());
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 10
0
        private static PassiveExpression _Job(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern();

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("Type expression to evaluate. To end: empty line. ".ToCharArray())), _Prout(PassiveExpression.Build("To end session: empty expression".ToCharArray())), _Prout(PassiveExpression.Build()), _Check__end(PassiveExpression.Build(_Inp__met(PassiveExpression.Build())))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 11
0
        public static PassiveExpression _Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

            if (RefalBase.Match(expression, pattern1))
            {
                return(PassiveExpression.Build(_Job(PassiveExpression.Build())));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 12
0
        private static PassiveExpression Alphabet(PassiveExpression expression)
        {
            Pattern pattern6 = new Pattern();

            if (RefalBase.Match(expression, pattern6))
            {
                return(PassiveExpression.Build("abc".ToCharArray()));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 13
0
        public static PassiveExpression Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

            if (RefalBase.Match(expression, pattern1))
            {
                return(PassiveExpression.Build(Prout(PassiveExpression.Build(PreAlph(PassiveExpression.Build("a".ToCharArray(), "c".ToCharArray()))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 14
0
        public static PassiveExpression Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

            if (RefalBase.Match(expression, pattern1))
            {
                return(PassiveExpression.Build(Prout(PassiveExpression.Build(Pal(PassiveExpression.Build("sator arepo tenet opera rotas".ToCharArray()))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 15
0
        public static PassiveExpression Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

            if (RefalBase.Match(expression, pattern1))
            {
                return(PassiveExpression.Build(Job(PassiveExpression.Build(Card(PassiveExpression.Build())))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 16
0
        private static PassiveExpression Table(PassiveExpression expression)
        {
            Pattern pattern8 = new Pattern();

            if (RefalBase.Match(expression, pattern8))
            {
                return(PassiveExpression.Build(new OpeningBrace(), new OpeningBrace(), "1".ToCharArray(), new ClosingBrace(), "2".ToCharArray(), new ClosingBrace()));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 17
0
        private static PassiveExpression _Out(PassiveExpression expression)
        {
            Pattern pattern6 = new Pattern(new ExpressionVariable("e.X"));

            if (RefalBase.Match(expression, pattern6))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("The result is:".ToCharArray())), _Prout(PassiveExpression.Build(pattern6.GetVariable("e.X"))), _Prout(PassiveExpression.Build()), _Job(PassiveExpression.Build())));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 18
0
        private static PassiveExpression _Inp__met(PassiveExpression expression)
        {
            Pattern pattern7 = new Pattern();

            if (RefalBase.Match(expression, pattern7))
            {
                return(PassiveExpression.Build(_Parse(PassiveExpression.Build(new OpeningBrace(), "$".ToCharArray(), new ClosingBrace(), _Read__in(PassiveExpression.Build(_Card(PassiveExpression.Build())))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 19
0
        private static PassiveExpression _QuotesError(PassiveExpression expression)
        {
            Pattern pattern72 = new Pattern(new SymbolVariable("s.Q"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace());

            if (RefalBase.Match(expression, pattern72))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build()), "*".ToCharArray(), "Error", _Prout(PassiveExpression.Build("*** ERROR: Unbalanced quote in input".ToCharArray())), _Prout(PassiveExpression.Build("*** ".ToCharArray(), pattern72.GetVariable("e.1"))), _Prout(PassiveExpression.Build("*** ".ToCharArray(), pattern72.GetVariable("s.Q")))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 20
0
        private static PassiveExpression Trans(PassiveExpression expression)
        {
            Pattern pattern9 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.It"), new ClosingBrace(), new ExpressionVariable("e.1"), new OpeningBrace(), new OpeningBrace(), new ExpressionVariable("e.It"), new ClosingBrace(), new ExpressionVariable("e.Eng"), new ClosingBrace(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern9))
            {
                return(PassiveExpression.Build(pattern9.GetVariable("e.Eng")));
            }
            ;

            Pattern pattern10 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.It"), new ClosingBrace(), new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern10))
            {
                return(PassiveExpression.Build("***".ToCharArray()));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 21
0
        private static PassiveExpression Job(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(0);

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build());
            }
            ;

            Pattern pattern3 = new Pattern(new ExpressionVariable("e.X"));

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(Prout(PassiveExpression.Build(Trans__line(PassiveExpression.Build(pattern3.GetVariable("e.X"))))), Job(PassiveExpression.Build(Card(PassiveExpression.Build())))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 22
0
        private static PassiveExpression PreAlph(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.1"));

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build(true));
            }
            ;

            Pattern pattern3 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.2"));

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(Before(PassiveExpression.Build(pattern3.GetVariable("s.1"), pattern3.GetVariable("s.2"), "In", Alphabet(PassiveExpression.Build())))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 23
0
        private static PassiveExpression Before(PassiveExpression expression)
        {
            Pattern pattern4 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.2"), "In", new ExpressionVariable("e.A"), new SymbolVariable("s.1"), new ExpressionVariable("e.B"), new SymbolVariable("s.2"), new ExpressionVariable("e.C"));

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build(true));
            }
            ;

            Pattern pattern5 = new Pattern(new ExpressionVariable("e.Z"));

            if (RefalBase.Match(expression, pattern5))
            {
                return(PassiveExpression.Build(false));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 24
0
        public static PassiveExpression Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

            if (RefalBase.Match(expression, pattern1))
            {
                return(PassiveExpression.Build(
                           Prout(PassiveExpression.Build("0 + 0 = ",
                                                         RAdd(PassiveExpression.Build(
                                                                  PassiveExpression.CreateSubexpression("0".ToCharArray()),
                                                                  PassiveExpression.CreateSubexpression("0".ToCharArray()))))
                                 ),
                           Prout(PassiveExpression.Build("0' + 0 = ",
                                                         RAdd(PassiveExpression.Build(
                                                                  PassiveExpression.CreateSubexpression("0\'".ToCharArray()),
                                                                  PassiveExpression.CreateSubexpression("0".ToCharArray()))))
                                 ),
                           Prout(PassiveExpression.Build("0 + 0' = ",
                                                         RAdd(PassiveExpression.Build(
                                                                  PassiveExpression.CreateSubexpression("0".ToCharArray()),
                                                                  PassiveExpression.CreateSubexpression("0\'".ToCharArray()))))
                                 ),
                           Prout(PassiveExpression.Build("0' + 0' = ",
                                                         RAdd(PassiveExpression.Build(
                                                                  PassiveExpression.CreateSubexpression("0\'".ToCharArray()),
                                                                  PassiveExpression.CreateSubexpression("0\'".ToCharArray()))))
                                 ),
                           Prout(PassiveExpression.Build("0'' + 0''' = ",
                                                         RAdd(PassiveExpression.Build(
                                                                  PassiveExpression.CreateSubexpression("0\'\'".ToCharArray()),
                                                                  PassiveExpression.CreateSubexpression("0\'\'\'".ToCharArray()))))
                                 )
                           ));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 25
0
        private static PassiveExpression Trans__line(PassiveExpression expression)
        {
            Pattern pattern4 = new Pattern(" ".ToCharArray(), new ExpressionVariable("e.X"));

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build(Trans__line(PassiveExpression.Build(pattern4.GetVariable("e.X")))));
            }
            ;

            Pattern pattern5 = new Pattern(new ExpressionVariable("e.Word"), " ".ToCharArray(), new ExpressionVariable("e.Rest"));

            if (RefalBase.Match(expression, pattern5))
            {
                return(PassiveExpression.Build(Trans(PassiveExpression.Build(new OpeningBrace(), pattern5.GetVariable("e.Word"), new ClosingBrace(), Table(PassiveExpression.Build()))), " ".ToCharArray(), Trans__line(PassiveExpression.Build(pattern5.GetVariable("e.Rest")))));
            }
            ;

            Pattern pattern6 = new Pattern();

            if (RefalBase.Match(expression, pattern6))
            {
                return(PassiveExpression.Build());
            }
            ;

            Pattern pattern7 = new Pattern(new ExpressionVariable("e.Word"));

            if (RefalBase.Match(expression, pattern7))
            {
                return(PassiveExpression.Build(Trans(PassiveExpression.Build(new OpeningBrace(), pattern7.GetVariable("e.Word"), new ClosingBrace(), Table(PassiveExpression.Build()))), " ".ToCharArray()));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 26
0
        private static PassiveExpression Pal(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern();

            if (RefalBase.Match(expression, pattern2))
            {
                return(PassiveExpression.Build(true));
            }
            ;

            Pattern pattern3 = new Pattern(new SymbolVariable("s.1"));

            if (RefalBase.Match(expression, pattern3))
            {
                return(PassiveExpression.Build(true));
            }
            ;

            Pattern pattern4 = new Pattern(new SymbolVariable("s.1"), new ExpressionVariable("e.2"), new SymbolVariable("s.1"));

            if (RefalBase.Match(expression, pattern4))
            {
                return(PassiveExpression.Build(Pal(PassiveExpression.Build(pattern4.GetVariable("e.2")))));
            }
            ;

            Pattern pattern5 = new Pattern(new ExpressionVariable("e.1"));

            if (RefalBase.Match(expression, pattern5))
            {
                return(PassiveExpression.Build(false));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible");
        }
Exemplo n.º 27
0
        private static PassiveExpression _Word(PassiveExpression expression)
        {
            Pattern pattern94 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.W"), new ClosingBrace(), new SymbolVariable("s.B"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern94))
            {
                expression = PassiveExpression.Build(_Type(PassiveExpression.Build(pattern94.GetVariable("s.B"))));
                {
                    Pattern pattern95 = new Pattern("L".ToCharArray(), new ExpressionVariable("e.B1"));
                    pattern95.CopyBoundVariables(pattern94);
                    if (RefalBase.Match(expression, pattern95))
                    {
                        return(PassiveExpression.Build(_Word(PassiveExpression.Build(new OpeningBrace(), pattern95.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern95.GetVariable("e.W"), pattern95.GetVariable("s.B"), new ClosingBrace(), pattern95.GetVariable("e.2")))));
                    }
                    ;

                    Pattern pattern96 = new Pattern("D".ToCharArray(), new ExpressionVariable("e.B1"));
                    pattern96.CopyBoundVariables(pattern94);
                    if (RefalBase.Match(expression, pattern96))
                    {
                        return(PassiveExpression.Build(_Word(PassiveExpression.Build(new OpeningBrace(), pattern96.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern96.GetVariable("e.W"), pattern96.GetVariable("s.B"), new ClosingBrace(), pattern96.GetVariable("e.2")))));
                    }
                    ;

                    Pattern pattern97 = new Pattern("Ol-".ToCharArray());
                    pattern97.CopyBoundVariables(pattern94);
                    if (RefalBase.Match(expression, pattern97))
                    {
                        return(PassiveExpression.Build(_Word(PassiveExpression.Build(new OpeningBrace(), pattern97.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern97.GetVariable("e.W"), "-".ToCharArray(), new ClosingBrace(), pattern97.GetVariable("e.2")))));
                    }
                    ;

                    Pattern pattern98 = new Pattern("Ou_".ToCharArray());
                    pattern98.CopyBoundVariables(pattern94);
                    if (RefalBase.Match(expression, pattern98))
                    {
                        return(PassiveExpression.Build(_Word(PassiveExpression.Build(new OpeningBrace(), pattern98.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern98.GetVariable("e.W"), "_".ToCharArray(), new ClosingBrace(), pattern98.GetVariable("e.2")))));
                    }
                    ;

                    Pattern pattern99 = new Pattern(new SymbolVariable("s.T"), new ExpressionVariable("e.B1"));
                    pattern99.CopyBoundVariables(pattern94);
                    if (RefalBase.Match(expression, pattern99))
                    {
                        return(PassiveExpression.Build(_Parse(PassiveExpression.Build(new OpeningBrace(), pattern99.GetVariable("e.1"), _Implode_Ext(PassiveExpression.Build(pattern99.GetVariable("e.W"))), new ClosingBrace(), pattern99.GetVariable("s.B"), pattern99.GetVariable("e.2")))));
                    }
                    ;

                    throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
                }
            }
            ;

            Pattern pattern101 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.W"), new ClosingBrace());

            if (RefalBase.Match(expression, pattern101))
            {
                return(PassiveExpression.Build(_Parse(PassiveExpression.Build(new OpeningBrace(), pattern101.GetVariable("e.1"), _Implode_Ext(PassiveExpression.Build(pattern101.GetVariable("e.W"))), new ClosingBrace()))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 28
0
        private static PassiveExpression _Hex(PassiveExpression expression)
        {
            Pattern pattern73 = new Pattern(new SymbolVariable("s.d1"), new SymbolVariable("s.d2"));

            if (RefalBase.Match(expression, pattern73))
            {
                expression = PassiveExpression.Build(_Hex(PassiveExpression.Build(pattern73.GetVariable("s.d1"))));
                Pattern pattern74 = new Pattern(new SymbolVariable("s.h1"));
                pattern74.CopyBoundVariables(pattern73);
                if (RefalBase.Match(expression, pattern74))
                {
                    expression = PassiveExpression.Build(_Hex(PassiveExpression.Build(pattern74.GetVariable("s.d2"))));
                    Pattern pattern75 = new Pattern(new SymbolVariable("s.h2"));
                    pattern75.CopyBoundVariables(pattern74);
                    if (RefalBase.Match(expression, pattern75))
                    {
                        return(PassiveExpression.Build(_Chr(PassiveExpression.Build(_Add(PassiveExpression.Build(new OpeningBrace(), _Mul(PassiveExpression.Build(pattern75.GetVariable("s.h1"), 16)), new ClosingBrace(), pattern75.GetVariable("s.h2")))))));
                    }
                }
            }
            ;

            Pattern pattern76 = new Pattern(new SymbolVariable("s.h"));

            if (RefalBase.Match(expression, pattern76))
            {
                expression = PassiveExpression.Build(_Type(PassiveExpression.Build(pattern76.GetVariable("s.h"))));
                Pattern pattern77 = new Pattern("D".ToCharArray(), new ExpressionVariable("e.D1"));
                pattern77.CopyBoundVariables(pattern76);
                if (RefalBase.Match(expression, pattern77))
                {
                    return(PassiveExpression.Build(pattern77.GetVariable("s.h")));
                }
            }
            ;

            Pattern pattern78 = new Pattern("A".ToCharArray());

            if (RefalBase.Match(expression, pattern78))
            {
                return(PassiveExpression.Build(10));
            }
            ;

            Pattern pattern79 = new Pattern("a".ToCharArray());

            if (RefalBase.Match(expression, pattern79))
            {
                return(PassiveExpression.Build(10));
            }
            ;

            Pattern pattern80 = new Pattern("B".ToCharArray());

            if (RefalBase.Match(expression, pattern80))
            {
                return(PassiveExpression.Build(11));
            }
            ;

            Pattern pattern81 = new Pattern("b".ToCharArray());

            if (RefalBase.Match(expression, pattern81))
            {
                return(PassiveExpression.Build(11));
            }
            ;

            Pattern pattern82 = new Pattern("C".ToCharArray());

            if (RefalBase.Match(expression, pattern82))
            {
                return(PassiveExpression.Build(12));
            }
            ;

            Pattern pattern83 = new Pattern("c".ToCharArray());

            if (RefalBase.Match(expression, pattern83))
            {
                return(PassiveExpression.Build(12));
            }
            ;

            Pattern pattern84 = new Pattern("D".ToCharArray());

            if (RefalBase.Match(expression, pattern84))
            {
                return(PassiveExpression.Build(13));
            }
            ;

            Pattern pattern85 = new Pattern("d".ToCharArray());

            if (RefalBase.Match(expression, pattern85))
            {
                return(PassiveExpression.Build(13));
            }
            ;

            Pattern pattern86 = new Pattern("E".ToCharArray());

            if (RefalBase.Match(expression, pattern86))
            {
                return(PassiveExpression.Build(14));
            }
            ;

            Pattern pattern87 = new Pattern("e".ToCharArray());

            if (RefalBase.Match(expression, pattern87))
            {
                return(PassiveExpression.Build(14));
            }
            ;

            Pattern pattern88 = new Pattern("F".ToCharArray());

            if (RefalBase.Match(expression, pattern88))
            {
                return(PassiveExpression.Build(15));
            }
            ;

            Pattern pattern89 = new Pattern("f".ToCharArray());

            if (RefalBase.Match(expression, pattern89))
            {
                return(PassiveExpression.Build(15));
            }
            ;

            Pattern pattern90 = new Pattern(new ExpressionVariable("e.hs"));

            if (RefalBase.Match(expression, pattern90))
            {
                return(PassiveExpression.Build());
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 29
0
        private static PassiveExpression _Quotes(PassiveExpression expression)
        {
            Pattern pattern59 = new Pattern(new SymbolVariable("s.Fun"), new SymbolVariable("s.Q"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), "\\\\".ToCharArray(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern59))
            {
                expression = PassiveExpression.Build(pattern59.GetVariable("e.2"));
                {
                    Pattern pattern60 = new Pattern("x".ToCharArray(), new SymbolVariable("s.d1"), new SymbolVariable("s.d2"), new ExpressionVariable("e.3"));
                    pattern60.CopyBoundVariables(pattern59);
                    if (RefalBase.Match(expression, pattern60))
                    {
                        expression = PassiveExpression.Build(_Hex(PassiveExpression.Build(pattern60.GetVariable("s.d1"), pattern60.GetVariable("s.d2"))));
                        Pattern pattern61 = new Pattern(new SymbolVariable("s.hex"));
                        pattern61.CopyBoundVariables(pattern60);
                        if (RefalBase.Match(expression, pattern61))
                        {
                            return(PassiveExpression.Build(_Quotes(PassiveExpression.Build(pattern61.GetVariable("s.Fun"), pattern61.GetVariable("s.Q"), new OpeningBrace(), pattern61.GetVariable("e.1"), pattern61.GetVariable("s.hex"), new ClosingBrace(), pattern61.GetVariable("e.3")))));
                        }
                    }
                    ;

                    Pattern pattern62 = new Pattern(new SymbolVariable("s.A"), new ExpressionVariable("e.3"));
                    pattern62.CopyBoundVariables(pattern59);
                    if (RefalBase.Match(expression, pattern62))
                    {
                        expression = PassiveExpression.Build(_Escape(PassiveExpression.Build(pattern62.GetVariable("s.A"))));
                        Pattern pattern63 = new Pattern(new SymbolVariable("s.A1"));
                        pattern63.CopyBoundVariables(pattern62);
                        if (RefalBase.Match(expression, pattern63))
                        {
                            return(PassiveExpression.Build(_Quotes(PassiveExpression.Build(pattern63.GetVariable("s.Fun"), pattern63.GetVariable("s.Q"), new OpeningBrace(), pattern63.GetVariable("e.1"), pattern63.GetVariable("s.A1"), new ClosingBrace(), pattern63.GetVariable("e.3")))));
                        }
                    }
                    ;

                    Pattern pattern64 = new Pattern(new ExpressionVariable("e.3"));
                    pattern64.CopyBoundVariables(pattern59);
                    if (RefalBase.Match(expression, pattern64))
                    {
                        return(PassiveExpression.Build(_Prout(PassiveExpression.Build()), "*".ToCharArray(), "Error", _Prout(PassiveExpression.Build("*** ERROR: Unexpected escape sequnce in input".ToCharArray())), _Prout(PassiveExpression.Build("*** ".ToCharArray(), pattern64.GetVariable("e.1"))), _Prout(PassiveExpression.Build("*** ".ToCharArray(), "\\\\".ToCharArray(), pattern64.GetVariable("e.3")))));
                    }
                    ;

                    throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
                }
            }
            ;

            Pattern pattern66 = new Pattern(new SymbolVariable("s.Fun"), "\'".ToCharArray(), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), "\'".ToCharArray(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern66))
            {
                return(PassiveExpression.Build(_Mu(PassiveExpression.Build(pattern66.GetVariable("s.Fun"), new OpeningBrace(), pattern66.GetVariable("e.1"), new ClosingBrace(), pattern66.GetVariable("e.2")))));
            }
            ;

            Pattern pattern67 = new Pattern(new SymbolVariable("s.Fun"), "\"".ToCharArray(), new OpeningBrace(), new OpeningBrace(), new ExpressionVariable("e.0"), new ClosingBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), "\"".ToCharArray(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern67))
            {
                return(PassiveExpression.Build(_Mu(PassiveExpression.Build(pattern67.GetVariable("s.Fun"), new OpeningBrace(), pattern67.GetVariable("e.0"), _Implode_Ext(PassiveExpression.Build(pattern67.GetVariable("e.1"))), new ClosingBrace(), pattern67.GetVariable("e.2")))));
            }
            ;

            Pattern pattern68 = new Pattern(new SymbolVariable("s.Fun"), new SymbolVariable("s.Q"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), "EOF");

            if (RefalBase.Match(expression, pattern68))
            {
                return(PassiveExpression.Build(_QuotesError(PassiveExpression.Build(pattern68.GetVariable("s.Q"), new OpeningBrace(), pattern68.GetVariable("e.1"), new ClosingBrace()))));
            }
            ;

            Pattern pattern69 = new Pattern(new SymbolVariable("s.Fun"), "\'".ToCharArray(), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), "*".ToCharArray(), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern69))
            {
                return(PassiveExpression.Build(_Quotes(PassiveExpression.Build(pattern69.GetVariable("s.Fun"), "\'".ToCharArray(), new OpeningBrace(), pattern69.GetVariable("e.1"), "*V".ToCharArray(), new ClosingBrace(), pattern69.GetVariable("e.2")))));
            }
            ;

            Pattern pattern70 = new Pattern(new SymbolVariable("s.Fun"), new SymbolVariable("s.Q"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new SymbolVariable("s.A"), new ExpressionVariable("e.2"));

            if (RefalBase.Match(expression, pattern70))
            {
                return(PassiveExpression.Build(_Quotes(PassiveExpression.Build(pattern70.GetVariable("s.Fun"), pattern70.GetVariable("s.Q"), new OpeningBrace(), pattern70.GetVariable("e.1"), pattern70.GetVariable("s.A"), new ClosingBrace(), pattern70.GetVariable("e.2")))));
            }
            ;

            Pattern pattern71 = new Pattern(new SymbolVariable("s.Fun"), new SymbolVariable("s.Q"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace());

            if (RefalBase.Match(expression, pattern71))
            {
                return(PassiveExpression.Build(_QuotesError(PassiveExpression.Build(pattern71.GetVariable("s.Q"), new OpeningBrace(), pattern71.GetVariable("e.1"), new ClosingBrace()))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }
Exemplo n.º 30
0
        private static PassiveExpression _Escape(PassiveExpression expression)
        {
            Pattern pattern48 = new Pattern("\\\\".ToCharArray());

            if (RefalBase.Match(expression, pattern48))
            {
                return(PassiveExpression.Build("\\\\".ToCharArray()));
            }
            ;

            Pattern pattern49 = new Pattern("n".ToCharArray());

            if (RefalBase.Match(expression, pattern49))
            {
                return(PassiveExpression.Build("\\n".ToCharArray()));
            }
            ;

            Pattern pattern50 = new Pattern("r".ToCharArray());

            if (RefalBase.Match(expression, pattern50))
            {
                return(PassiveExpression.Build("\\r".ToCharArray()));
            }
            ;

            Pattern pattern51 = new Pattern("t".ToCharArray());

            if (RefalBase.Match(expression, pattern51))
            {
                return(PassiveExpression.Build("\\t".ToCharArray()));
            }
            ;

            Pattern pattern52 = new Pattern("\'".ToCharArray());

            if (RefalBase.Match(expression, pattern52))
            {
                return(PassiveExpression.Build("\'".ToCharArray()));
            }
            ;

            Pattern pattern53 = new Pattern("\"".ToCharArray());

            if (RefalBase.Match(expression, pattern53))
            {
                return(PassiveExpression.Build("\"".ToCharArray()));
            }
            ;

            Pattern pattern54 = new Pattern("(".ToCharArray());

            if (RefalBase.Match(expression, pattern54))
            {
                return(PassiveExpression.Build("(".ToCharArray()));
            }
            ;

            Pattern pattern55 = new Pattern(")".ToCharArray());

            if (RefalBase.Match(expression, pattern55))
            {
                return(PassiveExpression.Build(")".ToCharArray()));
            }
            ;

            Pattern pattern56 = new Pattern("<".ToCharArray());

            if (RefalBase.Match(expression, pattern56))
            {
                return(PassiveExpression.Build("<".ToCharArray()));
            }
            ;

            Pattern pattern57 = new Pattern(">".ToCharArray());

            if (RefalBase.Match(expression, pattern57))
            {
                return(PassiveExpression.Build(">".ToCharArray()));
            }
            ;

            Pattern pattern58 = new Pattern(new ExpressionVariable("e.3"));

            if (RefalBase.Match(expression, pattern58))
            {
                return(PassiveExpression.Build());
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + ExpressionToString(expression, 0));
        }