BaseTools/Ecc/EOT: Add Python 3 support on ECC and EOT tools.

1. Add Python 3 support on ECC and EOT tools
2. Add C grammar file of ANTLR4 and fix some bugs

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hess Chen
2018-10-09 12:44:35 +08:00
committed by Yonghong Zhu
parent 472eb3b896
commit 22c4de1ac8
20 changed files with 14963 additions and 47753 deletions

View File

@ -22,8 +22,8 @@ from Common.DataType import *
from CommonDataClass.DataClass import *
from Common.Identification import *
from Common.StringUtils import *
from .Parser import *
from . import Database
from Eot.Parser import *
from Eot import Database
## EdkInfParser() class
#
@ -153,21 +153,3 @@ class EdkInfParser(object):
self.ParserSource(CurrentSection, SectionItemList, ArchList, ThirdList)
#End of For
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
#
if __name__ == '__main__':
EdkLogger.Initialize()
EdkLogger.SetLevel(EdkLogger.QUIET)
Db = Database.Database('Inf.db')
Db.InitDatabase()
P = EdkInfParser(os.path.normpath("C:\Framework\Edk\Sample\Platform\Nt32\Dxe\PlatformBds\PlatformBds.inf"), Db, '', '')
for Inf in P.Sources:
print(Inf)
for Item in P.Macros:
print(Item, P.Macros[Item])
Db.Close()