Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
0a2f8bc
Experiment on removing ANTLR4
May 22, 2025
5b43788
Remove ANTLR for sql as well
May 23, 2025
19f1e80
Add ANTLR generation to task and exempt lint check for generated code
May 26, 2025
19a6cc4
Fix lint
May 26, 2025
8c8a6f3
Fix lint
May 26, 2025
8ba8191
Fix Devin comments
May 26, 2025
fc1f64c
Fix lint
May 26, 2025
cb707a7
Merge branch 'main' into xwei/-remove-antlr
anlowee May 27, 2025
a7072be
Test
May 27, 2025
17e3800
Add github workflow
May 27, 2025
6eda0ee
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
May 27, 2025
bd0abcd
Fix
May 27, 2025
d0daacf
Fix
May 27, 2025
ddb047c
Fix
May 27, 2025
b9f16ea
Fix lint
May 27, 2025
b2ec42f
Fix
May 27, 2025
9d121af
Fix
May 27, 2025
1210f2b
Minor refactor
May 28, 2025
108f61d
Fix lint
May 28, 2025
f4742f2
Fix coderabbit
May 28, 2025
b8b804e
Merge branch 'main' into xwei/-remove-antlr
anlowee May 28, 2025
7878b3b
Merge branch 'main' into xwei/-remove-antlr
anlowee May 28, 2025
f457bff
Merge branch 'main' into xwei/-remove-antlr
anlowee May 29, 2025
09faf7c
Fix
May 30, 2025
075ca5b
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
May 30, 2025
8b3191c
Merge branch 'main' into xwei/-remove-antlr
anlowee May 30, 2025
abcb91d
Merge branch 'main' into xwei/-remove-antlr
anlowee May 30, 2025
e88d914
Merge branch 'main' into xwei/-remove-antlr
anlowee May 30, 2025
da1523b
Add antlr-runtime task to download and install the antlr-runtime libr…
kirkrodrigues May 31, 2025
4f15581
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 2, 2025
7cec3fd
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 2, 2025
399803f
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 3, 2025
b7a0519
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 3, 2025
7507fec
Limit task concurrency to the number of available cores.
kirkrodrigues Jun 3, 2025
4bb484e
Test hard-coding number of parallel tasks that can be run.
kirkrodrigues Jun 3, 2025
cfd48c0
Execute one task at a time.
kirkrodrigues Jun 4, 2025
4a8ad65
Limit the antlr-runtime build to 2 cores.
kirkrodrigues Jun 4, 2025
0c3e5e1
Revert "Limit the antlr-runtime build to 2 cores."
kirkrodrigues Jun 4, 2025
5fee637
Revert "Execute one task at a time."
kirkrodrigues Jun 4, 2025
10baa2d
Revert "Test hard-coding number of parallel tasks that can be run."
kirkrodrigues Jun 4, 2025
51bcf30
Revert "Limit task concurrency to the number of available cores."
kirkrodrigues Jun 4, 2025
6760985
Fix
Jun 4, 2025
457254e
Test
Jun 4, 2025
e30dc2b
Test over
Jun 4, 2025
7b27d63
Fix all comments
Jun 4, 2025
0270ef2
Fix lint
Jun 4, 2025
c8277a0
Fix
Jun 4, 2025
4b83336
Fix
Jun 4, 2025
2980015
Fix some coderabbit comments
Jun 4, 2025
3ef0261
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 5, 2025
7727eed
Limit task concurrency to number of cores.
kirkrodrigues Jun 5, 2025
b5b2909
Don't use a shell variable.
kirkrodrigues Jun 5, 2025
6da4782
Limit task concurrency to 1.
kirkrodrigues Jun 5, 2025
e9c6c36
Account for shell variable expansion.
kirkrodrigues Jun 5, 2025
9d9d91c
Specify JOBS for antlr-runtime task.
kirkrodrigues Jun 5, 2025
c493f54
Revert "Account for shell variable expansion."
kirkrodrigues Jun 5, 2025
9a30c0b
Revert "Limit task concurrency to 1."
kirkrodrigues Jun 5, 2025
3bcf6fe
Revert "Don't use a shell variable."
kirkrodrigues Jun 5, 2025
6b4f74e
Revert "Limit task concurrency to number of cores."
kirkrodrigues Jun 5, 2025
616bb69
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 5, 2025
529787e
Fix
Jun 5, 2025
0f5cda6
Merge branch 'main' into xwei/-remove-antlr
anlowee Jun 5, 2025
660e2c5
Merge branch 'xwei/-remove-antlr' of github.com:anlowee/clp into xwei…
Jun 5, 2025
b86cc0a
Fix
Jun 5, 2025
bcbd0fe
Change to generated in lint.yaml
Jun 5, 2025
54b73cc
Fix
Jun 5, 2025
76fd933
Fix
Jun 5, 2025
37dbe46
Fix
Jun 6, 2025
b07a57a
Fix
Jun 6, 2025
9c741d0
Fix
Jun 6, 2025
8a9449e
Fix
Jun 6, 2025
b35a0c9
Fix
Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ endif()

# Find and setup ANTLR Library
# We build and link to the static library
find_package(ANTLR REQUIRED)
if (ANTLR_FOUND)
message(STATUS "Found ANTLR ${ANTLR_VERSION}")
else()
message(FATAL_ERROR "Could not find libraries for ANTLR ${ANTLR4_TAG}")
endif()
include(ExternalAntlr4Cpp)

# Find and setup Boost Library
if(CLP_USE_STATIC_LIBS)
Expand Down
138 changes: 0 additions & 138 deletions components/core/cmake/Modules/FindANTLR.cmake

This file was deleted.

20 changes: 13 additions & 7 deletions components/core/src/clp_s/search/kql/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
ANTLR_TARGET(
KqlParser
Kql.g4
LEXER PARSER VISITOR
PACKAGE kql
set(ANTLR_GENERATED_KQL_CODE_DIR antlr_generated)

set(ANTLR_GENERATED_KQL_CODE

Copy link
Copy Markdown
Member

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)?

${ANTLR_GENERATED_KQL_CODE_DIR}/KqlBaseVisitor.cpp
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlBaseVisitor.h
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlLexer.cpp
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlLexer.h
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlParser.cpp
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlParser.h
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlVisitor.cpp
${ANTLR_GENERATED_KQL_CODE_DIR}/KqlVisitor.h
)

add_library(
kql
../antlr_common/ErrorListener.hpp
${ANTLR_KqlParser_CXX_OUTPUTS}
${ANTLR_GENERATED_KQL_CODE}
kql.cpp
kql.hpp
)
target_compile_features(kql PRIVATE cxx_std_20)
target_include_directories(kql PRIVATE ${ANTLR_KqlParser_OUTPUT_DIR})
target_include_directories(kql PRIVATE ${ANTLR_GENERATED_KQL_CODE_DIR})
target_link_libraries(
kql
PRIVATE
Expand Down
47 changes: 47 additions & 0 deletions components/core/src/clp_s/search/kql/antlr_generated/Kql.interp
Comment thread
anlowee marked this conversation as resolved.
Outdated
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,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47, 3, 12, 6, 0, 46, 43, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 46, 45, 1, 0, 0, 0, 47, 5, 1, 0, 0, 0, 48, 49, 3, 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 components/core/src/clp_s/search/kql/antlr_generated/Kql.tokens
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
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;

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
Loading