self._SectionName = ''\r
self._SectionType = []\r
ArchList = set()\r
+ PrivateList = set()\r
Line = self._CurrentLine.replace("%s%s" % (TAB_COMMA_SPLIT, TAB_SPACE_SPLIT), TAB_COMMA_SPLIT)\r
for Item in Line[1:-1].split(TAB_COMMA_SPLIT):\r
if Item == '':\r
# S2 may be Platform or ModuleType\r
if len(ItemList) > 2:\r
S2 = ItemList[2].upper()\r
+ # only Includes, GUIDs, PPIs, Protocols section have Private tag\r
+ if self._SectionName in [TAB_INCLUDES.upper(), TAB_GUIDS.upper(), TAB_PROTOCOLS.upper(), TAB_PPIS.upper()]:\r
+ if S2 != 'PRIVATE':\r
+ EdkLogger.error("Parser", FORMAT_INVALID, 'Please use keyword "Private" as section tag modifier.',\r
+ File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
else:\r
S2 = 'COMMON'\r
+ PrivateList.add(S2)\r
if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:\r
self._Scope.append([S1, S2, self.DataType[self._SectionName]])\r
\r
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",\r
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
\r
+ # It is not permissible to mix section tags without the Private attribute with section tags with the Private attribute\r
+ if 'COMMON' in PrivateList and len(PrivateList) > 1:\r
+ EdkLogger.error('Parser', FORMAT_INVALID, "Can't mix section tags without the Private attribute with section tags with the Private attribute",\r
+ File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
+\r
## [guids], [ppis] and [protocols] section parser\r
@ParseMacro\r
def _GuidParser(self):\r