Merge pull request #1956 from renatahodovan/syntax-errors
Python: add public getter to parsers to access syntax error count.
This commit is contained in:
commit
e6d60007e7
|
@ -218,6 +218,13 @@ class Parser (Recognizer):
|
|||
self._ctx.exitRule(listener)
|
||||
listener.exitEveryRule(self._ctx)
|
||||
|
||||
# Gets the number of syntax errors reported during parsing. This value is
|
||||
# incremented each time {@link #notifyErrorListeners} is called.
|
||||
#
|
||||
# @see #notifyErrorListeners
|
||||
#
|
||||
def getNumberOfSyntaxErrors(self):
|
||||
return self._syntaxErrors
|
||||
|
||||
def getTokenFactory(self):
|
||||
return self._input.tokenSource._factory
|
||||
|
|
|
@ -227,6 +227,14 @@ class Parser (Recognizer):
|
|||
listener.exitEveryRule(self._ctx)
|
||||
|
||||
|
||||
# Gets the number of syntax errors reported during parsing. This value is
|
||||
# incremented each time {@link #notifyErrorListeners} is called.
|
||||
#
|
||||
# @see #notifyErrorListeners
|
||||
#
|
||||
def getNumberOfSyntaxErrors(self):
|
||||
return self._syntaxErrors
|
||||
|
||||
def getTokenFactory(self):
|
||||
return self._input.tokenSource._factory
|
||||
|
||||
|
|
Loading…
Reference in New Issue