Exemplo n.º 1
0
        public static PassiveExpression _Numb(PassiveExpression expression)
        {
            if (expression == null || expression.IsEmpty)
            {
                return(new PassiveExpression());
            }

            return(PassiveExpression.Build(Convert.ToInt32(expression.ToString())));
        }
Exemplo n.º 2
0
        public static PassiveExpression _Dg(PassiveExpression expression)
        {
            // <Dg e.N>
            string            strKey = expression.ToString();
            PassiveExpression result = PassiveExpression.Build(buriedValues[strKey] as PassiveExpression);

            buriedValues[strKey] = null;
            buriedKeys[strKey]   = null;

            return(result);
        }
Exemplo n.º 3
0
        public PassiveExpression Implode(PassiveExpression expression)
        {
            string s = expression.ToString().Trim();

            int index = 0;

            while (index < s.Length && (char.IsLetterOrDigit(s[index]) || "-_".IndexOf(s[index]) >= 0))
            {
                index++;
            }

            return(PassiveExpression.Build(s.Substring(0, index)));
        }
Exemplo n.º 4
0
        public PassiveExpression Dg(PassiveExpression expression)
        {
            // <Dg e.N>
            string strKey = expression.ToString();

            if (BuriedValues.ContainsKey(strKey))
            {
                PassiveExpression result = PassiveExpression.Build(BuriedValues[strKey] as PassiveExpression);
                BuriedValues[strKey] = null;
                BuriedKeys[strKey]   = null;
                return(result);
            }

            return(PassiveExpression.Build());
        }
Exemplo n.º 5
0
        public static PassiveExpression _Br(PassiveExpression expression)
        {
            // <Br e.N '=' e.Expr>, where e.N is expression which does not
            // include '=' on the upper level of the bracket's structure
            Pattern pattern = new Pattern(new ExpressionVariable("Key"), '=', new ExpressionVariable("Value"));

            if (pattern.Match(expression))
            {
                PassiveExpression key    = (PassiveExpression)pattern.GetVariable("Key");
                PassiveExpression value  = (PassiveExpression)pattern.GetVariable("Value");
                string            strKey = key.ToString();

                buriedKeys[strKey]   = key;
                buriedValues[strKey] = value;
            }

            throw new RecognitionImpossibleException("<Br e.N '=' e.Expr>: unexpected arguments");
        }
Exemplo n.º 6
0
        private static PassiveExpression _Transla(PassiveExpression expression)
        {
            Pattern pattern48 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.ML"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), "(".ToCharArray(), new ExpressionVariable("e.2"), new ClosingBrace());

            if (pattern48.Match(expression))
            {
                return(PassiveExpression.Build(_Transla(PassiveExpression.Build(new OpeningBrace(), pattern48.GetVariable("e.ML"), new OpeningBrace(), pattern48.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), pattern48.GetVariable("e.2"), new ClosingBrace()))));
            }
            ;

            Pattern pattern49 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.ML"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.2"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), ")".ToCharArray(), new ExpressionVariable("e.3"), new ClosingBrace());

            if (pattern49.Match(expression))
            {
                return(PassiveExpression.Build(_Transla(PassiveExpression.Build(new OpeningBrace(), pattern49.GetVariable("e.ML"), new OpeningBrace(), pattern49.GetVariable("e.1"), "(".ToCharArray(), pattern49.GetVariable("e.2"), ")".ToCharArray(), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), pattern49.GetVariable("e.3"), new ClosingBrace()))));
            }
            ;

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

            if (pattern50.Match(expression))
            {
                return(PassiveExpression.Build(_Transla(PassiveExpression.Build(new OpeningBrace(), new OpeningBrace(), pattern50.GetVariable("e.1"), ")(".ToCharArray(), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), pattern50.GetVariable("e.2"), new ClosingBrace()))));
            }
            ;

            Pattern pattern51 = new Pattern(new OpeningBrace(), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), ".]".ToCharArray(), new ClosingBrace());

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

            Pattern pattern52 = new Pattern(new OpeningBrace(), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), "]".ToCharArray(), new ClosingBrace());

            if (pattern52.Match(expression))
            {
                return(PassiveExpression.Build(pattern52.GetVariable("e.1"), ")e.MR".ToCharArray()));
            }
            ;

            Pattern pattern53 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.ML"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), "]".ToCharArray(), new ClosingBrace());

            if (pattern53.Match(expression))
            {
                return(PassiveExpression.Build(_Ermes(PassiveExpression.Build("ERROR: Unbalanced left parenth. after pointer".ToCharArray()))));
            }
            ;

            Pattern pattern54 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.ML"), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), new TermVariable("t.A"), new ExpressionVariable("e.2"), new ClosingBrace());

            if (pattern54.Match(expression))
            {
                return(PassiveExpression.Build(_Transla(PassiveExpression.Build(new OpeningBrace(), pattern54.GetVariable("e.ML"), new OpeningBrace(), pattern54.GetVariable("e.1"), pattern54.GetVariable("t.A"), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), pattern54.GetVariable("e.2"), new ClosingBrace()))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 7
0
        private static PassiveExpression _Order(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.2"));

            if (pattern2.Match(expression))
            {
                return(PassiveExpression.Build(_Order1(PassiveExpression.Build(_PreAlph(PassiveExpression.Build(pattern2.GetVariable("s.1"), pattern2.GetVariable("s.2"))), new OpeningBrace(), pattern2.GetVariable("s.1"), new ClosingBrace(), pattern2.GetVariable("s.2")))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 8
0
        private static PassiveExpression _PreAlph(PassiveExpression expression)
        {
            Pattern pattern5 = new Pattern(new SymbolVariable("s.1"), new SymbolVariable("s.1"));

            if (pattern5.Match(expression))
            {
                return(PassiveExpression.Build(true));
            }
            ;

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

            if (pattern6.Match(expression))
            {
                expression = PassiveExpression.Build(_Alphabet(PassiveExpression.Build()));
                Pattern pattern7 = new Pattern(new ExpressionVariable("e.A"), new SymbolVariable("s.1"), new ExpressionVariable("e.B"), new SymbolVariable("s.2"), new ExpressionVariable("e.C"));
                pattern7.CopyBoundVariables(pattern6);
                if (pattern7.Match(expression))
                {
                    return(PassiveExpression.Build(true));
                }
            }
            ;

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 9
0
        private static PassiveExpression _Pal(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern();

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

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

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

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

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

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 10
0
        private static PassiveExpression _AddB(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new OpeningBrace(), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace());

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

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

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

            Pattern pattern4 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), "0".ToCharArray(), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.2"), new SymbolVariable("s.3"), new ClosingBrace());

            if (pattern4.Match(expression))
            {
                return(PassiveExpression.Build(_AddB(PassiveExpression.Build(new OpeningBrace(), pattern4.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern4.GetVariable("e.2"), new ClosingBrace())), pattern4.GetVariable("s.3")));
            }
            ;

            Pattern pattern5 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new SymbolVariable("s.3"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.2"), "0".ToCharArray(), new ClosingBrace());

            if (pattern5.Match(expression))
            {
                return(PassiveExpression.Build(_AddB(PassiveExpression.Build(new OpeningBrace(), pattern5.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern5.GetVariable("e.2"), new ClosingBrace())), pattern5.GetVariable("s.3")));
            }
            ;

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

            if (pattern6.Match(expression))
            {
                return(PassiveExpression.Build(_AddB(PassiveExpression.Build(new OpeningBrace(), "1".ToCharArray(), new ClosingBrace(), new OpeningBrace(), _AddB(PassiveExpression.Build(new OpeningBrace(), pattern6.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern6.GetVariable("e.2"), new ClosingBrace())), new ClosingBrace())), "0".ToCharArray()));
            }
            ;

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

            if (pattern7.Match(expression))
            {
                return(PassiveExpression.Build("** error! **".ToCharArray()));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 11
0
        private static PassiveExpression _Table(PassiveExpression expression)
        {
            Pattern pattern8 = new Pattern();

            if (pattern8.Match(expression))
            {
                return(PassiveExpression.Build(new OpeningBrace(), new OpeningBrace(), "cane".ToCharArray(), new ClosingBrace(), "dog".ToCharArray(), new ClosingBrace(), new OpeningBrace(), new OpeningBrace(), "gatto".ToCharArray(), new ClosingBrace(), "cat".ToCharArray(), new ClosingBrace(), new OpeningBrace(), new OpeningBrace(), "cavallo".ToCharArray(), new ClosingBrace(), "horse".ToCharArray(), new ClosingBrace(), new OpeningBrace(), new OpeningBrace(), "rana".ToCharArray(), new ClosingBrace(), "frog".ToCharArray(), new ClosingBrace(), new OpeningBrace(), new OpeningBrace(), "porco".ToCharArray(), new ClosingBrace(), "pig".ToCharArray(), new ClosingBrace()));
            }
            ;

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

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

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

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

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

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

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

            if (pattern3.Match(expression))
            {
                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. Last expression: " + expression.ToString());
        }
Exemplo n.º 14
0
        private static PassiveExpression _RAdd(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), "0".ToCharArray(), new ClosingBrace());

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

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

            if (pattern3.Match(expression))
            {
                return(PassiveExpression.Build(_RAdd(PassiveExpression.Build(new OpeningBrace(), pattern3.GetVariable("e.1"), new ClosingBrace(), new OpeningBrace(), pattern3.GetVariable("e.2"), new ClosingBrace())), "\'".ToCharArray()));
            }
            ;

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 15
0
		public PassiveExpression Numb(PassiveExpression expression)
		{
			if (expression == null || expression.IsEmpty)
				return PassiveExpression.Build();

			return PassiveExpression.Build(ConvertBigIntegerToRefalNumber(ToBigInteger(expression.ToString())));
		}
Exemplo n.º 16
0
		public PassiveExpression Implode(PassiveExpression expression)
		{
			string s = expression.ToString().Trim();

			int index = 0;
			while (index < s.Length && (char.IsLetterOrDigit(s[index]) || "-_".IndexOf(s[index]) >= 0))
			{
				index++;
			}

			return PassiveExpression.Build(s.Substring(0, index));
		}
Exemplo n.º 17
0
		public PassiveExpression Dg(PassiveExpression expression)
		{
			// <Dg e.N>
			string strKey = expression.ToString();

			if (BuriedValues.ContainsKey(strKey))
			{
				PassiveExpression result = PassiveExpression.Build(BuriedValues[strKey] as PassiveExpression);
				BuriedValues[strKey] = null;
				BuriedKeys[strKey] = null;
				return result;
			}

			return PassiveExpression.Build();
		}
Exemplo n.º 18
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 (pattern9.Match(expression))
            {
                return(PassiveExpression.Build(pattern9.GetVariable("e.Eng")));
            }
            ;

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 19
0
        private static PassiveExpression _Trlmb(PassiveExpression expression)
        {
            Pattern pattern55 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new ExpressionVariable("e.2"), new ClosingBrace(), new ExpressionVariable("e.L"));

            if (pattern55.Match(expression))
            {
                return(PassiveExpression.Build(pattern55.GetVariable("e.1"), ")(".ToCharArray(), _Trlmb(PassiveExpression.Build(new OpeningBrace(), pattern55.GetVariable("e.2"), new ClosingBrace(), pattern55.GetVariable("e.L")))));
            }
            ;

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 20
0
        private static PassiveExpression _Trans__line(PassiveExpression expression)
        {
            Pattern pattern4 = new Pattern(" ".ToCharArray(), new ExpressionVariable("e.X"));

            if (pattern4.Match(expression))
            {
                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 (pattern5.Match(expression))
            {
                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 (pattern6.Match(expression))
            {
                return(PassiveExpression.Build());
            }
            ;

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 21
0
        private static PassiveExpression _Putz(PassiveExpression expression)
        {
            Pattern pattern57 = new Pattern(new SymbolVariable("s.C"), new ExpressionVariable("e.E"));

            if (pattern57.Match(expression))
            {
                return(PassiveExpression.Build(_Destroy(PassiveExpression.Build(_Put(PassiveExpression.Build(pattern57.GetVariable("s.C"), pattern57.GetVariable("e.E")))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 22
0
        private static PassiveExpression _Go(PassiveExpression expression)
        {
            Pattern pattern1 = new Pattern();

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 23
0
        private static PassiveExpression _Destroy(PassiveExpression expression)
        {
            Pattern pattern58 = new Pattern(new ExpressionVariable("e.E"));

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

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

            if (pattern1.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build(_Pal(PassiveExpression.Build("sator arepo tenet opera rotas".ToCharArray()))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 25
0
        private static PassiveExpression _Ermes(PassiveExpression expression)
        {
            Pattern pattern59 = new Pattern(new ExpressionVariable("e.X"));

            if (pattern59.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build(_Put(PassiveExpression.Build(2, pattern59.GetVariable("e.X")))))));
            }
            ;

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

            if (pattern1.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("0 + 0 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "0".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("0 + 1 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "0".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "1".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("1 + 0 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "1".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("1 + 1 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "1".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "1".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("10 + 01 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "10".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "01".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("1011 + 0110 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "1011".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0110".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("101100001 + 10110101 =", _AddB(PassiveExpression.Build(new OpeningBrace(), "101100001".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "10110101".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("asdbn + ddd =", _AddB(PassiveExpression.Build(new OpeningBrace(), "asdbn".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "ddd".ToCharArray(), new ClosingBrace()))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 27
0
        private static PassiveExpression _Mbprep(PassiveExpression expression)
        {
            Pattern pattern6 = new Pattern(0);

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

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

            if (pattern7.Match(expression))
            {
                expression = PassiveExpression.Build(_Lookm0(PassiveExpression.Build(pattern7.GetVariable("e.1"))));
                {
                    Pattern pattern8 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.A"), new ClosingBrace(), "[".ToCharArray(), new ExpressionVariable("e.B"));
                    pattern8.CopyBoundVariables(pattern7);
                    if (pattern8.Match(expression))
                    {
                        return(PassiveExpression.Build(_Out(PassiveExpression.Build(pattern8.GetVariable("e.A"), _Lookp(PassiveExpression.Build(new OpeningBrace(), new OpeningBrace(), "[".ToCharArray(), new ClosingBrace(), new ClosingBrace(), new OpeningBrace(), pattern8.GetVariable("e.B"), new ClosingBrace()))))));
                    }
                    ;

                    Pattern pattern9 = new Pattern(new ExpressionVariable("e.1"));
                    pattern9.CopyBoundVariables(pattern7);
                    if (pattern9.Match(expression))
                    {
                        return(PassiveExpression.Build(_Putz(PassiveExpression.Build(2, pattern9.GetVariable("e.1"))), _Mbprep(PassiveExpression.Build(_Next(PassiveExpression.Build())))));
                    }
                    ;

                    throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
                }
            }
            ;

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

            if (pattern1.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build(_Order(PassiveExpression.Build("x".ToCharArray(), "r".ToCharArray()))))));
            }
            ;

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

            if (pattern1.Match(expression))
            {
                return(PassiveExpression.Build(_Open(PassiveExpression.Build("r".ToCharArray(), "File", "test09.ref")), _Output(PassiveExpression.Build(new OpeningBrace(), new ClosingBrace(), new OpeningBrace(), "File", new ClosingBrace()))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 30
0
        private static PassiveExpression _Order1(PassiveExpression expression)
        {
            Pattern pattern3 = new Pattern(true, new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new ExpressionVariable("e.2"));

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

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

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

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 31
0
        private static PassiveExpression _Output(PassiveExpression expression)
        {
            Pattern pattern2 = new Pattern(new OpeningBrace(), new ClosingBrace(), new OpeningBrace(), new SymbolVariable("s.D"), new ClosingBrace());

            if (pattern2.Match(expression))
            {
                return(PassiveExpression.Build(_Output(PassiveExpression.Build(new OpeningBrace(), _Get(PassiveExpression.Build(pattern2.GetVariable("s.D"))), new ClosingBrace(), new OpeningBrace(), pattern2.GetVariable("s.D"), new ClosingBrace()))));
            }
            ;

            Pattern pattern3 = new Pattern(new OpeningBrace(), 0, new ClosingBrace(), new OpeningBrace(), new SymbolVariable("s.D"), new ClosingBrace());

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

            Pattern pattern4 = new Pattern(new OpeningBrace(), new ExpressionVariable("e.1"), new ClosingBrace(), new OpeningBrace(), new SymbolVariable("s.D"), new ClosingBrace());

            if (pattern4.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build(pattern4.GetVariable("e.1"))), _Output(PassiveExpression.Build(new OpeningBrace(), _Get(PassiveExpression.Build(pattern4.GetVariable("s.D"))), new ClosingBrace(), new OpeningBrace(), pattern4.GetVariable("s.D"), new ClosingBrace()))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }
Exemplo n.º 32
0
        private static PassiveExpression _Alphabet(PassiveExpression expression)
        {
            Pattern pattern9 = new Pattern();

            if (pattern9.Match(expression))
            {
                return(PassiveExpression.Build("abcdefghijklmnopqrstuvwxyz".ToCharArray()));
            }
            ;

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

            if (pattern1.Match(expression))
            {
                return(PassiveExpression.Build(_Prout(PassiveExpression.Build("0 + 0 = ", _RAdd(PassiveExpression.Build(new OpeningBrace(), "0".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("0\' + 0 = ", _RAdd(PassiveExpression.Build(new OpeningBrace(), "0\'".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("0 + 0\' = ", _RAdd(PassiveExpression.Build(new OpeningBrace(), "0".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0\'".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("0\' + 0\' = ", _RAdd(PassiveExpression.Build(new OpeningBrace(), "0\'".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0\'".ToCharArray(), new ClosingBrace())))), _Prout(PassiveExpression.Build("0\'\' + 0\'\'\' = ", _RAdd(PassiveExpression.Build(new OpeningBrace(), "0\'\'".ToCharArray(), new ClosingBrace(), new OpeningBrace(), "0\'\'\'".ToCharArray(), new ClosingBrace()))))));
            }
            ;

            throw new RecognitionImpossibleException("Recognition impossible. Last expression: " + expression.ToString());
        }