示例#1
0
文件: VALL.cs 项目: liusj666/AxNew
        public VAL GetValData()
        {
            VALL L = new VALL();

            L.Add(new VAL(ty.FullName));
            L.Add(new VAL(this));
            return(new VAL(L));
        }
示例#2
0
文件: VALL.cs 项目: liusj666/AxNew
        //Add Association
        public VALL Add(string key, VAL val)
        {
            VALL L = new VALL();

            L.Add(new VAL(key));
            L.Add(val);
            list.Add(new VAL(L));
            return(this);
        }
示例#3
0
        private void Callback(object sender, EventArgs e)
        {
            VALL L = new VALL();

            L.Add(VAL.NewHostType(sender));
            L.Add(VAL.NewHostType(e));
            VAL arguments = new VAL(L);

            ret = CPU.ExternalUserFuncCall(func, instance, arguments, context);
        }
示例#4
0
        private Computer()
        {
            ds1 = new Memory();
            ds2 = new Memory();

            register("object", typeof(object));
            register("bool", typeof(bool));

            register("sbyte", typeof(sbyte));
            register("byte", typeof(byte));
            register("short", typeof(short));
            register("ushort", typeof(ushort));
            register("int", typeof(int));
            register("uint", typeof(uint));
            register("long", typeof(long));
            register("ulong", typeof(ulong));

            register("double", typeof(double));
            register("float", typeof(float));
            register("decimal", typeof(decimal));

            register("char", typeof(char));
            register("string", typeof(string));



            VALL L = new VALL();

            L.Add("VOID", new VAL((int)VALTYPE.voidcon));
            L.Add("NULL", new VAL((int)VALTYPE.nullcon));
            L.Add("BOOL", new VAL((int)VALTYPE.boolcon));
            L.Add("INT", new VAL((int)VALTYPE.intcon));
            L.Add("DOUBLE", new VAL((int)VALTYPE.doublecon));
            L.Add("STRING", new VAL((int)VALTYPE.stringcon));
            L.Add("LIST", new VAL((int)VALTYPE.listcon));
            L.Add("FUNCTION", new VAL((int)VALTYPE.funccon));
            L.Add("CLASS", new VAL((int)VALTYPE.classcon));
            L.Add("HOST", new VAL((int)VALTYPE.hostcon));

            ds1.Add("TYPE", new VAL(L));


            //HostType.Register(new Type[]
            //{
            //    typeof(DateTime),
            //    typeof(string),
            //    typeof(System.Reflection.Assembly),
            //    typeof(Tie.HostType)
            //}, true);
        }
示例#5
0
文件: CPU.cs 项目: liusj666/AxNew
        private void paramsArray(int argc1, int argc2)
        {
            int diff = argc1 - argc2;

            VAL retAddr = SS.Pop();

            VALL L1 = new VALL();

            for (int i = 0; i < argc2 - 1; i++)
            {
                L1.Insert(SS.Pop());
            }

            VALL L2 = new VALL();

            for (int i = 0; i <= diff; i++)
            {
                L2.Add(SS.Pop());
            }
            SS.Push(new VAL(L2));

            for (int i = 0; i < argc2 - 1; i++)
            {
                SS.Push(L1[i]);
            }

            SS.Push(retAddr);

            CS[retAddr.Intcon].operand.Addr += diff;
        }
示例#6
0
文件: VALL.cs 项目: liusj666/AxNew
        public VALL Slice(int start, int stop, int step)
        {
            VALL L = new VALL();

            for (int i = start; i <= Pos(stop); i += step)
            {
                L.Add(VAL.Clone(list[i]));
            }
            return(L);
        }
示例#7
0
文件: CPU.cs 项目: liusj666/AxNew
        private VALL SysFuncBeginParameter()
        {
            int  count = SysFuncBegin();
            VALL L     = new VALL();

            for (int i = 0; i < count; i++)
            {
                L.Add(SysFuncParam(i));
            }

            return(L);
        }
示例#8
0
        public static VAL OperatorOverloading(Operator opr, VAL v1, VAL v2, bool silent)
        {
            VALL L = new VALL();

            L.Add(v1);

            if ((object)v2 != null)
            {
                L.Add(v2);
            }

            HostFunction hFunc = new HostFunction(v1.value, opr.ToString(), L);

            if (silent)
            {
                return(hFunc.RunFunctionSilently(null));
            }
            else
            {
                return(hFunc.RunFunction(null));
            }
        }
示例#9
0
        internal static VAL Assemble(Memory memory)
        {
            VALL L = new VALL();

            foreach (KeyValuePair <string, VAL> pair in memory.ds)
            {
                //if (pair.Value.ty == VALTYPE.funccon || pair.Value.ty == VALTYPE.classcon)
                //    continue;

                L.Add(pair.Key, pair.Value);
            }
            return(new VAL(L));
        }