Library = PlatformLibraryClass()\r
Library.Name = Key[0]\r
Library.FilePath = Key[1]\r
- Library.ModuleType = list(Key[2:])\r
+ Library.SupModuleList = list(Key[2:])\r
Library.Define = Defines\r
Library.SupArchList = LibraryClasses[Key]\r
self.Platform.LibraryClasses.LibraryList.append(Library)\r
print '\t', Item.FilePath, Item.SupArchList, Item.Define\r
print '\nLibraryClasses =', m.LibraryClasses, m.LibraryClasses.IncludeFiles\r
for Item in m.LibraryClasses.LibraryList:\r
- print '\t', Item.Name, Item.FilePath, Item.ModuleType, Item.SupArchList, Item.Define\r
+ print '\t', Item.Name, Item.FilePath, Item.SupModuleList, Item.SupArchList, Item.Define\r
print '\nPcds =', m.DynamicPcdBuildDefinitions\r
for Item in m.DynamicPcdBuildDefinitions:\r
print '\tCname=', Item.CName, 'TSG=', Item.TokenSpaceGuidCName, 'Value=', Item.DefaultValue, 'Token=', Item.Token, 'Type=', Item.ItemType, 'Datum=', Item.DatumType, 'Size=', Item.MaxDatumSize, 'Arch=', Item.SupArchList, Item.SkuInfoList\r
IsFoundInDsc = True\r
IsOverrided = True\r
break\r
- if not IsFoundInDsc:\r
- ErrorMsg = "Pcd '%s' defined in module '%s' is not found in any platform" % (Name, ModuleName) \r
- raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
\r
#\r
# Last get information from PcdsSet defined by FDF\r
#\r
if (Name, Guid) in PcdsSet:\r
Value = PcdsSet[(Name, Guid)]\r
+ IsFoundInDsc = True\r
+ IsOverrided = True\r
+ \r
+ #\r
+ # Not found in any platform and fdf\r
+ #\r
+ if not IsFoundInDsc:\r
+ ErrorMsg = "Pcd '%s' defined in module '%s' is not found in any platform" % (Name, ModuleName) \r
+ raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
\r
return PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided)\r
\r
def FindSupModuleListOfLibraryClass(self, LibraryClass, OverridedLibraryClassList):\r
Name = LibraryClass.Name\r
FilePath = NormPath(LibraryClass.FilePath)\r
- SupModuleList = copy.copy(LibraryClass.ModuleType)\r
+ SupModuleList = copy.copy(LibraryClass.SupModuleList)\r
\r
#\r
# If the SupModuleList means all, remove overrided module types of platform\r
# If arch is supportted, remove all related module type\r
#\r
if Arch in Item.SupArchList:\r
- for ModuleType in Item.ModuleType:\r
+ for ModuleType in Item.SupModuleList:\r
EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s has specific defined module types" % Name)\r
if ModuleType in SupModuleList:\r
SupModuleList.remove(ModuleType)\r
#\r
if Line.find('$') > -1:\r
if Line.find('$(') < 0 or Line.find(')') < 0:\r
- IsFailed = True\r
- break\r
+ raise ParserError(FORMAT_INVALID, lineno = LineNo, name = FileName)\r
\r
#\r
# Check []\r
#\r
if Line.find('[') > -1 or Line.find(']') > -1:\r
+ #\r
# Only get one '[' or one ']'\r
+ #\r
if not (Line.find('[') > -1 and Line.find(']') > -1):\r
- IsFailed = True\r
- break\r
+ raise ParserError(FORMAT_INVALID, lineno = LineNo, name = FileName)\r
+\r
+ #\r
# Tag not in defined value\r
- Tag = Line.split(DataType.TAB_SPLIT, 1)[0].replace('[', '').replace(']', '').strip()\r
- if Tag.upper() == DataType.TAB_COMMON_DEFINES.upper():\r
- break\r
- if Tag.upper() not in map(lambda s: s.upper(), SupSectionTag):\r
- IsFailed = True\r
- break\r
+ #\r
+ TagList = GetSplitValueList(Line, DataType.TAB_COMMA_SPLIT)\r
+ for Tag in TagList:\r
+ Tag = Tag.split(DataType.TAB_SPLIT, 1)[0].replace('[', '').replace(']', '').strip()\r
+ if Tag.upper() == DataType.TAB_COMMON_DEFINES.upper():\r
+ break\r
+ if Tag.upper() not in map(lambda s: s.upper(), SupSectionTag):\r
+ ErrorMsg = "'%s' is not a supportted section name found at line %s in file '%s'" % (Tag, LineNo, FileName)\r
+ raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
\r
if IsFailed:\r
raise ParserError(FORMAT_INVALID, lineno = LineNo, name = FileName)\r
\r
return False\r
\r
+#\r
+# Find the index of a line in a file\r
+#\r
+def GetLineNo(FileContent, Line):\r
+ LineNo = -1\r
+ LineList = FileContent.splitlines()\r
+ for Index in range(len(LineList)):\r
+ if LineList[Index].find(Line) > -1:\r
+ return Index + 1\r
+\r
if __name__ == '__main__':\r
print SplitModuleType('LibraryClasses.common.DXE_RUNTIME_DRIVER')\r
print SplitModuleType('Library.common')\r
\r
class PlatformBuildOptionClasses(IncludeStatementClass):\r
def __init__(self):\r
- IncludeStatementClass.__init__(self)\r
+ IncludeStatementClass.__init__(self) # Used by .Dsc\r
self.FvBinding = ''\r
self.FfsFileNameGuid = ''\r
self.FfsFormatKey = ''\r
DefineClass.__init__(self)\r
self.Name = Name\r
self.FilePath = FilePath\r
- self.ModuleType = []\r
+ self.SupModuleList = []\r
self.ModuleGuid = ''\r
self.ModuleVersion = ''\r
self.PackageGuid = ''\r