示例#1
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
#if DEBUG
            Warm("-");
            NoteCalls(this.rand1);
            SCode.location = "PrimitiveIsObjectTypeQ";
#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 = "PrimitiveIsObjectTypeQ";
#endif
            if (ev1 == Interpreter.UnwindStack)
            {
                throw new NotImplementedException();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            if (ObjectModel.IsPrimitiveObjectType(out answer, this.rand0Value, ev1))
            {
                throw new NotImplementedException();
            }
            return(false);
        }
示例#2
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 = "PCondIsObjectType";
#endif
            Control     unev = this.rand1;
            Environment env  = environment;
            object      ev1;
            while (unev.EvalStep(out ev1, ref unev, ref env))
            {
            }
            ;
            if (ev1 == Interpreter.UnwindStack)
            {
                throw new NotImplementedException();
            }

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

            ObjectModel.IsPrimitiveObjectType(out answer, ev0, ev1);

            if ((answer is bool) && (bool)answer == false)
            {
#if DEBUG
                NoteCalls(this.alternative);
                alternativeTypeHistogram.Note(this.alternativeType);
#endif
                expression = this.alternative;
                return(true);
            }
            else
            {
#if DEBUG
                NoteCalls(this.consequent);
                consequentTypeHistogram.Note(this.consequentType);
#endif
                expression = this.consequent;
                return(true);
            }
        }
示例#3
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
#if DEBUG
            Warm("-");
            tcHistogram.Note(this.rand0Value);
            SCode.location = "PrimitiveIsObjectTypeQA";
#endif
            // Eval argument1
            object ev1 = environment.ArgumentValue(this.rand1Offset);

            if (ObjectModel.IsPrimitiveObjectType(out answer, this.rand0Value, ev1))
            {
                throw new NotImplementedException();
            }
            return(false);
        }
示例#4
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
#if DEBUG
            Warm("-");
            NoteCalls(this.rand1);
            rand0Histogram.Note(this.rand0Value);
            rand1TypeHistogram.Note(this.rand1Type);
            SCode.location = "PCondIsObjectTypeQ.EvalStep";
#endif
            Control     unev = this.rand1;
            Environment env  = environment;
            object      ev1;
            while (unev.EvalStep(out ev1, ref unev, ref env))
            {
            }
            ;
            if (ev1 == Interpreter.UnwindStack)
            {
                throw new NotImplementedException();
            }

            ObjectModel.IsPrimitiveObjectType(out answer, this.rand0Value, ev1);

            if ((answer is bool) && (bool)answer == false)
            {
#if DEBUG
                NoteCalls(this.alternative);
                alternativeTypeHistogram.Note(this.alternativeType);
#endif
                expression = this.alternative;
                return(true);
            }
            else
            {
#if DEBUG
                NoteCalls(this.consequent);
                consequentTypeHistogram.Note(this.consequentType);
#endif
                expression = this.consequent;
                return(true);
            }
        }