Skip to content
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

Can I keep my annotations when parsing SQL into objects? #1113

Closed
liuxiswt opened this issue Jan 29, 2021 · 2 comments
Closed

Can I keep my annotations when parsing SQL into objects? #1113

liuxiswt opened this issue Jan 29, 2021 · 2 comments

Comments

@liuxiswt
Copy link

Hi, developers, because the SQL I work with is very complex, I will add a lot of comments to the SQL.But when I use JSQLParser, it automatically removes the annotations from the body.Please, can I keep my annotations in the parsed object? Thank you very much and I am looking forward to your reply

@wumpz
Copy link
Member

wumpz commented Jan 31, 2021

Unfortunately, this is not possible, since comments are parsed as special tokens that are finally skipped. However, it is possible to intercept those special tokens: https://www.cs.purdue.edu/homes/hosking/javacc/doc/tokenmanager.html.

@liuxiswt
Copy link
Author

liuxiswt commented Feb 1, 2021

Thank you very much for your reply. I will try to use the interception scheme to restore the annotations, because I think I still need the SQL annotations, because it will be very convenient for me to read the SQL.

@wumpz wumpz closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants