diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c0b82adfbf348fc5ab92839a7c3059dba6f1b0..6e134b18e3e901f7045b66a385678a50472e5a6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,4 +50,3 @@ find_package(Boost 1.41 REQUIRED COMPONENTS program_options filesystem regex) add_subdirectory(libwccl) add_subdirectory(tests) - diff --git a/libwccl/CMakeLists.txt b/libwccl/CMakeLists.txt index 00ed846ce422e14519469496d60f9b3a88e19aa8..e96ecc2edcff0c282bc917ed8924861803d72e83 100644 --- a/libwccl/CMakeLists.txt +++ b/libwccl/CMakeLists.txt @@ -15,12 +15,13 @@ set(LIBS ${LIBS} ${Boost_LIBRARIES}) SET(libwccl_STAT_SRC exception.cpp - main.cpp ops/and.cpp ops/or.cpp ops/logicalpredicate.cpp - ops/nor.cpp + ops/nor.cpp ops/predicate.cpp + parser/Parser.cpp + parser/ParserException.cpp sentencecontext.cpp values/bool.cpp values/position.cpp @@ -31,10 +32,21 @@ SET(libwccl_STAT_SRC variables.cpp ) +SET(libwccl_STAT_SRC ${libwccl_STAT_SRC} + parser/ANTLRLexer.cpp + parser/ANTLRParser.cpp +) + +ADD_CUSTOM_COMMAND( + OUTPUT parser/ANTLRLexer.cpp parser/ANTLRLexer.hpp parser/ANTLRParser.cpp parser/ANTLRParser.hpp parser/ANTLRExprTokenTypes.hpp parser/ANTLRExprTokenTypes.txt + COMMAND runantlr -o parser parser/grammar.g + DEPENDS parser/grammar.g + COMMENT "-- Generating parser/ANTLRLexer.cpp parser/ANTLRLexer.hpp parser/ANTLRExprTokenTypes.hpp parser/ANTLRExprTokenTypes.txt parser/ANTLRParser.cpp parser/ANTLRParser.hpp") + file(GLOB_RECURSE INCS "*.h") add_library(wccl SHARED ${libwccl_STAT_SRC} ${INCS}) -target_link_libraries ( wccl ${LIBS} ) +target_link_libraries ( wccl ${LIBS}) set_target_properties(wccl PROPERTIES VERSION "${ver_major}.${ver_minor}" diff --git a/libwccl/main.cpp b/libwccl/main.cpp deleted file mode 100644 index 1f8701d8822b33010d14c6d3e0436df4e495ab6f..0000000000000000000000000000000000000000 --- a/libwccl/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ - -namespace Wccl { - -} /* end ns Wccl */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 167604e830421a6612c5260df0de5c9cc9739020..065b15f4864788b07b3d1466ead482695a130e33 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,7 +14,7 @@ add_executable(tests variables.cpp ) -target_link_libraries ( tests wccl ${Boost_LIBRARIES}) +target_link_libraries ( tests wccl ${Boost_LIBRARIES} antlr) include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS})