Ejemplo n.º 1
0
        public override string ToString()
        {
            var oDataQueryParts = new List <string>(10)
            {
                FormatPredicate.ToString()
            };

            if (CountPredicate != null)
            {
                oDataQueryParts.Add(CountPredicate.ToString());
            }

            if (ExpandPredicate != null)
            {
                oDataQueryParts.Add(ExpandPredicate.ToString());
            }

            if (FilterPredicate != null)
            {
                oDataQueryParts.Add(FilterPredicate.ToString());
            }

            if (OrderByPredicate != null)
            {
                oDataQueryParts.Add(OrderByPredicate.ToString());
            }

            if (SelectPredicate != null)
            {
                oDataQueryParts.Add(SelectPredicate.ToString());
            }

            if (SkipPredicate != null)
            {
                oDataQueryParts.Add(SkipPredicate.ToString());
            }

            if (SkipTokenPredicate != null)
            {
                oDataQueryParts.Add(SkipTokenPredicate.ToString());
            }

            if (TopPredicate != null)
            {
                oDataQueryParts.Add(TopPredicate.ToString());
            }

            if (InlineCountPredicate != null)
            {
                oDataQueryParts.Add(InlineCountPredicate.ToString());
            }

            return($"?{String.Join("&", oDataQueryParts)}");
        }
Ejemplo n.º 2
0
        private void InstallLocalPredicates()
        {
            // Input/Output
            _predicates["write/1"]   = new WritePredicate();
            _predicates["writeln/1"] = new WriteLnPredicate();
            _predicates["nl/0"]      = new NlPredicate();
            _predicates["get0/1"]    = new Get0Predicate();
            _predicates["skip/1"]    = new SkipPredicate();
            _predicates["put/1"]     = new PutPredicate();

            // Comparison, numeric
            _predicates["=\\=/2"] = new NotEqualsPredicate();
            _predicates["=:=/2"]  = new EqualsPredicate();
            _predicates[">=/2"]   = new GreaterThanEqualPredicate();
            _predicates[">/2"]    = new GreaterThanPredicate();
            _predicates["=</2"]   = new LessThanEqualPredicate();
            _predicates["</2"]    = new LessThanPredicate();

            // Control
            _predicates["call/1"] = new CallPredicate();

            // Equality
            _predicates["=/2"]   = new UnifyPredicate();
            _predicates["\\=/2"] = new NotUnifiablePredicate();

            // Meta
            _predicates["is/2"]      = new IsPredicate();
            _predicates["atom/1"]    = new AtomPredicate();
            _predicates["bound/1"]   = new BoundPredicate();
            _predicates["char/1"]    = new CharPredicate();
            _predicates["free/1"]    = new FreePredicate();
            _predicates["integer/1"] = new IntegerPredicate();
            _predicates["nonvar/1"]  = new NonVarPredicate();
            _predicates["var/1"]     = new VarPredicate();

            // Object-Oriented Programming
            _predicates["object/2"]       = new object_2();
            _predicates["invoke/3"]       = new invoke_2();
            _predicates["get_property/3"] = new get_property_3();

            // .NET Reflection
        }