From 22c4de1ac8f1fc72e8d72af6a315e584490a44b0 Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Tue, 9 Oct 2018 12:44:35 +0800 Subject: 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 Reviewed-by: Liming Gao --- BaseTools/Source/Python/Eot/InfParserLite.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'BaseTools/Source/Python/Eot/InfParserLite.py') diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py b/BaseTools/Source/Python/Eot/InfParserLite.py index 88d7e7d58e..7de88990e4 100644 --- a/BaseTools/Source/Python/Eot/InfParserLite.py +++ b/BaseTools/Source/Python/Eot/InfParserLite.py @@ -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() -- cgit v1.2.3