예제 #1
0
 def __init__(self):
     HashFileParser.__init__(self, 'ModuleFdfParser')
     self.Lines = []
     self.Parsed = False
     self.Dict = {}  # defines dictionary
     self.FVs = {}
     self.FDs = {}
     self.CurrentSection = []
     self.Path = ""
예제 #2
0
 def test_strip_comment(self):
     parser = HashFileParser("")
     lines = ["Test", "MagicLib|Include/Magic", ""]
     comments = ["\t#this shouldn't show up", " # test", ""]
     for line in lines:
         for comment in comments:
             test_line = line + comment
             result = parser.StripComment(test_line)
             self.assertEqual(result, line)
예제 #3
0
 def __init__(self):
     HashFileParser.__init__(self, 'DecParser')
     self.Lines = []
     self.Parsed = False
     self.Dict = {}
     self.LibrariesUsed = []
     self.PPIsUsed = []
     self.ProtocolsUsed = []
     self.GuidsUsed = []
     self.PcdsUsed = []
     self.IncludesUsed = []
     self.Path = ""
예제 #4
0
 def __init__(self):
     HashFileParser.__init__(self, 'DecParser')
     self.Lines = []
     self.Parsed = False
     self.Dict = {}
     self.LibraryClasses = []
     self.PPIs = []
     self.Protocols = []
     self.Guids = []
     self.Pcds = []
     self.IncludePaths = []
     self.Path = ""
     self.PackageName = None
예제 #5
0
 def test_parse_new_section(self):
     parser = HashFileParser("")
     section1 = "[Defines]"
     res, sect = parser.ParseNewSection(section1)
     self.assertTrue(res)
     self.assertEqual(sect, "Defines")
     # invalid section
     section2 = "[Defines"
     res, sect = parser.ParseNewSection(section2)
     self.assertFalse(res)
     # multiple parts with multiple definitions
     section3 = "[Components.X64, Components.IA32]"
     res, sect = parser.ParseNewSection(section3)
     self.assertTrue(res)
     self.assertEqual(sect, "Components")
     # try multiple parts on a single
     section4 = "[ Defines.Common.Section ]"
     res, sect = parser.ParseNewSection(section4)
     self.assertTrue(res)
     self.assertEqual(sect, "Defines")
 def __init__(self):
     HashFileParser.__init__(self, 'TargetTxtParser')
     self.Lines = []
     self.Parsed = False
     self.Dict = {}
     self.Path = ""