Revert BaseTools: PYTHON3 migration
This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52..
678f851312
.
Python3 migration is the fundamental change. It requires every developer
to install Python3. Before this migration, the well communication and wide
verification must be done. But now, most people is not aware of this change,
and not try it. So, Python3 migration is reverted and be moved to edk2-staging
Python3 branch for the edk2 user evaluation.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -22,7 +22,7 @@ import re
|
||||
import Common.LongFilePathOs as os
|
||||
import sys
|
||||
|
||||
import antlr4
|
||||
import antlr3
|
||||
from Ecc.CLexer import CLexer
|
||||
from Ecc.CParser import CParser
|
||||
|
||||
@ -499,14 +499,13 @@ class CodeFragmentCollector:
|
||||
def ParseFile(self):
|
||||
self.PreprocessFile()
|
||||
# restore from ListOfList to ListOfString
|
||||
# print(self.Profile.FileLinesList)
|
||||
self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
|
||||
FileStringContents = ''
|
||||
for fileLine in self.Profile.FileLinesList:
|
||||
FileStringContents += fileLine
|
||||
cStream = antlr4.InputStream(FileStringContents)
|
||||
cStream = antlr3.StringStream(FileStringContents)
|
||||
lexer = CLexer(cStream)
|
||||
tStream = antlr4.CommonTokenStream(lexer)
|
||||
tStream = antlr3.CommonTokenStream(lexer)
|
||||
parser = CParser(tStream)
|
||||
parser.translation_unit()
|
||||
|
||||
@ -517,9 +516,9 @@ class CodeFragmentCollector:
|
||||
FileStringContents = ''
|
||||
for fileLine in self.Profile.FileLinesList:
|
||||
FileStringContents += fileLine
|
||||
cStream = antlr4.InputStream(FileStringContents)
|
||||
cStream = antlr3.StringStream(FileStringContents)
|
||||
lexer = CLexer(cStream)
|
||||
tStream = antlr4.CommonTokenStream(lexer)
|
||||
tStream = antlr3.CommonTokenStream(lexer)
|
||||
parser = CParser(tStream)
|
||||
parser.translation_unit()
|
||||
|
||||
|
Reference in New Issue
Block a user