Esempio n. 1
0
        public override void RecursivelyResolve(Dictionary <string, DataDefinition> local, Dictionary <string, DataDefinition> global, Dictionary <string, Dictionary <string, DataDefinition> > referenceableDefinitions)
        {
            if (Key != null)
            {
                var key = Key.ToLower();

                Dictionary <string, DataDefinition> defs = null;
                if (local.ContainsKey(key))
                {
                    defs = local;
                }
                else if (global.ContainsKey(key))
                {
                    defs = global;
                }

                if (defs != null)
                {
                    var def = defs[key] as EnumDefinition;
                    FlagValues = def.EnumValues;
                    if (!FlagValues.Contains(Default))
                    {
                        Default = FlagValues[0];
                    }
                }
                else
                {
                    Message.Show("Failed to find key " + Key + "!", "Reference Resolve Failed", "Ok");
                }
            }
        }
Esempio n. 2
0
        protected override void DoRecursivelyResolve(Dictionary <string, DataDefinition> local, Dictionary <string, DataDefinition> global, Dictionary <string, Dictionary <string, DataDefinition> > referenceableDefinitions)
        {
            if (Key != null)
            {
                var key = Key.ToLower();

                Dictionary <string, DataDefinition> defs = null;
                if (local.ContainsKey(key))
                {
                    defs = local;
                }
                else if (global.ContainsKey(key))
                {
                    defs = global;
                }

                if (defs != null)
                {
                    var def = defs[key] as EnumDefinition;
                    FlagValues = def.EnumValues;
                    if (!FlagValues.Contains(Default))
                    {
                        Default = FlagValues[0];
                    }
                }
                else
                {
                    throw new Exception("Failed to find key " + Key + "!");
                }
            }
        }
Esempio n. 3
0
 public bool Bool(string key)
 {
     if (FlagValues.ContainsKey(key))
     {
         return((bool)FlagValues[key]);
     }
     return(GlobalBool(key));
 }
Esempio n. 4
0
 public int Int(string key)
 {
     if (FlagValues.ContainsKey(key))
     {
         return((int)FlagValues[key]);
     }
     return(GlobalInt(key));
 }
Esempio n. 5
0
 public string String(string key)
 {
     if (FlagValues.ContainsKey(key))
     {
         return((string)FlagValues[key]);
     }
     return(GlobalString(key));
 }
Esempio n. 6
0
 internal UnFunction(UnExport export, string name, FlagValues flags, byte[] bytecode, int nativeIndex, int operatorPrecedence)
     : base(export, bytecode)
 {
     _name = name;
     _flags = flags;
     _nativeIndex = nativeIndex;
     _operatorPrecedence = operatorPrecedence;
 }
Esempio n. 7
0
 public Function(byte[] raw, ExportEntry export, int clippingSize = 32)
 {
     this.export = export;
     memory      = raw;
     memsize     = raw.Length;
     flagint     = GetFlagInt();
     flags       = new FlagValues(flagint, _flags);
     nativeindex = GetNatIdx();
     Deserialize(clippingSize);
 }
Esempio n. 8
0
        public void SaveToMemory(IMemory memory, int firstAddress, int addressValue)
        {
            int i;

            for (i = 0; i < mRegisters.Length; i++)
            {
                memory[firstAddress + i].Magnitude = mRegisters[i].Magnitude;
                memory[firstAddress + i].Sign      = mRegisters[i].Sign;
            }

            IFullWord composedWord = memory[firstAddress + i];

            if (addressValue < 0)
            {
                composedWord.Sign = Word.Signs.Negative;
                addressValue      = -addressValue;
            }
            else
            {
                composedWord.Sign = Word.Signs.Positive;
            }

            composedWord[addressByteIndex]     = (addressValue >> MixByte.BitCount) & MixByte.MaxValue;
            composedWord[addressByteIndex + 1] = addressValue & MixByte.MaxValue;

            FlagValues flags = FlagValues.None;

            if (OverflowIndicator)
            {
                flags |= FlagValues.Overflow;
            }
            if (CompareIndicator == CompValues.Greater)
            {
                flags |= FlagValues.Greater;
            }
            else if (CompareIndicator == CompValues.Less)
            {
                flags |= FlagValues.Less;
            }
            composedWord[flagsByteIndex] = (byte)flags;

            composedWord[rJByteIndex]     = RJ[0];
            composedWord[rJByteIndex + 1] = RJ[1];
        }
Esempio n. 9
0
 public UnClassProperty(UnExport export, int arraySize, FlagValues flags, int category, short repOffset)
 {
     _export = export;
     _arraySize = arraySize;
     _flags = flags;
     var categoryName = export.Package.Names[category];
     if (categoryName.Name != "None")
         _category = categoryName;
     RepOffset = repOffset;
 }
Esempio n. 10
0
 public UnClassClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type1, UnPackageItem type2, short repOffset)
     : base(export, arraySize, flags, category, repOffset)
 {
     Type1 = type1;
     Type2 = type2;
 }
Esempio n. 11
0
 public UnTypedClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type, short repOffset)
     : base(export, arraySize, flags, category, repOffset)
 {
     Type = type;
 }
Esempio n. 12
0
        protected override UnClassProperty CreateProperty(UnExport export, int arraySize, FlagValues flags, int category, BinaryReader reader, short repOffset)
        {
            int typeId1 = reader.ReadInt32();

            reader.ReadInt32();
            var typeItem1 = export.Package.ResolveClassItem(typeId1);

            return(new UnDelegateClassProperty(export, arraySize, flags, category, typeItem1, repOffset));
        }
Esempio n. 13
0
 protected virtual UnClassProperty CreateProperty(UnExport export, int arraySize, FlagValues flags, int category, BinaryReader reader, short repOffset)
 {
     return(new UnClassProperty(export, arraySize, flags, category, repOffset));
 }
Esempio n. 14
0
 internal UnClass(UnExport self, int superIndex, UnPackageItem outerInstance, byte[] bytecode, FlagValues flags, 
     UnPackageItem defaults, string config, List<string> hideCategories, List<UnPackageItem> interfaces)
     : base(self, superIndex, bytecode)
 {
     _outerInstance = outerInstance;
     _flags = flags;
     _defaults = defaults;
     _config = config;
     _hideCategories = hideCategories;
     _interfaces = interfaces;
 }