示例#1
1
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            NoteCalls (this.rand1);
            rand0TypeHistogram.Note (this.rand0Type);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PCondRecordRef";
            #endif
            Control unev = this.rand1;
            Environment env = environment;
            object ev1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PCondRecordRef";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
            }

            unev = this.rand0;
            env = environment;
            object ev0;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PCondRecordRef";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination1Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            object result = ((Record) ev0).Ref ((int) ev1);

            if (result is Boolean && (((bool) result) == false)) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "PCondRecordRef";
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            } else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondRecordRef";
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsCharEqA.EvalStep");
     #endif
     throw new NotImplementedException ();
 }
示例#3
1
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PrimitiveIsCharEqQ";
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }
            //bool x = (ev1 is char);
            //bool y = (ev1 is Character);
            //if (x != y) Debugger.Break ();
            answer = ((ev1 is char) && (this.rand0Value == (char) ev1)) ? Constant.sharpT : Constant.sharpF;
            return false;
        }
示例#4
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rator);
            NoteCalls (this.rand0);
            NoteCalls (this.rand1);
            ratorTypeHistogram.Note (this.ratorType);
            rand0TypeHistogram.Note (this.rand0Type);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "Let2";
            #endif
            object ev1;
            Environment env = environment;
            Control unev = this.rand1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "Let2";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new Combination2Frame0 (this, environment));
                environment = env;
                answer = Interpreter.UnwindStack;
                return false;
            }

            object ev0;
            env = environment;
            unev = this.rand0;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "Let2";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new Combination2Frame1 (this, environment, ev1));
                environment = env;
                answer = Interpreter.UnwindStack;
                return false;
            }

            object evop;
            env = environment;
            unev = this.rator;
            while (unev.EvalStep (out evop, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "Let2";
            #endif
            if (evop == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new Combination2Frame2 (this, environment, ev0, ev1));
                environment = env;
                answer = Interpreter.UnwindStack;
                return false;
            }

            return Interpreter.Call (out answer, ref expression, ref environment, evop, ev0, ev1);
        }
示例#5
0
        public override bool EvalStep (out object answer, ref Control expression, ref Environment environment)
        {
#if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            NoteCalls (this.rand1);
            rand0TypeHistogram.Note (this.rand0Type);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PCondIsEq";
#endif
            Control unev = this.rand1;
            Environment env = environment;
            object ev1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
#if DEBUG
            SCode.location = "PCondIsEq";
#endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
            }

            unev = this.rand0;
            env = environment;
            object ev0;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
#if DEBUG
            SCode.location = "PCondIsEq";
#endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination1Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

#if DEBUG
            SCode.location = "PCondIsEq";
#endif
            if (ObjectModel.SchemeEq (ev0, ev1)) {
#if DEBUG
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
#endif
                expression = this.consequent;
            }
            else {
#if DEBUG
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
#endif
                expression = this.alternative;
            }
            answer = null; // happy compiler
            return true;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg0);
            NoteCalls (this.arg1);
            NoteCalls (this.arg2);
            rand0TypeHistogram.Note (this.rand0Type);
            rand1TypeHistogram.Note (this.rand1Type);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveVectorSet";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveVectorSet";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev1;
            env = environment;
            unev = this.arg1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveVectorSet";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame1 (this, environment, ev2));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev0;
            env = environment;
            unev = this.arg0;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };

            #if DEBUG
            SCode.location = "PrimitiveVectorSet";
            #endif
            if (ev0 == Interpreter.UnwindStack) throw new NotImplementedException ();

            answer = ((object []) ev0) [(int) ev1];
            ((object []) ev0) [(int) ev1] = ev2;

            return false;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            rand0TypeHistogram.Note (this.rand0Type);
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PrimitiveLessThan";
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveLessThan";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Eval argument0
            object ev0;

            unev = this.rand0;
            env = environment;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveLessThan";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // less-than-fixnum?
            // Shortcut for fixnums
            if (ev0 is int && ev1 is int) {
                answer = ((int) ev0 < (int) ev1) ? Constant.sharpT : Constant.sharpF;
                return false;
            }
            else
                answer = new TailCallInterpreter (CallFromPrimitive.Make ((IApplicable) FixedObjectsVector.GenericLessP, ev0, ev1), null);
            return true;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            rand0TypeHistogram.Note (this.rand0Type);
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PrimitiveVector8BRef";
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveVector8BRef";
            #endif

            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Eval argument0
            object ev0;

            unev = this.rand0;
            env = environment;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveVector8BRef";
            #endif

            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Vector-8b-ref
            answer = (int) ((char []) ev0) [(int) ev1];
            return false;
        }
示例#9
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg0);
            arg0TypeHistogram.Note (this.arg0Type);
            SCode.location = "PCondIsNull";
            #endif
            Control unev0 = this.arg0;
            Environment env = environment;
            object ev0;
            while (unev0.EvalStep (out ev0, ref unev0, ref env)) { };
            #if DEBUG
            SCode.location = "PCondIsNull";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveIsNullFrame0 (this, closureEnvironment));
                //answer = Interpreter.Unwind;
                //closureEnvironment = env;
                //return false;
            }

            if (ev0 == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNull";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "PCondIsNull";
            #endif
                expression = this.alternative;
                answer = null; // keep c# compiler happy
                return true;
            }
        }
示例#10
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCond2L.EvalStep");
            #endif
            object ev1;
            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException();
            }

            object ev0;
            if (environment.FastLexicalRef (out ev0, this.rand0Name, this.rand0Depth, this.rand0Offset))
                throw new NotImplementedException();

            #if DEBUG
            Primitive.hotPrimitives.Note (this.procedure);
            #endif
            if (this.method (out answer, ev0, ev1)) {
                TailCallInterpreter tci = answer as TailCallInterpreter;
                if (tci != null) {
                    answer = null; // dispose of the evidence
                    // set up the interpreter for a tail call
                    Control cExpression = tci.Expression;
                    Environment cEnvironment = tci.Environment;
                    while (cExpression.EvalStep (out answer, ref cExpression, ref cEnvironment)) { };
                }
            }

            if ((answer is bool) && (bool) answer == false) {
            #if DEBUG
                noteCalls (this.alternative);
            #endif
                expression = this.alternative;
                return true;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
            #endif
                expression = this.consequent;
                return true;
            }
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #region EvalStepBody
            #if DEBUG
            Warm ();
            noteCalls (this.arg0);
            procedureHistogram.Note (this.procedure);
            arg0TypeHistogram.Note (this.arg0Type);
            #endif
            Control unev0 = this.arg0;
            Environment env = environment;
            object ev0;
            while (unev0.EvalStep (out ev0, ref unev0, ref env)) { };
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveIsVectorFrame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            if (!(ev0 is object [])) {
            #if DEBUG
                noteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
            #endregion
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ();
            noteCalls (this.rand0);
            noteCalls (this.rand1);
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Eval argument0
            object ev0;

            unev = this.rand0;
            env = environment;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Compute answer
            if (Cons.GeneralCarCdr (out answer, ev0, ev1))
                throw new NotImplementedException ();
            return false;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveIsFixnumEqual.EvalStep");
            noteCalls (this.rand0);
            noteCalls (this.rand1);
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Eval argument0
            object ev0;

            unev = this.rand0;
            env = environment;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            answer = (int) ev0 == (int) ev1 ? Constant.sharpT : Constant.sharpF;
            return false;
        }
示例#14
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondIsSymbolLQ.EvalStep");
            #endif
            object ev0;
            if (environment.FastLexicalRef (out ev0, this.predicateName, this.predicateDepth, this.predicateOffset))
                throw new NotImplementedException ();

            if (!(ev0 is Symbol)) {
            #if DEBUG
                noteCalls (this.alternative);
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
            else {
                answer = this.consequentValue;
                return true;
            }
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PrimitiveRecordSetSQS";
            #endif
            object ev2;
            if (environment.StaticValue (out ev2, this.rand2Name, this.rand2Offset))
                throw new NotImplementedException ();

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            answer = ((Record) ev0).Set (this.rand1Value, ev2);
            return false;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg2);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveRecordSetA0Q";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveRecordSetA0Q";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            answer = ((Record) environment.Argument0Value).Set (this.rand1Value, ev2);
            return false;
        }
示例#17
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PCondIsNullAS");
     #endif
     if (environment.ArgumentValue(this.predicateArgumentOffset) == null) {
         if (environment.StaticValue (out answer, this.consequentName, this.consequentOffset))
             throw new NotImplementedException ();
         return false;
     }
     else {
     #if DEBUG
         SCode.location = "-";
         NoteCalls (this.alternative);
         alternativeTypeHistogram.Note (this.alternativeType);
         SCode.location = "PCondIsNullAS";
     #endif
         expression = this.alternative;
         answer = null; // keep c# compiler happy
         return true;
     }
 }
示例#18
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondIsNullSXQ");
            #endif
            object ev0;
            if (environment.StaticValue (out ev0, this.predicateRandName, this.predicateRandOffset))
                throw new NotImplementedException ();

            if (ev0 == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNullSXQ";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
                answer = this.alternativeValue;
                return false;
            }
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveStringSetSQQ");
            #endif
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object ev1 = this.rand1Value;
            object ev2 = this.rand2Value;
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg1);
            NoteCalls (this.arg2);
            rand1TypeHistogram.Note (this.rand1Type);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveStringSetA0";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetA0";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev1;
            env = environment;
            unev = this.arg1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetA0";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame1 (this, environment, ev2));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev0 = environment.Argument0Value;
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg2);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveStringSetSQ";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetSQ";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object ev1 = this.rand1Value;
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
示例#22
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ();
            noteCalls (this.arg0);
            #endif
            Control unev0 = this.arg0;
            Environment env = environment;
            object ev0;
            while (unev0.EvalStep (out ev0, ref unev0, ref env)) { };
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveIsSymbolFrame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            if (!(ev0 is Symbol)) {
                answer = this.alternativeValue;
                return false;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
示例#23
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     throw new NotImplementedException ();
     //#if DEBUG
     //            Warm ("-");
     //            SCode.location = "PCondIsNullA";
     //#endif
     //            if (environment.ArgumentValue (this.predicateArgumentOffset) == null) {
     //#if DEBUG
     //                SCode.location = "-";
     //                NoteCalls (this.alternative);
     //                alternativeTypeHistogram.Note (this.alternativeType);
     //                SCode.location = "PCondIsNullA";
     //#endif
     //                expression = this.alternative;
     //	        answer = null; // keep c# compiler happy
     //                return true;
     //            }
     //            else {
     //#if DEBUG
     //                SCode.location = "-";
     //                NoteCalls (this.consequent);
     //                consequentTypeHistogram.Note (this.consequentType);
     //                SCode.location = "PCondIsNullA";
     //#endif
     //                expression = this.consequent;
     //	        answer = null; // keep c# compiler happy
     //                return true;
     //            }
 }
示例#24
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ();
            #endif
            object ev0 = environment.Argument1Value;

            if (!(ev0 is Symbol)) {

                answer = this.alternativeValue;
                return false;
            }
            else {
                if (environment.FastLexicalRef (out answer, this.consequentName, this.consequentDepth, this.consequentOffset))
                    throw new NotImplementedException ();
                return false;
            }
        }
示例#25
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PCondIsNullA0A0");
     #endif
     if (environment.Argument0Value == null) {
         answer = null;
         return false;
     }
     else {
     #if DEBUG
         SCode.location = "-";
         NoteCalls (this.alternative);
         alternativeTypeHistogram.Note (this.alternativeType);
         SCode.location = "PCondIsNullA0A0";
     #endif
         expression = this.alternative;
         answer = null; // keep c# compiler happy
         return true;
     }
 }
示例#26
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #region EvalStepBody
            #if DEBUG
            Warm ();
            #endif
            object ev0 = environment.Argument1Value;

            if (!(ev0 is Symbol)) {
                if (environment.FastLexicalRef (out answer, this.alternativeName, this.alternativeDepth, this.alternativeOffset))
                    throw new NotImplementedException ();
                return false;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);

            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
            #endregion
        }
示例#27
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondIsNullA0XA0");
            #endif
            object ev0 = environment.Argument0Value;

            if (ev0 == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNullA0XA0";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
                answer = ev0;
                return false;
            }
        }
示例#28
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ();
            #endif
            object ev0 = environment.Argument1Value;

            if (!(ev0 is Symbol)) {

                answer = this.alternativeValue;
                return false;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
示例#29
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondIsNullAXQ");
            #endif
            if (environment.ArgumentValue (this.predicateArgumentOffset) == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNullAXQ";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
                answer = this.alternativeValue;
                return false;

            }
        }
示例#30
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     throw new NotImplementedException ();
 }