def GetPackage(Item, ContainerFile, FileRelativePath, LineNo=-1): ItemNew = Item + DataType.TAB_VALUE_SPLIT List = GetSplitValueList(ItemNew) CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], LineNo) CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', \ List[0], LineNo) if List[1] != '': CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo) return (List[0], List[1])
def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo=-1): List = GetSplitValueList(Item[0]) SupMod = DataType.SUP_MODULE_LIST_STRING if len(List) != 2: RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, \ '<LibraryClassKeyWord>|<LibraryInstance>') else: CheckFileType(List[1], '.Inf', ContainerFile, \ 'library class instance', Item[0], LineNo) CheckFileExist(WorkspaceDir, List[1], ContainerFile, \ 'LibraryClasses', Item[0], LineNo) if Item[1] != '': SupMod = Item[1] return (List[0], List[1], SupMod)
def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo=-1): ItemList = GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2)) SupMod = DataType.SUP_MODULE_LIST_STRING if len(ItemList) > 5: RaiseParserError\ (Item[0], 'LibraryClasses', ContainerFile, \ '<LibraryClassKeyWord>[|<LibraryInstance>]\ [|<TokenSpaceGuidCName>.<PcdCName>]' ) else: CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses', \ Item[0], LineNo) CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile, \ 'LibraryClasses', Item[0], LineNo) if ItemList[2] != '': CheckPcdTokenInfo(ItemList[2], 'LibraryClasses', \ ContainerFile, LineNo) if Item[1] != '': SupMod = Item[1] return (ItemList[0], ItemList[1], ItemList[2], SupMod)