summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Parsing.py
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-15 02:51:34 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-15 02:51:34 +0000
commit6780eef1f9ed0af24795708c3be7adafd7113691 (patch)
tree1a9fd2fca0bd71c4a64a8bf3f10e492f45a232d8 /BaseTools/Source/Python/Common/Parsing.py
parent5460c4bbc5aa9d99d25c55c6b936166bea3dbea0 (diff)
downloadedk2-6780eef1f9ed0af24795708c3be7adafd7113691.tar.gz
edk2-6780eef1f9ed0af24795708c3be7adafd7113691.tar.bz2
edk2-6780eef1f9ed0af24795708c3be7adafd7113691.zip
Sync EDKII BaseTools to BaseTools project r2093.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11057 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common/Parsing.py')
-rw-r--r--BaseTools/Source/Python/Common/Parsing.py66
1 files changed, 1 insertions, 65 deletions
diff --git a/BaseTools/Source/Python/Common/Parsing.py b/BaseTools/Source/Python/Common/Parsing.py
index ce1e60338e..5bea6941fd 100644
--- a/BaseTools/Source/Python/Common/Parsing.py
+++ b/BaseTools/Source/Python/Common/Parsing.py
@@ -18,70 +18,6 @@ from String import *
from CommonDataClass.DataClass import *
from DataType import *
-## ParseContent
-#
-# Parse content of a DSC/INF/DEC file
-#
-def ParseContent(Lines, ):
- for Line in Lines:
- LineNo = LineNo + 1
- #
- # Remove comments at tail and remove spaces again
- #
- Line = CleanString(Line)
- if Line == '':
- continue
-
- #
- # Find a new section tab
- # First insert previous section items
- # And then parse the content of the new section
- #
- if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):
- #
- # Insert items data of previous section
- #
- self.InsertSectionItemsIntoDatabase(FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList)
- #
- # Parse the new section
- #
- SectionItemList = []
- ArchList = []
- ThirdList = []
-
- LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
- for Item in LineList:
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- CurrentSection = ItemList[0]
- if CurrentSection.upper() not in self.KeyList:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- ItemList.append('')
- ItemList.append('')
- if len(ItemList) > 5:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- else:
- if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo)
- ArchList.append(ItemList[1].upper())
- ThirdList.append(ItemList[2])
-
- continue
-
- #
- # Not in any defined section
- #
- if CurrentSection == TAB_UNKNOWN:
- ErrorMsg = "%s is not in any defined section" % Line
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo)
-
- #
- # Add a section item
- #
- SectionItemList.append([Line, LineNo])
- # End of parse
- #End of For
-
-
## ParseDefineMacro
#
# Search whole table to find all defined Macro and replaced them with the real values
@@ -940,4 +876,4 @@ def GenMetaDatSectionItem(Key, Value, List):
if Key not in List:
List[Key] = [Value]
else:
- List[Key].append(Value) \ No newline at end of file
+ List[Key].append(Value)