示例#1
0
 public DSString(StackValue[] values, Heap heap)
     : base(values, heap)
 {
     MetaData = new MetaData { type = (int)PrimitiveType.String };
 }
示例#2
0
 public DSObject(StackValue[] values, Heap heap)
     : base(values, heap)
 {
     MetaData = new MetaData { type = (int)PrimitiveType.Pointer };
 }
示例#3
0
 public DSString(int size, Heap heap)
     : base(size, heap)
 {
     MetaData = new MetaData { type = (int)PrimitiveType.String };
 }
示例#4
0
 /// <summary>
 /// Create an array and populuate with input values
 /// </summary>
 /// <param name="values"></param>
 /// <param name="heap"></param>
 public DSArray(StackValue[] values, Heap heap)
     : base(values, heap)
 {
     Dict = new Dictionary<StackValue, StackValue>();
     MetaData = new MetaData { type = (int)PrimitiveType.Array };
 }
示例#5
0
 public DSObject(int size, Heap heap)
     : base(size, heap)
 {
     MetaData = new MetaData { type = (int)PrimitiveType.Pointer };
 }
示例#6
0
 public static StackValue BuildPointer(Int64 data, MetaData mdata)
 {
     StackValue value = new StackValue();
     value.optype = AddressType.Pointer;
     value.opdata = data;
     value.metaData = mdata;
     return value;
 }
示例#7
0
        public static StackValue BulildInvalid()
        {
            StackValue value = new StackValue();
            value.optype = AddressType.Invalid;
            value.opdata = -1;

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.kInvalidType;
            value.metaData = mdata;

            return value;
        }
示例#8
0
        public static StackValue BuildChar(char ch)
        {
            StackValue value = new StackValue();
            value.optype = AddressType.Char;
            value.opdata = Convert.ToInt64(ch);

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.kTypeChar;
            value.metaData = mdata;
            return value;
        }
示例#9
0
 public static StackValue BuildNull()
 {
     StackValue value = new StackValue();
     value.optype = AddressType.Null;
     value.opdata = 0;
     MetaData mdata = new MetaData();
     mdata.type = (int)PrimitiveType.kTypeNull;
     value.metaData = mdata;
     return value;
 }
示例#10
0
        public static StackValue BuildDouble(double data)
        {
            StackValue value = new StackValue();
            value.optype = AddressType.Double;
            value.opdata_d = data;

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.kTypeDouble;
            value.metaData = mdata;
            return value;
        }
示例#11
0
        public static StackValue BuildInt(Int64 data)
        {
            StackValue value = new StackValue();
            value.optype = AddressType.Int;
            value.opdata = data;

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.kTypeInt;
            value.metaData = mdata;
            return value;
        }
示例#12
0
        public static StackValue BuildDouble(double data)
        {
            StackValue value = new StackValue();
            value.optype = AddressType.Double;
            value.opdata = BitConverter.DoubleToInt64Bits(data);

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.Double;
            value.metaData = mdata;
            return value;
        }
示例#13
0
 public DSArray(int size, Heap heap)
     : base(size, heap)
 {
     Dict = new Dictionary<StackValue, StackValue>();
     MetaData = new MetaData { type = (int)PrimitiveType.kTypeArray };
 }
示例#14
0
        public static StackValue BuildChar(char ch)
        {
            StackValue value = new ProtoCore.DSASM.StackValue();
            value.optype = ProtoCore.DSASM.AddressType.Char;
            value.opdata = ProtoCore.Utils.EncodingUtils.ConvertCharacterToInt64(ch);
            value.opdata_d = value.opdata;

            MetaData mdata = new MetaData();
            mdata.type = (int)PrimitiveType.kTypeChar;
            value.metaData = mdata;
            return value;
        }