Skip to content
Snippets Groups Projects
Commit fcfb65f9 authored by rk's avatar rk
Browse files

Added parser.

parent 5cbb29dc
Branches
No related merge requests found
...@@ -50,4 +50,3 @@ find_package(Boost 1.41 REQUIRED COMPONENTS program_options filesystem regex) ...@@ -50,4 +50,3 @@ find_package(Boost 1.41 REQUIRED COMPONENTS program_options filesystem regex)
add_subdirectory(libwccl) add_subdirectory(libwccl)
add_subdirectory(tests) add_subdirectory(tests)
...@@ -15,12 +15,13 @@ set(LIBS ${LIBS} ${Boost_LIBRARIES}) ...@@ -15,12 +15,13 @@ set(LIBS ${LIBS} ${Boost_LIBRARIES})
SET(libwccl_STAT_SRC SET(libwccl_STAT_SRC
exception.cpp exception.cpp
main.cpp
ops/and.cpp ops/and.cpp
ops/or.cpp ops/or.cpp
ops/logicalpredicate.cpp ops/logicalpredicate.cpp
ops/nor.cpp ops/nor.cpp
ops/predicate.cpp ops/predicate.cpp
parser/Parser.cpp
parser/ParserException.cpp
sentencecontext.cpp sentencecontext.cpp
values/bool.cpp values/bool.cpp
values/position.cpp values/position.cpp
...@@ -31,10 +32,21 @@ SET(libwccl_STAT_SRC ...@@ -31,10 +32,21 @@ SET(libwccl_STAT_SRC
variables.cpp 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") file(GLOB_RECURSE INCS "*.h")
add_library(wccl SHARED ${libwccl_STAT_SRC} ${INCS}) add_library(wccl SHARED ${libwccl_STAT_SRC} ${INCS})
target_link_libraries ( wccl ${LIBS} ) target_link_libraries ( wccl ${LIBS})
set_target_properties(wccl PROPERTIES set_target_properties(wccl PROPERTIES
VERSION "${ver_major}.${ver_minor}" VERSION "${ver_major}.${ver_minor}"
......
namespace Wccl {
} /* end ns Wccl */
...@@ -14,7 +14,7 @@ add_executable(tests ...@@ -14,7 +14,7 @@ add_executable(tests
variables.cpp variables.cpp
) )
target_link_libraries ( tests wccl ${Boost_LIBRARIES}) target_link_libraries ( tests wccl ${Boost_LIBRARIES} antlr)
include_directories(${Boost_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS}) link_directories(${Boost_LIBRARY_DIRS})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment