GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Enhanced Keywords by manticore-projects · Pull Request #1382 · JSQLParser/JSqlParser Conversation
|
| } | ||
| { | ||
| table=Table() [alias=Alias() { table.setAlias(alias); }] | ||
| table=Table() [ LOOKAHEAD(2) alias=Alias() { table.setAlias(alias); }] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It should be the aim to do less not more LOOKAHEADs. All this for some keywords?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, all this for some keywords (although the Alias() Production is affected mostly)
But why exactly would you deny Tokens, which are not defined in the holy SQL:2016 standard as keywords when there is no compelling technical reason ?
Complaints about keywords are felt the second most concern of the users, right after quoting/escaping text and objects.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
To me it's not directly obvious why this LOOKAHEAD is needed. Is that explained somewhere?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Derive All Keywords from Grammar directly Generate production for Object Names (semi-) automatically Add parametrized Keyword Tests
There was an error while loading. Please reload this page.
|
@wumpz: Please check out the great work on PR #1254. It adds a new token Of course the author @OlivierCavadenti has no chance to know, that he would need to add This PR would solve this challenge reliably, preventing new tokens from breaking valid statements and ease the entry for new contributors. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
# Conflicts: # src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Update keywords
| } | ||
| } | ||
|
|
||
| task updateKeywords(type: JavaExec) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Since I do not use gradle, what does this do?
Maven is the main build engine. You changed some gradle build options. Does the maven build still run?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It generates and prints the Source Code Text of the method RelObjectName() which you would manually insert/replace in the JSQL Grammar file.
This step is optional and does not affect the Maven build. It is executed manually and on demand only.
Although the long term goal was to have a mechanism inside the build tool (Gradle and/or Maven), which during the build:
RelObjectName() and friends)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this might also be implemented in a mojo in Maven, but that might be not worth the effort.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The naming of this RelObjectName ... methods is sure an issue that should be adressed in futher improvements. So sorry for that: its grown ... ;) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I am not a fan of injecting those keywords, since not every keyword could be introduced this way and needs other parts of the grammar to be modified. However, building this keyword testing using JUnit 5 is cool. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You would do me a great favor by documenting the purpose of those 5 methods verbosely. I tried my best to figure it out by trial'n error but I am still not exactly sure why we ended up with 5 methods. (And no worries about grown code.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Honestly, I am not a big fan of that PR either -- but after spending many days on that matter trying various things it was the best approach I found and in my opinion it is still much better than the current state:
The work flow is to: a) define the Tokens and Productions in the Grammar first and then b) document any new RESERVED Keywords only in the List (emphasis on RESERVED). The PR has one big advantaged: By defining RESERVED keywords only, it will determine automatically any allowed Keywords and modify the Grammar semi-automatically. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Allow me to ask please:
And can we have a Skype chat about this :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
No, it is exactly the opposite: Only when those tests fail, we would have to amend Where I still fail to understand you plan is this point:
So how would you run your Tests without whitelisting in the grammar first? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Simply this test will fail until you whitelist or restrict the new tokens. That's what forces developers to do this decision (for us). You are right, that the restricted list should change rarely. The test should then give an advice, how and were this change should be done.
I was not aware of this automatic whitelist keyword building. So this is +1. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So are you going to resolve the conflicts? This improvement of parsing could be done afterwards. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
# Conflicts: # src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
|
@wumpz When could this pr be merged? The parse error is really annoying. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I can supply you with a bleeding edge JAR file including those PRs, in case its urgent. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So after merging, I am not able to build anymore since So how should I proceed if I am not willing to use gradle? Isn't that the same problem you had with my proposal? Maven is the main build pipeline. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Good Morning. Thank you for finally accepting the PR. What caused the problem:
Solution: This should have been done by the author of the It is exactly as you have requested for in your explanations. Although I will run through this procedure today and send a very small PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
If you insist in not using I would also provide an equivalent Maven task soon, since we are moving forward now. Workflow should be like that: Using gradle updateKeywords task is optional, you can also add the new Tokens manually has it has always been done before. After accepting the Keywords PR, any further PR will automatically fail acceptance tests, unless keywords are in order. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
No developer that is using maven knows what to do here? So this workflow has somehow to be included in a developer help. At the moment this is only your tool, since nobody knows and not everybody uses gradle. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Since we are not willing to run the gradle task and your tests use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Additional since some JavaCC methods are in place now there is a direct dependency for JavaCC. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, because you insisted to parse the Grammer using JavaCC instead of using Regular Expressions. I suggest to use Regular Expressions instead for that reason.
Because this is exactly what you would have done before the semi-automation: edit the Production That said, I have added a Maven Task for running the same mvn compile exec:java
Yes, of course. It has been verbosely documented within the new website, which I have committed 1 month ago or so: https://manticore-projects.com/JSQLParser/contribution.html#manage-reserved-keywords I have updated the Keywords2 PR #1653 accordingly with your requested Maven task. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The Maven task could be implemented as a mojo (maven-plugin) I think, are you interested in that? Then you can run this plugin from the pom.xml during, for example, the generate-sources phase. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have some experience writing these maven plugins, so if I infd some time this week, maybe I could draft up some integration so it 'just works' when you run for example |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
But probably this will work as well: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! I have add submitted another PR like that on Saturday already. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah excellent! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I can't find that PR? I think there might also be a chicken-and-egg problem, as the java code that does the work, also needs to be compiled first? (you can solve that using multi-module maven build, but that requires a bit more refactoring) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
this one: #1653 Its pretty straight forward actually since we can execute Java Code directly without compiling the whole package. Also, this step is executed on demand: only when new tokens introduced and/or the Keyword Tests fail. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That's why e.g. my proposal is only running in scope test. Then this dependency is not needed. I was talking about the IMHO right way to parse the grammar and not the context in which this parsing should happen. I thought this should be obvious. For the same reason, the JSqlParser jar should not include this generation class. It is part of the build process (I know you do not accept that, but I think it's evident.) So a quick solution would be to put all of it in the test folder and make this JavaCC dependency of scope test. However, to get a clean build again use for now Regular Expressions. Saying that, since this is a build step or could be one, it should be separated from JSqlParser source code and put in some kind of build helper module and then could be definitely used if JSqlparser is built. Now If you clone this project you will fail, since the generator class is not yet built.
I have reviewed it already and found in this issue the needed information on how to run it, so I will merge it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
where table_name = select database() has exception CCJSqlParserUtil fails on different variable names select database() 4.3Release:Error SQL:select database() from dual Unexpected token: apply
There was an error while loading. Please reload this page.