-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Python3 grammar for Python3 target #572
Conversation
Thanks! |
Oops. causes a build failure:
|
Yes so, should I put same name for both files ? or change the grammar name ? |
Diff files have to have diff grammar names inside. Make new file have |
@parrt |
Hmm...we apparently need to modify the pom.xml for that so it doesn't try to build with java target. @teverett any ideas? |
Can this pull wait until after antlr4-4.7, so that we can make fixed once, not twice? |
Also, I have modified |
nope. |
When is the 4.7 release scheduled? It'd also be better we make a doc for such grammars which can vary target to target. Though I have no idea how many grammars in this repo are target dependent. |
I presume 4.7 is soon. There is the release of Antlr4.7, then the test
plugin updated for 4.7, then grammars-v4 updated for 4.7. So, there are a
couple steps, and I'd like to get them done before pulling more onto
grammars-v4.
…On Sun, Mar 12, 2017 at 1:54 PM, Rishav Kumar ***@***.***> wrote:
When is the 4.7 release scheduled? It'd also be better we make a doc for
such grammars which can vary target to target. Though I have no idea how
many grammars in this repo are target dependent.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#572 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABK1ZrqinD2TI2uWh8SkTyvaeMvog0q5ks5rlE1bgaJpZM4MajZW>
.
--
A better world shall emerge based on faith and understanding - Douglas
MacArthur
|
Can we organize grammars for different runtimes by the following way?
RuntimeName can be one of the following items:
But GrammarName should be the same for one grammar. Such structure unify grammar processing by different projects. See PHP grammar for example. |
Well good idea but I'm hoping to keep grammars action free. Python is special given it's INDENT/DEDENT rules. |
I'm trying to make Python3 grammar action free. I'll replace INDENT/DEDENTs with common delimiters like '{'. |
I'd go with INDENT/DEDENT to avoid confusion and "this isn't python" issues from people ;) |
Yes true.That'd create confusion. Using INDENT/DEDENT is better. |
@parrt it's not possible to keep grammars action free. Context-sensitivity rules require grammar actions. |
Very few grammars require semantic predicates. |
@aptrishu this pull request has failed the travis build with
|
Looks weird, I'll look into it tomorrow. |
@teverett can I see on which test it failed/produced such output? |
Best way is for you to click the "details" button which takes you to Travis and you can see the logs |
Yeah, log is quite big(Also it only shows the tests being executed,their pass/failure) that's why I asked for an alternative where I could see on which specific file it produced such output. Ok I'll look into the logs. Thanks. |
@teverett are we ok to merge this? |
@parrt well, no, because the tests don't pass. |
Here are the specific log messages for the failure [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[3,1] class, interface, or enum expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[3,37] '.' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[4,5] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[4,40] '.' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[5,7] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[133,15] expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[133,18] illegal start of expression [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[133,19] illegal start of type [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[134,19] illegal start of expression [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[134,20] illegal start of type [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[136,18] expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[136,25] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[138,27] expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[138,30] expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[138,31] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[170,39] expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[170,40] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[236,54] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[237,64] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[238,62] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[239,49] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,27] '(' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,43] ')' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,51] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,47] variable declaration not allowed here [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,67] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[241,83] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[242,35] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[243,29] illegal start of expression [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[243,25] 'else' without 'if' [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[244,33] illegal start of expression [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[244,43] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[244,83] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[245,70] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,55] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,58] '(' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,71] ')' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,77] not a statement [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,78] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[246,72] 'else' without 'if' [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[248,39] not a statement [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[248,50] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[249,44] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[250,40] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[251,60] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[252,95] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[253,33] illegal start of expression [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[253,29] 'else' without 'if' [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[254,55] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[254,72] not a statement [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[254,80] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[255,72] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[256,55] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[264,41] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[271,41] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[278,41] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[285,41] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[292,41] ';' expected [ERROR] /home/travis/build/antlr/grammars-v4/python3/target/generated-sources/antlr4/Python3_pyLexer.java:[299,41] ';' expected [INFO] 59 errors |
Ah sorry I thought there was a commit after that that was meant to fix them
…Sent from my iPhone
On Sep 16, 2017, at 10:44 AM, Tom Everett ***@***.***> wrote:
@parrt well, no, because the tests don't pass.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Please suggest a better name of the python target grammar file. Also, the documentation needs improvement I think.