Пример #1
0
        public override int GenerateCode(int loc, IVirtualMachine vm, CheckerInformation info)
        {
            loc = Expr.GenerateCode(loc, vm, info);

            var type = GetExpressionType(info);

            if (type == Type.INT32)
            {
                vm.IntInv(loc++);
            }
            else if (type == Type.DECIMAL)
            {
                vm.DecimalInv(loc++);
            }
            else
            {
                throw new IVirtualMachine.InternalError(
                          "Cannot inverse " + type.ToString() + " value " + Expr.ToString());
            }

            return(loc);
        }