summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-10-15 08:27:53 +0800
committerLiming Gao <liming.gao@intel.com>2018-10-15 08:29:14 +0800
commit1ccc4d895dd8d659d016efcd6ef8a48749aba1d0 (patch)
tree0d5f58643cc72275887d3bb322813609906a9334 /BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
parent678f85131238622e576705117e299d81cff755c9 (diff)
downloadedk2-1ccc4d895dd8d659d016efcd6ef8a48749aba1d0.tar.gz
Revert BaseTools: PYTHON3 migration
This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. 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>
Diffstat (limited to 'BaseTools/Source/Python/Ecc/CodeFragmentCollector.py')
-rw-r--r--BaseTools/Source/Python/Ecc/CodeFragmentCollector.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
index b6fa287cf7..d12232cc6f 100644
--- a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
+++ b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
@@ -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()