grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

tiny python awol

Open jmikedupont2 opened this issue 2 years ago • 4 comments
trafficstars

mvn test failing

I needed to fix it with git checkout 6590fdd07b9fa1b4a66025c8315ee2c93bbcbe7d python/tiny-python

jmikedupont2 avatar Nov 15 '23 03:11 jmikedupont2

tiny-python was removed because there are too many Python grammars to support. And the "tiny" grammars had a number of issues.

  • There were not one, but two "tiny" grammars.
  • It was unclear what version of Python each "tiny" grammar supported.
  • The Maven tester didn't actually test the generated parser on Python input: it only ran the grammar through the Antlr tool.
  • The Maven tester is obsolete. It uses Antlr 4.11.1. And, it only works for Java.
  • The "test" inputs were intermingled with the grammar source code. For example, test.py--which is only one test, and is only two-lines in length--is in the same directory as Python3.g4 of "tiny-grammar-with-actions". The grammar itself only works for Java due to the actions.
  • Driver code was intermingled with the grammar. All drivers are generated from templates so they can be tested across OSes and targets.

The author of the "tiny" grammars, https://github.com/RobEin, worked very hard to rewrite the Python grammars for Python2 and Python3. These grammars are here: python2_7_18 and python3_12_0. The grammars have not been ported to all the targets, so there is more work to do to clean up the Python grammars.

kaby76 avatar Nov 15 '23 12:11 kaby76

Well the problem was that when I ran make tests it failed because it was looking for that directly so I had to add it back in to get the test to work

On Wed, Nov 15, 2023, 07:27 Ken Domino @.***> wrote:

tiny-python was removed because there are too many Python grammars to support. And the "tiny" grammars had a number of issues.

The author of the "tiny" grammars, https://github.com/RobEin, worked very hard to rewrite the Python grammars for Python2 and Python3. These grammars are here: python2_7_18 https://github.com/antlr/grammars-v4/tree/master/python/python2_7_18 and python3_12_0 https://github.com/antlr/grammars-v4/tree/master/python/python3_12_0. The grammars have not been ported to all the targets, so there is more work to do to clean up the Python grammars.

— Reply to this email directly, view it on GitHub https://github.com/antlr/grammars-v4/issues/3827#issuecomment-1812449966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5KQ2MIXPCCUIQIOBHFCODYESYJ5AVCNFSM6AAAAAA7L2OFNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJSGQ2DSOJWGY . You are receiving this because you authored the thread.Message ID: @.***>

jmikedupont2 avatar Nov 15 '23 12:11 jmikedupont2

Well the problem was that when I ran make tests it failed because it was looking for that directly so I had to add it back in to get the test to work

The fix is to remove tiny-python from the upper-level pom.xml.

$ git diff .
diff --git a/python/pom.xml b/python/pom.xml
index c31c25d6..640d11c1 100644
--- a/python/pom.xml
+++ b/python/pom.xml
@@ -15,6 +15,5 @@
         <module>python</module>
         <module>python2</module>
         <module>python3</module>
-        <module>tiny-python</module>
     </modules>
 </project>

But, I now see the two new grammars are not in the pom.xml. This needs to be fixed.

I'm doing a "mvn test" in the repo root to see what needs fixing (e.g., cpp/). Will submit a PR to fix.

kaby76 avatar Nov 15 '23 12:11 kaby76

Please check with the latest on "master" (mvn test) and close. Thanks.

kaby76 avatar Nov 18 '23 13:11 kaby76