ParseGlobalDeclaration() public method

public ParseGlobalDeclaration ( string txtGlobal ) : Reko.Core.Serialization.GlobalDataItem_v2
txtGlobal string
return Reko.Core.Serialization.GlobalDataItem_v2
Esempio n. 1
0
 public void Usb_ParseGlobalDeclaration_PointerToUnsignedInt()
 {
     var usb = new UserSignatureBuilder(program);
     var gbl = usb.ParseGlobalDeclaration("unsigned int *uiPtr");
     Assert.AreEqual("uiPtr", gbl.Name);
     Assert.AreEqual("ptr(prim(UnsignedInt,4))", gbl.DataType.ToString());
 }
Esempio n. 2
0
 public void Usb_ParseGlobalDeclaration_Int()
 {
     var usb = new UserSignatureBuilder(program);
     var gbl = usb.ParseGlobalDeclaration("int test123");
     Assert.AreEqual("test123", gbl.Name);
     Assert.AreEqual("prim(SignedInt,4)", gbl.DataType.ToString());
 }
Esempio n. 3
0
 public void Usb_ParseGlobalDeclaration_ArrayOfDouble()
 {
     var usb = new UserSignatureBuilder(program);
     var gbl = usb.ParseGlobalDeclaration("double dArr[12]");
     Assert.AreEqual("dArr", gbl.Name);
     Assert.AreEqual("arr(prim(Real,8),12)", gbl.DataType.ToString());
 }
Esempio n. 4
0
        private bool TryParseGlobal(string txtGlobal, out GlobalDataItem_v2 global)
        {
            global = null;
            if (program == null || program.Platform == null)
            {
                return false;
            }

            // Attempt to parse the global declaration.
            var usb = new UserSignatureBuilder(program);
            global = usb.ParseGlobalDeclaration(txtGlobal);
            return global != null;
        }