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

add_clickhouse_g4 #4234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wangyang377
Copy link
Contributor

Based on the G4 file in the clickhouse source code, I made some modifications to adapt to the static SQL parsing of antlr4.

@wangyang377
Copy link
Contributor Author

When I want to directly use the G4 file in the source code, I encounter the following problem.
Snipaste_2024-09-12_10-57-13
Now, everything is done.

@wangyang377
Copy link
Contributor Author

@teverett Please take a look, thank you very much

@KvanTTT KvanTTT added the new-grammar New grammar issue or pull request label Sep 19, 2024
// $antlr-format alignTrailingComments true, allowShortBlocksOnASingleLine true, allowShortRulesOnASingleLine true, columnLimit 150
// $antlr-format maxEmptyLinesToKeep 1, minEmptyLines 0, reflowComments false, singleLineOverrulesHangingColon true, useTab false

lexer grammar ClickHouseLexer;
Copy link
Member

@KvanTTT KvanTTT Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use caseInsensitive option in lexer and replace fragments with string literals? See SQL grammars as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your advice. But replacing all fragments will make a big change to the g4 file in clickhouse source code and makes little sense to the lexer result. Is it necessary to do this format change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-grammar New grammar issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants