Commit Graph

99 Commits

Author SHA1 Message Date
Thomas 409b207bf1 Fix formating 2019-05-14 08:57:01 +02:00
Thomas 6fbc156f6c Align overlap condition on java implementation 2019-05-13 22:33:43 +02:00
Thomas 8d48f1a851 Fix overlaping condition 2019-05-08 14:26:11 +02:00
Terence Parr dade65a895
Merge pull request #2463 from youkaichao/python/test
update test script
2019-02-23 08:57:40 -08:00
Ralu de58c28a24
Fix off by one error in getChild 2019-02-06 10:41:38 +01:00
You Kaichao 45a4cdc67b update test script 2019-01-04 09:17:36 +08:00
You Kaichao 18e2a605c1 update python runtime doc 2019-01-03 19:29:56 +08:00
You Kaichao 157afd1a8d update code on updated master 2019-01-02 19:06:36 +08:00
Eric Vergnaud 90854967ca fix broken API calls 2019-01-01 15:04:20 +01:00
Eric Vergnaud 3ad118f87e fix invalid test sequence 2019-01-01 13:31:01 +01:00
Eric Vergnaud cccf6e87da Fix API inconsistency, where getText would expect a tuple named interval, leading to lots of confusion 2019-01-01 13:20:23 +01:00
parrt 38a95da397 manual edits of 4.7.1 -> 4.7.2 2018-12-17 14:32:39 -08:00
Eric Vergnaud 43e529ca73 fix #1955 for Python 2018-11-18 19:41:47 +08:00
Alex Mykyta 2a3530f513 Fix install dependency for python3.4
Add install dependency for "typing" backport if using anything older than Python3.5
2018-11-15 20:15:39 -08:00
Maxim Novikov c956fbbbc6 Allow importing StdinStream from antlr4 package 2018-07-31 07:04:48 +02:00
Maksim Novikov ad603efe91 Add StdninStream for python3 runtime. Closes: #2271 2018-07-27 20:37:34 +02:00
Terence Parr 73170a2076
Merge branch 'master' into master 2018-07-24 12:57:38 -07:00
Eric Vergnaud d134b6a12d Fixes #2301 2018-06-03 11:21:37 +08:00
sinopsysHK 58ef6bbc96 Enable running debug mode of ParserATNSimulator
This is to have appropriate logs during debug and avoid crashing in some occasions when startIndex=stopIndex

range(startIndex, stopIndex) is equivalent to an array of values from startIndex to stopIndex-1 thus when startIndex=stopIndex range(startIndex, stopIndex+1) = [startIndex] which is not exactly an interval and would break getText that is expecting an interval as a Tuple.
2018-05-16 23:37:21 +08:00
jkmar dfba8c68db [Python3] return result instead of None in visitor 2017-12-27 22:22:49 +01:00
parrt ba47b092e9 update setup.py to use setuptools not distutils (Python 3) 2017-12-10 12:32:52 -08:00
parrt 763a1242b7 update version number and tweak doc 2017-12-08 12:47:11 -08:00
Terence Parr e6d60007e7 Merge pull request #1956 from renatahodovan/syntax-errors
Python: add public getter to parsers to access syntax error count.
2017-09-17 11:20:56 -07:00
Robert Jacobson 8f30ae6610 Import RuleContext into the antlr4 module namespace. See Issue #2012. 2017-09-16 16:16:01 -04:00
Renata Hodovan 6e02088e6a Python: add public getter to parsers to access syntax error count.
ANTLR parsers in Java are allowed to access the number of encountered
syntax errors via the getNumberOfSyntaxErrors method. However, the
Python variants must use the protected _syntaxErrors member to get this
value. The patch defines the same getter for Python targets too.
2017-07-18 18:29:36 +02:00
alimg 60cce436c2 Merge branch 'master' of https://github.com/antlr/antlr4 into py-input-mismatch-error 2017-06-25 19:02:26 +03:00
Eric Vergnaud ff4ffa613b Fix ATN deserialisation for unicode chars FFFE and FFFF 2017-06-25 12:05:57 +08:00
alimg f0d1a093ed Python: fix reported input alternatives are not in par with Java version 2017-06-19 18:55:48 +03:00
parrt 930e31d470 Merge branch 'master' of github.com:antlr/antlr4 2017-03-30 11:07:02 -07:00
parrt e6a9adf276 update 4.6 -> 4.7 in files 2017-03-30 11:06:44 -07:00
parrt b5648f405b tweak documentation about various targets 2017-03-30 10:44:28 -07:00
parrt 6215f18ec3 rename 4.6.1 to 4.7 everywhere 2017-02-23 14:48:58 -08:00
Ben Hamilton fd4246cf3f Implement new extended Unicode escape \u{10ABCD}. Bump UUID. Add lots more tests. 2017-02-23 09:39:44 -08:00
Ben Hamilton b190b6eca6 MAX_CHAR_VALUE to 0x10FFFF 2017-02-16 09:46:09 -08:00
Ben Hamilton 2c447a2b75 Python 2 and Python 3 support for lexer and parser output to a file instead of stdout 2017-02-10 13:11:24 -08:00
Ben Hamilton d9d4d8c6c4 Restore Python3 FileStream to ascii/strict 2017-01-30 08:49:32 -08:00
Ben Hamilton 99ed4b6de6 Python StdinStream/FileStream -> UTF-8 2017-01-30 07:32:30 -08:00
Eric Vergnaud f02d8c1a4b fix #1584 2017-01-19 21:44:56 +08:00
parrt 2629433830 bump version to 4.6.1 in all files. 2016-12-28 12:03:43 -08:00
Terence Parr b57843d983 Merge pull request #1546 from sharwell/fix-1545
Fix multiple problems with optional block bypass at end of rule
2016-12-27 21:47:12 -08:00
Sam Harwell 24b20e236f Remove redundant isExpectedToken check
We know by the time this check was reached that neither EPSILON nor the LL(1)
symbol are in the lookahead set from the current state. Since EPSILON is not
included, the state cannot see to the end of the rule and thus nextTokens
contains the complete set of valid LL(1) symbols from the current state. It is
therefore impossible for the LL(1) symbol to be "expected" when considering
lookahead with full context.
2016-12-27 17:21:25 -06:00
Ivan Kochurkin 03a75a5ce6 fix error "'CommonToken' object has no attribute 'stopIndex' in Python{2|3}" #1529. 2016-12-24 18:22:48 +03:00
Sam Harwell 8b21cc3dfb Fix DefaultErrorStrategy.sync handling of end of rule
This change updates the default sync() strategy to match the strategy used
for selecting an alternative when prediction leaves the decision rule prior
to reaching a syntax error.

Closes #1545
2016-12-23 16:28:46 -06:00
Eric Vergnaud 6398a06fba fixes #1530 and #1531 2016-12-20 23:27:08 +08:00
parrt c4c2966dbd update doc 2016-12-15 20:42:29 -08:00
Terence Parr 6a20919cb7 Merge pull request #1476 from renatahodovan/python-target-1472
Implement the fix of #1298 for Python targets.
2016-12-11 14:49:28 -08:00
Terence Parr c7e27664c2 Merge pull request #1471 from renatahodovan/visit-error-node
Call visitErrorNodes properly in Python targets.
2016-12-11 14:48:21 -08:00
Renata Hodovan 58d51450d4 Implement the fix of #1298 for Python targets.
The patch adapts the fix in PR #1472 for Python targets.
2016-12-10 02:41:08 +01:00
Terence Parr 82372aae2c Merge pull request #1460 from renatahodovan/intervalset-range-fix
Fix AttributeError when trying to write an immutable variable in Python.
2016-12-09 16:05:11 -08:00
Renata Hodovan bd09023209 Call visitErrorNodes properly in Python targets.
The consume method of the Parser class calls visitTerminal on both
TerminalNodes and ErrorNodes even if the comment above states that
ErrorNodes should be visited by visitErrorNodes. This behaviour
is also inconsitent with the Java target. The patch fixes this in
both Python targets.
2016-12-09 19:41:23 +01:00