Merge pull request #2292 from sinopsysHK/master

Enable ParserATNSimulator debug mode in Python3 target
This commit is contained in:
Terence Parr 2018-07-24 12:58:23 -07:00 committed by GitHub
commit 4618842cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -181,8 +181,8 @@ YYYY/MM/DD, github id, Full name, email
2017/12/20, kbsletten, Kyle Sletten, kbsletten@gmail.com
2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com
2018/02/11, io7m, Mark Raynsford, code@io7m.com
2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/05/17, sinopsysHK, Eric Bardes, sinofwd@gmail.com
2018/05/23, srvance, Stephen Vance, steve@vance.com
2018/06/14, alecont, Alessandro Contenti, alecontenti@hotmail.com
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com

View File

@ -1608,7 +1608,7 @@ class ParserATNSimulator(ATNSimulator):
def reportAttemptingFullContext(self, dfa:DFA, conflictingAlts:set, configs:ATNConfigSet, startIndex:int, stopIndex:int):
if ParserATNSimulator.debug or ParserATNSimulator.retry_debug:
interval = range(startIndex, stopIndex + 1)
interval = (startIndex, stopIndex + 1)
print("reportAttemptingFullContext decision=" + str(dfa.decision) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
if self.parser is not None:
@ -1616,7 +1616,7 @@ class ParserATNSimulator(ATNSimulator):
def reportContextSensitivity(self, dfa:DFA, prediction:int, configs:ATNConfigSet, startIndex:int, stopIndex:int):
if ParserATNSimulator.debug or ParserATNSimulator.retry_debug:
interval = range(startIndex, stopIndex + 1)
interval = (startIndex, stopIndex + 1)
print("reportContextSensitivity decision=" + str(dfa.decision) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
if self.parser is not None:
@ -1642,7 +1642,7 @@ class ParserATNSimulator(ATNSimulator):
# }
# i++;
# }
interval = range(startIndex, stopIndex + 1)
interval = (startIndex, stopIndex + 1)
print("reportAmbiguity " + str(ambigAlts) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
if self.parser is not None: