Repository navigation
refactor(clp-s): Add ANTLR-generated parsers to codebase to eliminate need for code dependencies at build time. #925
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
0a2f8bc
Experiment on removing ANTLR4
5b43788
Remove ANTLR for sql as well
19f1e80
Add ANTLR generation to task and exempt lint check for generated code
19a6cc4
Fix lint
8c8a6f3
Fix lint
8ba8191
Fix Devin comments
fc1f64c
Fix lint
cb707a7
Merge branch 'main' into xwei/-remove-antlr
anlowee a7072be
Test
17e3800
Add github workflow
6eda0ee
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
bd0abcd
Fix
d0daacf
Fix
ddb047c
Fix
b9f16ea
Fix lint
b2ec42f
Fix
9d121af
Fix
1210f2b
Minor refactor
108f61d
Fix lint
f4742f2
Fix coderabbit
b8b804e
Merge branch 'main' into xwei/-remove-antlr
anlowee 7878b3b
Merge branch 'main' into xwei/-remove-antlr
anlowee f457bff
Merge branch 'main' into xwei/-remove-antlr
anlowee 09faf7c
Fix
075ca5b
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
8b3191c
Merge branch 'main' into xwei/-remove-antlr
anlowee abcb91d
Merge branch 'main' into xwei/-remove-antlr
anlowee e88d914
Merge branch 'main' into xwei/-remove-antlr
anlowee da1523b
Add antlr-runtime task to download and install the antlr-runtime libr…
kirkrodrigues 4f15581
Merge branch 'main' into xwei/-remove-antlr
anlowee 7cec3fd
Merge branch 'main' into xwei/-remove-antlr
anlowee 399803f
Merge branch 'main' into xwei/-remove-antlr
anlowee b7a0519
Merge branch 'main' into xwei/-remove-antlr
anlowee 7507fec
Limit task concurrency to the number of available cores.
kirkrodrigues 4bb484e
Test hard-coding number of parallel tasks that can be run.
kirkrodrigues cfd48c0
Execute one task at a time.
kirkrodrigues 4a8ad65
Limit the antlr-runtime build to 2 cores.
kirkrodrigues 0c3e5e1
Revert "Limit the antlr-runtime build to 2 cores."
kirkrodrigues 5fee637
Revert "Execute one task at a time."
kirkrodrigues 10baa2d
Revert "Test hard-coding number of parallel tasks that can be run."
kirkrodrigues 51bcf30
Revert "Limit task concurrency to the number of available cores."
kirkrodrigues 6760985
Fix
457254e
Test
e30dc2b
Test over
7b27d63
Fix all comments
0270ef2
Fix lint
c8277a0
Fix
4b83336
Fix
2980015
Fix some coderabbit comments
3ef0261
Merge branch 'main' into xwei/-remove-antlr
anlowee 7727eed
Limit task concurrency to number of cores.
kirkrodrigues b5b2909
Don't use a shell variable.
kirkrodrigues 6da4782
Limit task concurrency to 1.
kirkrodrigues e9c6c36
Account for shell variable expansion.
kirkrodrigues 9d9d91c
Specify JOBS for antlr-runtime task.
kirkrodrigues c493f54
Revert "Account for shell variable expansion."
kirkrodrigues 9a30c0b
Revert "Limit task concurrency to 1."
kirkrodrigues 3bcf6fe
Revert "Don't use a shell variable."
kirkrodrigues 6b4f74e
Revert "Limit task concurrency to number of cores."
kirkrodrigues 616bb69
Merge branch 'main' into xwei/-remove-antlr
anlowee 529787e
Fix
0f5cda6
Merge branch 'main' into xwei/-remove-antlr
anlowee 660e2c5
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
b86cc0a
Fix
bcbd0fe
Change to generated in lint.yaml
54b73cc
Fix
76fd933
Fix
37dbe46
Fix
b07a57a
Fix
9c741d0
Fix
8a9449e
Fix
b35a0c9
Fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
components/core/src/clp_s/search/kql/antlr_generated/Kql.interp
|
anlowee marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| token literal names: | ||
| null | ||
| ':' | ||
| '{' | ||
| '}' | ||
| '(' | ||
| ')' | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
|
|
||
| token symbolic names: | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| null | ||
| AND | ||
| OR | ||
| NOT | ||
| DATE_LITERAL | ||
| LITERAL | ||
| QUOTED_STRING | ||
| UNQUOTED_LITERAL | ||
| RANGE_OPERATOR | ||
| SPACE | ||
|
|
||
| rule names: | ||
| start | ||
| query | ||
| expression | ||
| column_range_expression | ||
| column_value_expression | ||
| column | ||
| value_expression | ||
| list_of_values | ||
|
|
||
|
|
||
| atn: | ||
| [4, 1, 14, 78, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 34, 8, 1, 1, 1, 1, 1, 1, 1, 5, 1, 39, 8, 1, 10, 1, 12, 1, 42, 9, 1, 1, 2, 1, 2, 1, 2, 3, 2, 47, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 53, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 60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 10, 5, 0, 49, 52, 5, 13, 0, 0, 50, 53, 5, 9, 0, 0, 51, 53, 5, 10, 0, 0, 52, 50, 1, 0, 0, 0, 52, 51, 1, 0, 0, 0, 53, 7, 1, 0, 0, 0, 54, 55, 3, 10, 5, 0, 55, 59, 5, 1, 0, 0, 56, 60, 3, 14, 7, 0, 57, 60, 5, 9, 0, 0, 58, 60, 5, 10, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 62, 5, 10, 0, 0, 62, 11, 1, 0, 0, 0, 63, 64, 5, 10, 0, 0, 64, 13, 1, 0, 0, 0, 65, 67, 5, 4, 0, 0, 66, 68, 7, 1, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 72, 1, 0, 0, 0, 69, 71, 5, 10, 0, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 5, 0, 0, 76, 15, 1, 0, 0, 0, 7, 33, 40, 46, 52, 59, 67, 72] |
19 changes: 19 additions & 0 deletions
19
components/core/src/clp_s/search/kql/antlr_generated/Kql.tokens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| T__0=1 | ||
| T__1=2 | ||
| T__2=3 | ||
| T__3=4 | ||
| T__4=5 | ||
| AND=6 | ||
| OR=7 | ||
| NOT=8 | ||
| DATE_LITERAL=9 | ||
| LITERAL=10 | ||
| QUOTED_STRING=11 | ||
| UNQUOTED_LITERAL=12 | ||
| RANGE_OPERATOR=13 | ||
| SPACE=14 | ||
| ':'=1 | ||
| '{'=2 | ||
| '}'=3 | ||
| '('=4 | ||
| ')'=5 |
9 changes: 9 additions & 0 deletions
9
components/core/src/clp_s/search/kql/antlr_generated/KqlBaseVisitor.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| // Generated from /mnt/clp/components/core/src/clp_s/search/kql/Kql.g4 by ANTLR 4.13.1 | ||
|
|
||
|
|
||
| #include "KqlBaseVisitor.h" | ||
|
|
||
|
|
||
| using namespace clp_s::search::kql; | ||
|
|
71 changes: 71 additions & 0 deletions
71
components/core/src/clp_s/search/kql/antlr_generated/KqlBaseVisitor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
|
|
||
| // Generated from /mnt/clp/components/core/src/clp_s/search/kql/Kql.g4 by ANTLR 4.13.1 | ||
|
|
||
| #pragma once | ||
|
|
||
|
|
||
| #include "antlr4-runtime.h" | ||
| #include "KqlVisitor.h" | ||
|
|
||
|
|
||
| namespace clp_s::search::kql { | ||
|
|
||
| /** | ||
| * This class provides an empty implementation of KqlVisitor, which can be | ||
| * extended to create a visitor which only needs to handle a subset of the available methods. | ||
| */ | ||
| class KqlBaseVisitor : public KqlVisitor { | ||
| public: | ||
|
|
||
| virtual std::any visitStart(KqlParser::StartContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitExpr(KqlParser::ExprContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitNestedQuery(KqlParser::NestedQueryContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitNotQuery(KqlParser::NotQueryContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitSubQuery(KqlParser::SubQueryContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitOrAndQuery(KqlParser::OrAndQueryContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitExpression(KqlParser::ExpressionContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitColumn_range_expression(KqlParser::Column_range_expressionContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitColumn_value_expression(KqlParser::Column_value_expressionContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitColumn(KqlParser::ColumnContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitValue_expression(KqlParser::Value_expressionContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
| virtual std::any visitList_of_values(KqlParser::List_of_valuesContext *ctx) override { | ||
| return visitChildren(ctx); | ||
| } | ||
|
|
||
|
|
||
| }; | ||
|
|
||
| } // namespace clp_s::search::kql |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
ANTLR_GENERATED_SOURCES(to be consistent with the variable naming in other CMake files)?