Sync basetools' source and binary files with r1707 of the basetools project.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2009-09-11 03:14:43 +00:00
parent f22911b49e
commit fd171542e0
91 changed files with 1794 additions and 974 deletions

View File

@ -16,6 +16,7 @@
#
import os
import time
import copy
import Common.EdkLogger as EdkLogger
from CommonDataClass.DataClass import *
@ -55,7 +56,7 @@ class MetaFileParser(object):
self._FileType = FileType
self.MetaFile = FilePath
self._FileDir = os.path.dirname(self.MetaFile)
self._Macros = {}
self._Macros = copy.copy(Macros)
# for recursive parsing
self._Owner = Owner
@ -87,7 +88,9 @@ class MetaFileParser(object):
## Set parsing complete flag in both class and table
def _Done(self):
self._Finished = True
self._Table.SetEndFlag()
## Do not set end flag when processing included files
if self._From == -1:
self._Table.SetEndFlag()
## Return the table containg parsed data
#
@ -208,11 +211,14 @@ class MetaFileParser(object):
if TokenList[0] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given",
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
if len(TokenList) == 1:
self._Macros[TokenList[0]] = ''
else:
# keep the macro definition for later use
self._Macros[TokenList[0]] = ReplaceMacro(TokenList[1], self._Macros, False)
# Macros defined in the command line override ones defined in the meta-data file
if not TokenList[0] in self._Macros:
if len(TokenList) == 1:
self._Macros[TokenList[0]] = ''
else:
# keep the macro definition for later use
self._Macros[TokenList[0]] = ReplaceMacro(TokenList[1], self._Macros, False)
return TokenList[0], self._Macros[TokenList[0]]