Beispiel #1
0
 public int EvalInt(Vm vm)
 {
     return(var?.EvalInt(vm) ??
            number?.EvalInt(vm) ??
            expr?.EvalInt(vm) ??
            rnd.EvalInt(vm));
 }
Beispiel #2
0
        public void ExecuteIn(Vm vm)
        {
            var   lhs = lhExpr.EvalInt(vm);
            RelOp relOp;

            if (relop.s == ">")
            {
                relOp = new GT();
            }
            else if (relop.s == ">=")
            {
                relOp = new GTE();
            }
            else if (relop.s == "<")
            {
                relOp = new LT();
            }
            else if (relop.s == "<=")
            {
                relOp = new LTE();
            }
            else if (relop.s == "<>")
            {
                relOp = new NEQ();
            }
            else
            {
                relOp = new EQ();
            }
            var rhs  = rhExpr.EvalInt(vm);
            var pass = relOp.Execute(lhs, rhs);

            if (pass)
            {
                statement.Command.ExecuteIn(vm);
            }
        }
Beispiel #3
0
 public void ExecuteIn(Vm vm)
 {
     vm[var.Name] = expr.EvalInt(vm);
 }
Beispiel #4
0
        public void ExecuteIn(Vm vm)
        {
            var lineNumber = expr.EvalInt(vm);

            vm.Gosub(lineNumber);
        }
Beispiel #5
0
        public int EvalInt(Vm vm)
        {
            var ulim = expr.EvalInt(vm);

            return(vm.Random(ulim));
        }