Пример #1
0
 public static SCode Make(object rator, object rand0, object rand1, object rand2)
 {
     return
         (Combination3.Make(EnsureSCode(rator),
                            EnsureSCode(rand0),
                            EnsureSCode(rand1),
                            EnsureSCode(rand2)));
 }
Пример #2
0
        internal override PartialResult PartialEval(PartialEnvironment environment)
        {
            PartialResult rator = this.components [0].PartialEval(environment);
            PartialResult rand0 = this.components [1].PartialEval(environment);
            PartialResult rand1 = this.components [2].PartialEval(environment);
            PartialResult rand2 = this.components [3].PartialEval(environment);

            return(new PartialResult(rator.Residual == this.components [0] &&
                                     rand0.Residual == this.components [1] &&
                                     rand1.Residual == this.components [2] &&
                                     rand2.Residual == this.components [3] ? this : Combination3.Make(rator.Residual, rand0.Residual, rand1.Residual, rand2.Residual)));
        }
Пример #3
0
        public static SCode Make(object [] components)
        {
            return
                ((!Configuration.EnableCombinationOptimization) ? new Combination(components) :
                 (Configuration.EnableCombination0 && components.Length == 1) ? Combination0.Make(components[0]) :
                 (Configuration.EnableCombination3 && components.Length == 4) ? Combination3.Make(components[0], components[1], components[2], components[3]) :
                 new Combination(components));

            //if (Configuration.EnableSuperOperators) {
            //    switch (components.Length) {
            //        case 0:
            //            throw new NotImplementedException ("shouldn't be possible");

            //        //case 1:
            //        //    //Debugger.Break ();
            //        //    return Combination0.Make (oper);

            //        case 2:
            //            throw new NotImplementedException ("combo 1");

            //        case 3:
            //            throw new NotImplementedException ("combo 2");

            //        case 4:
            //            return Configuration.EnableCombination3 ?
            //                   Combination3.Make (EnsureSCode (oper),
            //                                      EnsureSCode (components [1]),
            //                                      EnsureSCode (components [2]),
            //                                      EnsureSCode (components [3])) :
            //                  new Combination (components);

            //        default:
            //            return new Combination (components);
            //    }
            //}
            //else
            //    return new Combination (components);
        }