From 6398a06fba40af51fcd2a9357843ac66775ca7f7 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Tue, 20 Dec 2016 23:27:08 +0800 Subject: [PATCH] fixes #1530 and #1531 --- runtime/Python2/src/antlr4/Parser.py | 3 ++- runtime/Python2/src/antlr4/PredictionContext.py | 4 +--- runtime/Python3/src/antlr4/PredictionContext.py | 3 +++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/Python2/src/antlr4/Parser.py b/runtime/Python2/src/antlr4/Parser.py index e70318dfc..d8be80cf0 100644 --- a/runtime/Python2/src/antlr4/Parser.py +++ b/runtime/Python2/src/antlr4/Parser.py @@ -10,7 +10,8 @@ from antlr4.atn.ATNDeserializer import ATNDeserializer from antlr4.atn.ATNDeserializationOptions import ATNDeserializationOptions from antlr4.error.Errors import UnsupportedOperationException from antlr4.tree.ParseTreePatternMatcher import ParseTreePatternMatcher -from antlr4.tree.Tree import ParseTreeListener +from antlr4.tree.Tree import ParseTreeListener, ErrorNode, TerminalNode + class TraceListener(ParseTreeListener): diff --git a/runtime/Python2/src/antlr4/PredictionContext.py b/runtime/Python2/src/antlr4/PredictionContext.py index 25c02c05c..749234a33 100644 --- a/runtime/Python2/src/antlr4/PredictionContext.py +++ b/runtime/Python2/src/antlr4/PredictionContext.py @@ -5,9 +5,7 @@ #/ from io import StringIO from antlr4.RuleContext import RuleContext -from antlr4.atn.ATN import ATN -from antlr4.atn.ATNState import ATNState - +from antlr4.error.Errors import IllegalStateException class PredictionContext(object): diff --git a/runtime/Python3/src/antlr4/PredictionContext.py b/runtime/Python3/src/antlr4/PredictionContext.py index 1316180fc..f117127dd 100644 --- a/runtime/Python3/src/antlr4/PredictionContext.py +++ b/runtime/Python3/src/antlr4/PredictionContext.py @@ -4,6 +4,9 @@ # can be found in the LICENSE.txt file in the project root. #/ from io import StringIO + +from antlr4.error.Errors import IllegalStateException + from antlr4.RuleContext import RuleContext from antlr4.atn.ATN import ATN from antlr4.atn.ATNState import ATNState