]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/Parsing.py
Sync EDKII BaseTools to BaseTools project r2093.
[mirror_edk2.git] / BaseTools / Source / Python / Common / Parsing.py
index 755f7901b57b59656c90e8210b1276b01c9e8419..5bea6941fdf77e0a9047342cb20ed6927a0787df 100644 (file)
@@ -1,8 +1,8 @@
 ## @file\r
-# This file is used to define common parsing related functions used in parsing INF/DEC/DSC process \r
+# This file is used to define common parsing related functions used in parsing INF/DEC/DSC process\r
 #\r
-# Copyright (c) 2008, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
@@ -18,70 +18,6 @@ from String import *
 from CommonDataClass.DataClass import *\r
 from DataType import *\r
 \r
-## ParseContent\r
-#\r
-# Parse content of a DSC/INF/DEC file\r
-#\r
-def ParseContent(Lines, ):\r
-    for Line in Lines:\r
-        LineNo = LineNo + 1\r
-        #\r
-        # Remove comments at tail and remove spaces again\r
-        #\r
-        Line = CleanString(Line)\r
-        if Line == '':\r
-            continue\r
-        \r
-        #\r
-        # Find a new section tab\r
-        # First insert previous section items\r
-        # And then parse the content of the new section\r
-        #\r
-        if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):\r
-            #\r
-            # Insert items data of previous section\r
-            #\r
-            self.InsertSectionItemsIntoDatabase(FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList)\r
-            #\r
-            # Parse the new section\r
-            #\r
-            SectionItemList = []\r
-            ArchList = []\r
-            ThirdList = []\r
-            \r
-            LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)\r
-            for Item in LineList:\r
-                ItemList = GetSplitValueList(Item, TAB_SPLIT)\r
-                CurrentSection = ItemList[0]\r
-                if CurrentSection.upper() not in self.KeyList:\r
-                    RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
-                ItemList.append('')\r
-                ItemList.append('')\r
-                if len(ItemList) > 5:\r
-                    RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
-                else:\r
-                    if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:\r
-                        EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo)\r
-                    ArchList.append(ItemList[1].upper())\r
-                    ThirdList.append(ItemList[2])\r
-\r
-            continue\r
-        \r
-        #\r
-        # Not in any defined section\r
-        #\r
-        if CurrentSection == TAB_UNKNOWN:\r
-            ErrorMsg = "%s is not in any defined section" % Line\r
-            EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo)\r
-\r
-        #\r
-        # Add a section item\r
-        #\r
-        SectionItemList.append([Line, LineNo])\r
-        # End of parse\r
-    #End of For\r
-\r
-\r
 ## ParseDefineMacro\r
 #\r
 # Search whole table to find all defined Macro and replaced them with the real values\r
@@ -97,13 +33,13 @@ def ParseDefineMacro2(Table, RecordSets, GlobalMacro):
     RecordSet = Table.Exec(SqlCommand)\r
     for Record in RecordSet:\r
         Macros[Record[0]] = Record[1]\r
-    \r
+\r
     #\r
     # Overrided by Global Macros\r
     #\r
     for Key in GlobalMacro.keys():\r
         Macros[Key] = GlobalMacro[Key]\r
-    \r
+\r
     #\r
     # Replace the Macros\r
     #\r
@@ -111,7 +47,7 @@ def ParseDefineMacro2(Table, RecordSets, GlobalMacro):
         if RecordSets[Key] != []:\r
             for Item in RecordSets[Key]:\r
                 Item[0] = ReplaceMacro(Item[0], Macros)\r
-    \r
+\r
 ## ParseDefineMacro\r
 #\r
 # Search whole table to find all defined Macro and replaced them with the real values\r
@@ -130,22 +66,22 @@ def ParseDefineMacro(Table, GlobalMacro):
 #            The follow SqlCommand (expr replace) is not supported in Sqlite 3.3.4 which is used in Python 2.5                                     *\r
 #            Reserved Only                                                                                                                         *\r
 #            SqlCommand = """update %s set Value1 = replace(Value1, '%s', '%s')                                                                    *\r
-#                            where ID in (select ID from %s                                                                                        * \r
+#                            where ID in (select ID from %s                                                                                        *\r
 #                                         where Model = %s                                                                                         *\r
 #                                         and Value1 like '%%%s%%'                                                                                 *\r
 #                                         and StartLine > %s                                                                                       *\r
 #                                         and Enabled > -1                                                                                         *\r
-#                                         and Arch = '%s')""" % \                                                                                  *  \r
+#                                         and Arch = '%s')""" % \                                                                                  *\r
 #                                         (self.TblDsc.Table, Record[0], Record[1], self.TblDsc.Table, Record[2], Record[1], Record[3], Record[4]) *\r
 #***************************************************************************************************************************************************\r
         Macros[Record[0]] = Record[1]\r
-    \r
+\r
     #\r
     # Overrided by Global Macros\r
     #\r
     for Key in GlobalMacro.keys():\r
         Macros[Key] = GlobalMacro[Key]\r
-    \r
+\r
     #\r
     # Found all defined macro and replaced\r
     #\r
@@ -228,7 +164,7 @@ def QueryDefinesItem2(Table, Arch, BelongsToFile):
                     and BelongsToFile = %s\r
                     and Enabled > -1""" % (Table.Table, MODEL_META_DATA_HEADER, ConvertToSqlString2(TAB_ARCH_COMMON), BelongsToFile)\r
         RecordSet = Table.Exec(SqlCommand)\r
-    \r
+\r
     return RecordSet\r
 \r
 ##QueryDscItem\r
@@ -291,23 +227,23 @@ def QueryInfItem(Table, Model, BelongsToItem):
 # @retval truple() A truple structure as (Family, ToolChain, Flag)\r
 #\r
 def GetBuildOption(String, File, LineNo = -1):\r
+    (Family, ToolChain, Flag) = ('', '', '')\r
     if String.find(TAB_EQUAL_SPLIT) < 0:\r
         RaiseParserError(String, 'BuildOptions', File, '[<Family>:]<ToolFlag>=Flag', LineNo)\r
-    (Family, ToolChain, Flag) = ('', '', '')\r
-    List = GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit = 1)\r
-    if List[0].find(':') > -1:\r
-        Family = List[0][ : List[0].find(':')].strip()\r
-        ToolChain = List[0][List[0].find(':') + 1 : ].strip()\r
     else:\r
-        ToolChain = List[0].strip()\r
-    Flag = List[1].strip()\r
-\r
+        List = GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit = 1)\r
+        if List[0].find(':') > -1:\r
+            Family = List[0][ : List[0].find(':')].strip()\r
+            ToolChain = List[0][List[0].find(':') + 1 : ].strip()\r
+        else:\r
+            ToolChain = List[0].strip()\r
+        Flag = List[1].strip()\r
     return (Family, ToolChain, Flag)\r
 \r
 ## Get Library Class\r
 #\r
 # Get Library of Dsc as <LibraryClassKeyWord>|<LibraryInstance>\r
-# \r
+#\r
 # @param Item:           String as <LibraryClassKeyWord>|<LibraryInstance>\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
@@ -329,7 +265,7 @@ def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo = -1):
 ## Get Library Class\r
 #\r
 # Get Library of Dsc as <LibraryClassKeyWord>[|<LibraryInstance>][|<TokenSpaceGuidCName>.<PcdCName>]\r
-# \r
+#\r
 # @param Item:           String as <LibraryClassKeyWord>|<LibraryInstance>\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
@@ -349,7 +285,7 @@ def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo = -1):
         if Item[1] != '':\r
             SupMod = Item[1]\r
 \r
-    return (ItemList[0], ItemList[1], ItemList[2], SupMod)    \r
+    return (ItemList[0], ItemList[1], ItemList[2], SupMod)\r
 \r
 ## CheckPcdTokenInfo\r
 #\r
@@ -373,7 +309,7 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo = -1):
 ## Get Pcd\r
 #\r
 # Get Pcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]\r
-# \r
+#\r
 # @param Item:           String as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]\r
 # @param ContainerFile:  The file which describes the pcd, used for error report\r
 #\r
@@ -382,23 +318,23 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo = -1):
 def GetPcd(Item, Type, ContainerFile, LineNo = -1):\r
     TokenGuid, TokenName, Value, MaximumDatumSize, Token = '', '', '', '', ''\r
     List = GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)\r
-    \r
+\r
     if len(List) < 4 or len(List) > 6:\r
         RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]', LineNo)\r
     else:\r
         Value = List[1]\r
         MaximumDatumSize = List[2]\r
         Token = List[3]\r
-        \r
+\r
     if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):\r
         (TokenGuid, TokenName) = GetSplitValueList(List[0], TAB_SPLIT)\r
-    \r
+\r
     return (TokenName, TokenGuid, Value, MaximumDatumSize, Token, Type)\r
 \r
 ## Get FeatureFlagPcd\r
 #\r
 # Get FeatureFlagPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE\r
-# \r
+#\r
 # @param Item:           String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE\r
 # @param ContainerFile:  The file which describes the pcd, used for error report\r
 #\r
@@ -413,13 +349,13 @@ def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo = -1):
         Value = List[1]\r
     if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):\r
         (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)\r
-    \r
+\r
     return (TokenName, TokenGuid, Value, Type)\r
 \r
 ## Get DynamicDefaultPcd\r
 #\r
 # Get DynamicDefaultPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<DatumTyp>[|<MaxDatumSize>]]\r
-# \r
+#\r
 # @param Item:           String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE\r
 # @param ContainerFile:  The file which describes the pcd, used for error report\r
 #\r
@@ -436,13 +372,13 @@ def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo = -1):
         MaxDatumSize = List[3]\r
     if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):\r
         (TokenGuid, TokenName) = GetSplitValueList(List[0], TAB_SPLIT)\r
-    \r
+\r
     return (TokenName, TokenGuid, Value, DatumTyp, MaxDatumSize, Type)\r
 \r
 ## Get DynamicHiiPcd\r
 #\r
 # Get DynamicHiiPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<String>|<VariableGuidCName>|<VariableOffset>[|<DefaultValue>[|<MaximumDatumSize>]]\r
-# \r
+#\r
 # @param Item:           String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE\r
 # @param ContainerFile:  The file which describes the pcd, used for error report\r
 #\r
@@ -457,13 +393,13 @@ def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo = -1):
         L1, L2, L3, L4, L5 = List[1], List[2], List[3], List[4], List[5]\r
     if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):\r
         (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)\r
-    \r
+\r
     return (TokenName, TokenGuid, L1, L2, L3, L4, L5, Type)\r
 \r
 ## Get DynamicVpdPcd\r
 #\r
 # Get DynamicVpdPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>[|<MaximumDatumSize>]\r
-# \r
+#\r
 # @param Item:           String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE\r
 # @param ContainerFile:  The file which describes the pcd, used for error report\r
 #\r
@@ -478,7 +414,7 @@ def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo = -1):
         L1, L2 = List[1], List[2]\r
     if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):\r
         (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)\r
-    \r
+\r
     return (TokenName, TokenGuid, L1, L2, Type)\r
 \r
 ## GetComponent\r
@@ -500,13 +436,13 @@ def GetComponent(Lines, KeyValues):
 \r
     for Line in Lines:\r
         Line = Line[0]\r
-        \r
+\r
         #\r
         # Ignore !include statement\r
         #\r
         if Line.upper().find(TAB_INCLUDE.upper() + ' ') > -1 or Line.upper().find(TAB_DEFINE + ' ') > -1:\r
             continue\r
-        \r
+\r
         if findBlock == False:\r
             ListItem = Line\r
             #\r
@@ -596,7 +532,7 @@ def GetExec(String):
 # Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3], [pcd1, pcd2, pcd3]], ...]\r
 #\r
 # @param Lines:             The content to be parsed\r
-# @param Key:               Reserved \r
+# @param Key:               Reserved\r
 # @param KeyValues:         To store data after parsing\r
 # @param CommentCharacter:  Comment char, used to ignore comment content\r
 #\r
@@ -683,7 +619,7 @@ def GetComponents(Lines, Key, KeyValues, CommentCharacter):
 ## Get Source\r
 #\r
 # Get Source of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]\r
-# \r
+#\r
 # @param Item:           String as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
@@ -704,11 +640,12 @@ def GetSource(Item, ContainerFile, FileRelativePath, LineNo = -1):
 ## Get Binary\r
 #\r
 # Get Binary of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]\r
-# \r
+#\r
 # @param Item:           String as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
 # @retval (List[0], List[1], List[2], List[3])\r
+# @retval List\r
 #\r
 def GetBinary(Item, ContainerFile, FileRelativePath, LineNo = -1):\r
     ItemNew = Item + DataType.TAB_VALUE_SPLIT\r
@@ -718,15 +655,22 @@ def GetBinary(Item, ContainerFile, FileRelativePath, LineNo = -1):
     else:\r
         if List[3] != '':\r
             CheckPcdTokenInfo(List[3], 'Binaries', ContainerFile, LineNo)\r
-    \r
-    return (List[0], List[1], List[2], List[3])\r
+\r
+    if len(List) == 4:\r
+        return (List[0], List[1], List[2], List[3])\r
+    elif len(List) == 3:\r
+        return (List[0], List[1], List[2], '')\r
+    elif len(List) == 2:\r
+        return (List[0], List[1], '', '')\r
+    elif len(List) == 1:\r
+        return (List[0], '', '', '')\r
 \r
 ## Get Guids/Protocols/Ppis\r
 #\r
 # Get Guids/Protocols/Ppis of Inf as <GuidCName>[|<PcdFeatureFlag>]\r
 #\r
 # @param Item:           String as <GuidCName>[|<PcdFeatureFlag>]\r
-# @param Type:           Type of parsing string \r
+# @param Type:           Type of parsing string\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
 # @retval (List[0], List[1])\r
@@ -736,7 +680,7 @@ def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFile, LineNo = -1):
     List = GetSplitValueList(ItemNew)\r
     if List[1] != '':\r
         CheckPcdTokenInfo(List[1], Type, ContainerFile, LineNo)\r
-    \r
+\r
     return (List[0], List[1])\r
 \r
 ## Get Guids/Protocols/Ppis\r
@@ -744,7 +688,7 @@ def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFile, LineNo = -1):
 # Get Guids/Protocols/Ppis of Dec as <GuidCName>=<GuidValue>\r
 #\r
 # @param Item:           String as <GuidCName>=<GuidValue>\r
-# @param Type:           Type of parsing string \r
+# @param Type:           Type of parsing string\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
 # @retval (List[0], List[1])\r
@@ -753,7 +697,7 @@ def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo = -1):
     List = GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)\r
     if len(List) != 2:\r
         RaiseParserError(Item, Type, ContainerFile, '<CName>=<GuidValue>', LineNo)\r
-    \r
+\r
     return (List[0], List[1])\r
 \r
 ## GetPackage\r
@@ -761,7 +705,7 @@ def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo = -1):
 # Get Package of Inf as <PackagePath>[|<PcdFeatureFlag>]\r
 #\r
 # @param Item:           String as <PackagePath>[|<PcdFeatureFlag>]\r
-# @param Type:           Type of parsing string \r
+# @param Type:           Type of parsing string\r
 # @param ContainerFile:  The file which describes the library class, used for error report\r
 #\r
 # @retval (List[0], List[1])\r
@@ -771,10 +715,10 @@ def GetPackage(Item, ContainerFile, FileRelativePath, LineNo = -1):
     List = GetSplitValueList(ItemNew)\r
     CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], LineNo)\r
     CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', List[0], LineNo)\r
-    \r
+\r
     if List[1] != '':\r
         CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo)\r
-    \r
+\r
     return (List[0], List[1])\r
 \r
 ## Get Pcd Values of Inf\r
@@ -790,15 +734,15 @@ def GetPackage(Item, ContainerFile, FileRelativePath, LineNo = -1):
 def GetPcdOfInf(Item, Type, File, LineNo):\r
     Format = '<TokenSpaceGuidCName>.<PcdCName>[|<Value>]'\r
     TokenGuid, TokenName, Value, InfType = '', '', '', ''\r
-    \r
+\r
     if Type == TAB_PCDS_FIXED_AT_BUILD:\r
         InfType = TAB_INF_FIXED_PCD\r
     elif Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
         InfType = TAB_INF_PATCH_PCD\r
     elif Type == TAB_PCDS_FEATURE_FLAG:\r
-        InfType = TAB_INF_FEATURE_PCD        \r
+        InfType = TAB_INF_FEATURE_PCD\r
     elif Type == TAB_PCDS_DYNAMIC_EX:\r
-        InfType = TAB_INF_PCD_EX        \r
+        InfType = TAB_INF_PCD_EX\r
     elif Type == TAB_PCDS_DYNAMIC:\r
         InfType = TAB_INF_PCD\r
     List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT)\r
@@ -815,7 +759,7 @@ def GetPcdOfInf(Item, Type, File, LineNo):
 \r
     return (TokenGuid, TokenName, Value, Type)\r
 \r
-    \r
+\r
 ## Get Pcd Values of Dec\r
 #\r
 # Get Pcd of Dec as <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>\r
@@ -837,7 +781,7 @@ def GetPcdOfDec(Item, Type, File, LineNo = -1):
     else:\r
         TokenGuid = TokenInfo[0]\r
         TokenName = TokenInfo[1]\r
-    \r
+\r
     return (TokenGuid, TokenName, Value, DatumType, Token, Type)\r
 \r
 ## Parse DEFINE statement\r
@@ -854,7 +798,7 @@ def ParseDefine(LineValue, StartLine, Table, FileID, Filename, SectionName, Sect
     Table.Insert(MODEL_META_DATA_DEFINE, Define[0], Define[1], '', '', '', Arch, SectionModel, FileID, StartLine, -1, StartLine, -1, 0)\r
 \r
 ## InsertSectionItems\r
-# \r
+#\r
 # Insert item data of a section to a dict\r
 #\r
 def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, ThirdList, RecordSet):\r
@@ -869,23 +813,23 @@ def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, ThirdLi
         for SectionItem in SectionItemList:\r
             BelongsToItem, EndLine, EndColumn = -1, -1, -1\r
             LineValue, StartLine, EndLine, Comment = SectionItem[0], SectionItem[1], SectionItem[1], SectionItem[2]\r
-            \r
+\r
             EdkLogger.debug(4, "Parsing %s ..." %LineValue)\r
             # And then parse DEFINE statement\r
             if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:\r
                 continue\r
-            \r
+\r
             # At last parse other sections\r
             ID = -1\r
             Records.append([LineValue, Arch, StartLine, ID, Third, Comment])\r
-        \r
+\r
         if RecordSet != {}:\r
             RecordSet[Model] = Records\r
 \r
 ## Insert records to database\r
-# \r
+#\r
 # Insert item data of a section to database\r
-# @param Table:            The Table to be inserted \r
+# @param Table:            The Table to be inserted\r
 # @param FileID:           The ID of belonging file\r
 # @param Filename:         The name of belonging file\r
 # @param CurrentSection:   The name of currect section\r
@@ -893,7 +837,7 @@ def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, ThirdLi
 # @param ArchList:         A list of arches\r
 # @param ThirdList:        A list of third parameters, ModuleType for LibraryClass and SkuId for Dynamic Pcds\r
 # @param IfDefList:        A list of all conditional statements\r
-# @param RecordSet:        A dict of all parsed records \r
+# @param RecordSet:        A dict of all parsed records\r
 #\r
 def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, RecordSet):\r
     #\r
@@ -909,7 +853,7 @@ def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, CurrentSectio
         for SectionItem in SectionItemList:\r
             BelongsToItem, EndLine, EndColumn = -1, -1, -1\r
             LineValue, StartLine, EndLine = SectionItem[0], SectionItem[1], SectionItem[1]\r
-            \r
+\r
             EdkLogger.debug(4, "Parsing %s ..." %LineValue)\r
             #\r
             # And then parse DEFINE statement\r
@@ -917,13 +861,13 @@ def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, CurrentSectio
             if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:\r
                 ParseDefine(LineValue, StartLine, Table, FileID, Filename, CurrentSection, Model, Arch)\r
                 continue\r
-            \r
+\r
             #\r
             # At last parse other sections\r
             #\r
             ID = Table.Insert(Model, LineValue, Third, Third, '', '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)\r
             Records.append([LineValue, Arch, StartLine, ID, Third])\r
-        \r
+\r
         if RecordSet != {}:\r
             RecordSet[Model] = Records\r
 \r
@@ -932,4 +876,4 @@ def GenMetaDatSectionItem(Key, Value, List):
     if Key not in List:\r
         List[Key] = [Value]\r
     else:\r
-        List[Key].append(Value) 
\ No newline at end of file
+        List[Key].append(Value)\r