diff --git a/.gitignore b/.gitignore index f822afc53..33d2014da 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ build/compiled/ cmake-build-* .idea cmake/DownloadProject/ +dist/ diff --git a/CMakeLists.txt b/CMakeLists.txt index d4c100e43..bbb6f3299 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,12 +5,14 @@ cmake_minimum_required(VERSION 3.1) # !! IMPORTANT !! run ./project_root/init.sh before cmake command # to download dependencies +if(NOT UNIX) + message(FATAL "Unsupported operating system.") +endif() + # choose a compiler -# NOTE: must be choosen before use of project() or enable_language() -if (UNIX) +# NOTE: must be choosen before use of project() or enable_language() ---------- set(CMAKE_C_COMPILER "clang") set(CMAKE_CXX_COMPILER "clang++") -endif (UNIX) # ----------------------------------------------------------------------------- # set project name @@ -50,11 +52,28 @@ set(test_include_dir ${CMAKE_BINARY_DIR}/tests/include) set(test_src_dir ${CMAKE_BINARY_DIR}/tests/src) # ----------------------------------------------------------------------------- -# setup external dependencies -# lemon & lempar -set(lemon_dir ${libs_dir}/lemon) -# lexertl -set(lexertl_dir ${libs_dir}/lexertl) +# build flags ----------------------------------------------------------------- +# release flags +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") +#debug flags +set(CMAKE_CXX_FLAGS_DEBUG "-g") + +# compiler specific flags +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # set(CMAKE_CXX_FLAGS_DEBUG "-Wl,--export-dynamic ${CMAKE_CXX_FLAGS_DEBUG}") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # set(CMAKE_CXX_FLAGS_DEBUG "-rdynamic ${CMAKE_CXX_FLAGS_DEBUG}") +endif() + +# default build type is debug +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE "debug") +endif() +message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") +# ----------------------------------------------------------------------------- + +# setup external dependencies ------------------------------------------------- +add_subdirectory(libs) # fmt set(fmt_source_dir ${libs_dir}/fmt) set(fmt_static_lib ${fmt_source_dir}/fmt/libfmt.a) @@ -62,31 +81,8 @@ set(fmt_static_lib ${fmt_source_dir}/fmt/libfmt.a) set(yaml_source_dir ${libs_dir}/yaml-cpp) set(yaml_include_dir ${yaml_source_dir}/include) set(yaml_static_lib ${yaml_source_dir}/libyaml-cpp.a) -# Catch (C++ Automated Test Cases in Headers) -set(catch_source_dir "${libs_dir}/Catch") -# ----------------------------------------------------------------------------- - -# load cmake modules: cmake/*.cmake -include(gtest) -include(gbenchmark) -# ----------------------------------------------------------------------------- - -# build memgraph's cypher grammar -# copy grammar file to the build directory -FILE(COPY ${include_dir}/query/language/cypher/cypher.y - DESTINATION ${CMAKE_BINARY_DIR}) -# build cypher parser (only c file - cypher.c) -EXECUTE_PROCESS( - COMMAND ${lemon_dir}/lemon ${CMAKE_BINARY_DIR}/cypher.y -s - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) -# change cypher parser c extension to cpp (cypher.c -> cypher.cpp) -FILE(RENAME ${CMAKE_BINARY_DIR}/cypher.c ${CMAKE_BINARY_DIR}/cypher.cpp) -# add include file (cypher.h) to build include dir -SET(cypher_build_include_dir ${build_include_dir}/cypher) -FILE(MAKE_DIRECTORY ${cypher_build_include_dir}) -FILE(RENAME ${CMAKE_BINARY_DIR}/cypher.h ${cypher_build_include_dir}/cypher.h) -# ----------------------------------------------------------------------------- +# antlr +set(antlr_static_lib ${CMAKE_SOURCE_DIR}/dist/libantlr4-runtime.a) # prepare template and destination folders for query engine (tests) # and memgraph server binary @@ -111,7 +107,8 @@ FILE(COPY ${tests_dir}/integration/stream # ----------------------------------------------------------------------------- # copy files needed for query engine (headers) -include(copy_includes) +# TODO: copy includes for runtime compilation +# include(copy_includes) # ----------------------------------------------------------------------------- # linter setup (clang-tidy) @@ -137,27 +134,7 @@ if(CLANG_TIDY) endif() # ----------------------------------------------------------------------------- -# TODO: add specific flags -# release flags -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") -#debug flags -set(CMAKE_CXX_FLAGS_DEBUG "-g") - -# compiler specific flags -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # set(CMAKE_CXX_FLAGS_DEBUG "-Wl,--export-dynamic ${CMAKE_CXX_FLAGS_DEBUG}") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - # set(CMAKE_CXX_FLAGS_DEBUG "-rdynamic ${CMAKE_CXX_FLAGS_DEBUG}") -endif() - -# default build type is debug -if ("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_BUILD_TYPE "debug") -endif() -message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") -# ----------------------------------------------------------------------------- - -# logging levels +# logging levels -------------------------------------------------------------- option(LOG_NO_TRACE "Disable trace logging" OFF) message(STATUS "LOG_NO_TRACE: ${LOG_NO_TRACE}") if (LOG_NO_TRACE) @@ -187,7 +164,6 @@ message(STATUS "LOG_NO_ERROR: ${LOG_NO_ERROR}") if (LOG_NO_ERROR) add_definitions(-DLOG_NO_ERROR) endif() -# TODO: find a way how to applay those defines at the query compile time # ----------------------------------------------------------------------------- # logger type @@ -269,24 +245,54 @@ include_directories(${src_dir}) include_directories(${build_include_dir}) include_directories(${fmt_source_dir}) include_directories(${yaml_include_dir}) -include_directories(${http_parser_source_dir}) -include_directories(${lexertl_dir}) -include_directories(${libuv_source_dir}/include) -include_directories(${rapidjson_source_dir}/include) -include_directories(${r3_source_dir}/include) # ----------------------------------------------------------------------------- -# creates build/libcypher_lib.a -add_library(cypher_lib STATIC ${CMAKE_BINARY_DIR}/cypher.cpp) -# ----------------------------------------------------------------------------- +# openCypher parser ----------------------------------------------------------- +set(antlr_src ${CMAKE_SOURCE_DIR}/libs/antlr4/runtime/Cpp/runtime/src) +set(opencypher_frontend ${CMAKE_SOURCE_DIR}/src/query/frontend/opencypher) +set(opencypher_generated ${opencypher_frontend}/generated) +set(opencypher_grammar ${opencypher_frontend}/grammar/Cypher.g4) -# TODO: remove from here (isolate HTTP server) -# # REST API preprocessor -# EXECUTE_PROCESS( -# COMMAND python link_resources.py -# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/api -# ) -# # --------------------------------------------------------------------------- +# enumerate all files that are generated from antlr +set(antlr_opencypher_generated_src + ${opencypher_frontend}/generated/CypherLexer.cpp + ${opencypher_frontend}/generated/CypherParser.cpp + ${opencypher_frontend}/generated/CypherBaseVisitor.cpp + ${opencypher_frontend}/generated/CypherVisitor.cpp +) + +# set generated flag to true +# foreach(src_file ${antlr_opencypher_generated_src}) +# set_source_files_properties( +# ${src_file} +# PROPERTIES +# GENERATED TRUE +# ) +# endforeach(src_file ${antlr_opencypher_generated_src}) + +# add custom target for generation +add_custom_target(generate_opencypher_parser + COMMAND + ${CMAKE_COMMAND} -E make_directory ${opencypher_generated} + COMMAND + java -jar ${CMAKE_BINARY_DIR}/antlr-4.6-complete.jar -Dlanguage=Cpp -visitor -o ${opencypher_generated} -package antlrcpptest ${opencypher_grammar} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + DEPENDS ${opencypher_grammar} + ) + +# include antlr header files +include_directories( + ${antlr_src} + ${antlr_src}/misc + ${antlr_src}/atn + ${antlr_src}/dfa + ${antlr_src}/tree + ${antlr_src}/support +) + +add_library(antlr_opencypher_parser_lib STATIC ${antlr_opencypher_generated_src}) +target_link_libraries(antlr_opencypher_parser_lib ${antlr_static_lib}) +# ----------------------------------------------------------------------------- # all memgraph src files set(memgraph_src_files @@ -316,10 +322,10 @@ set(memgraph_src_files ${src_dir}/storage/typed_value.cpp ${src_dir}/storage/locking/record_lock.cpp # ${src_dir}/storage/garbage/garbage.cpp - ${src_dir}/storage/record_accessor.cpp + ${src_dir}/storage/record_accessor.cpp ${src_dir}/storage/vertex_accessor.cpp - ${src_dir}/storage/edge_accessor.cpp -# ${src_dir}/storage/record_accessor.cpp + ${src_dir}/storage/edge_accessor.cpp +# ${src_dir}/storage/record_accessor.cpp ${src_dir}/transactions/snapshot.cpp ${src_dir}/transactions/transaction.cpp ${src_dir}/transactions/transaction_read.cpp @@ -357,6 +363,11 @@ if (ALL_TESTS OR BENCHMARK_TESTS OR CONCURRENT_TEST OR INTEGRATION_TEST endif() # ----------------------------------------------------------------------------- +execute_process( + COMMAND python recursive_include.py --root ${src_dir} --start ${src_dir}/query/plan_interface.hpp --copy ${CMAKE_BINARY_DIR}/include + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake +) + # memgraph build name execute_process( OUTPUT_VARIABLE COMMIT_BRANCH @@ -384,14 +395,20 @@ if (MEMGRAPH) target_link_libraries(${MEMGRAPH_BUILD_NAME} memgraph_lib) target_link_libraries(${MEMGRAPH_BUILD_NAME} stdc++fs) target_link_libraries(${MEMGRAPH_BUILD_NAME} Threads::Threads) - target_link_libraries(${MEMGRAPH_BUILD_NAME} cypher_lib) - - if (UNIX) -# target_link_libraries(${MEMGRAPH_BUILD_NAME} crypto) - # target_link_libraries(${MEMGRAPH_BUILD_NAME} ssl) - target_link_libraries(${MEMGRAPH_BUILD_NAME} ${fmt_static_lib}) - target_link_libraries(${MEMGRAPH_BUILD_NAME} ${yaml_static_lib}) - target_link_libraries(${MEMGRAPH_BUILD_NAME} dl) - endif (UNIX) +# target_link_libraries(${MEMGRAPH_BUILD_NAME} crypto) +# target_link_libraries(${MEMGRAPH_BUILD_NAME} ssl) + target_link_libraries(${MEMGRAPH_BUILD_NAME} ${fmt_static_lib}) + target_link_libraries(${MEMGRAPH_BUILD_NAME} ${yaml_static_lib}) + target_link_libraries(${MEMGRAPH_BUILD_NAME} ${antlr_static_lib}) + target_link_libraries(${MEMGRAPH_BUILD_NAME} antlr_opencypher_parser_lib) + target_link_libraries(${MEMGRAPH_BUILD_NAME} dl) endif() +# add_dependencies(${MEMGRAPH_BUILD_NAME} generate_opencypher_parser) # ----------------------------------------------------------------------------- + +# make CLion aware of all source files so we get refactoring etc +# TODO: fix snapshots and everything from src and then add custom target +#file(GLOB_RECURSE __SOURCES ${CMAKE_SOURCE_DIR}/src/*.hpp ${CMAKE_SOURCE_DIR}/src/*.cpp) +#add_executable(__refactor_target ${__SOURCES}) +#target_link_libraries(__refactor_target memgraph_lib stdc++fs Threads::Threads ${fmt_static_lib} ${yaml_static_lib} ${antlr_static_lib} antlr_opencypher_parser_lib dl) +#add_dependencies(__refactor_target generate_opencypher_parser) diff --git a/Doxyfile b/Doxyfile index 77d57872c..9d31b635e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -837,6 +837,7 @@ EXCLUDE_PATTERNS += */libs/* EXCLUDE_PATTERNS += */release/* EXCLUDE_PATTERNS += */Testing/* EXCLUDE_PATTERNS += */tests/* +EXCLUDE_PATTERNS += */dist/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/cmake/copy_includes.cmake b/cmake/copy_includes.cmake deleted file mode 100644 index fc5b8d9ff..000000000 --- a/cmake/copy_includes.cmake +++ /dev/null @@ -1,139 +0,0 @@ -# ----------------------------------------------------------------------------- -# COPY header files required by query engine (query compiler) -# TODO: create a copy function, COPY_RELATIVE(base relative_path dst) -# TODO: somehow automate (in destination dir should be only required include files) -FILE(COPY ${include_dir}/database/graph_db.hpp DESTINATION ${build_include_dir}/database) - -FILE(COPY ${include_dir}/storage/edge.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/edge_accessor.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/vertex.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/vertex_accessor.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/record_accessor.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/locking/record_lock.hpp DESTINATION ${build_include_dir}/storage/locking) -FILE(COPY ${include_dir}/storage/locking/lock_status.hpp DESTINATION ${build_include_dir}/storage/locking) - -FILE(COPY ${include_dir}/query/util.hpp DESTINATION ${build_include_dir}/query) -FILE(COPY ${include_dir}/query/plan_interface.hpp DESTINATION ${build_include_dir}/query) -FILE(COPY ${include_dir}/query/stripper.hpp DESTINATION ${build_include_dir}/query) - -FILE(COPY ${include_dir}/data_structures/concurrent/concurrent_map.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/concurrent/concurrent_set.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/concurrent/concurrent_list.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/concurrent/common.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/concurrent/skiplist.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/concurrent/skiplist_gc.hpp DESTINATION ${build_include_dir}/data_structures/concurrent) -FILE(COPY ${include_dir}/data_structures/map/rh_hashmultimap.hpp DESTINATION ${build_include_dir}/data_structures/map) -FILE(COPY ${include_dir}/data_structures/map/rh_common.hpp DESTINATION ${build_include_dir}/data_structures/map) - -FILE(COPY ${include_dir}/data_structures/bitset/dynamic_bitset.hpp DESTINATION ${build_include_dir}/data_structures/bitset) - -FILE(COPY ${include_dir}/threading/sync/lockable.hpp DESTINATION ${build_include_dir}/threading/sync) -FILE(COPY ${include_dir}/threading/sync/spinlock.hpp DESTINATION ${build_include_dir}/threading/sync) -FILE(COPY ${include_dir}/threading/sync/futex.hpp DESTINATION ${build_include_dir}/threading/sync) -FILE(COPY ${include_dir}/threading/sync/lock_timeout_error.hpp DESTINATION ${build_include_dir}/threading/sync) - -FILE(COPY ${include_dir}/memory/freelist.hpp DESTINATION ${build_include_dir}/memory) -FILE(COPY ${include_dir}/memory/lazy_gc.hpp DESTINATION ${build_include_dir}/memory) - -FILE(COPY ${include_dir}/mvcc/cre_exp.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/hints.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/id.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/mvcc_error.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/record.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/serialization_error.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/version.hpp DESTINATION ${build_include_dir}/mvcc) -FILE(COPY ${include_dir}/mvcc/version_list.hpp DESTINATION ${build_include_dir}/mvcc) - -FILE(COPY ${include_dir}/transactions/transaction.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/lock_store.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/snapshot.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/commit_log.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/engine.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/transaction_store.hpp DESTINATION ${build_include_dir}/transactions) -FILE(COPY ${include_dir}/transactions/transaction_read.hpp DESTINATION ${build_include_dir}/transactions) - -FILE(COPY ${include_dir}/storage/typed_value.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/typed_value_store.hpp DESTINATION ${build_include_dir}/storage) -FILE(COPY ${include_dir}/storage/typed_value_utils.hpp DESTINATION ${build_include_dir}/storage) - -FILE(COPY ${include_dir}/storage/garbage/delete_sensitive.hpp DESTINATION ${build_include_dir}/storage/garbage) -FILE(COPY ${include_dir}/storage/garbage/garbage.hpp DESTINATION ${build_include_dir}/storage/garbage) - -FILE(COPY ${include_dir}/utils/string_buffer.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/handle_write.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/sys.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/char_str.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/void.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/array_store.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/bswap.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/stacktrace/stacktrace.hpp DESTINATION ${build_include_dir}/utils/stacktrace) -FILE(COPY ${include_dir}/utils/stacktrace/log.hpp DESTINATION ${build_include_dir}/utils/stacktrace) -FILE(COPY ${include_dir}/utils/auto_scope.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/assert.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/reference_wrapper.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/underlying_cast.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/total_ordering.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/crtp.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/placeholder.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/likely.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/cpu_relax.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/counters/atomic_counter.hpp DESTINATION ${build_include_dir}/utils/counters) -FILE(COPY ${include_dir}/utils/counters/simple_counter.hpp DESTINATION ${build_include_dir}/utils/counters) -FILE(COPY ${include_dir}/utils/random/fast_binomial.hpp DESTINATION ${build_include_dir}/utils/random) -FILE(COPY ${include_dir}/utils/random/xorshift128plus.hpp DESTINATION ${build_include_dir}/utils/random) -FILE(COPY ${include_dir}/utils/datetime/timestamp.hpp DESTINATION ${build_include_dir}/utils/datetime) -FILE(COPY ${include_dir}/utils/datetime/datetime_error.hpp DESTINATION ${build_include_dir}/utils/datetime) -FILE(COPY ${include_dir}/utils/types/byte.hpp DESTINATION ${build_include_dir}/utils/types) -FILE(COPY ${include_dir}/utils/option_ptr.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/option.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/border.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/order.hpp DESTINATION ${build_include_dir}/utils) -FILE(COPY ${include_dir}/utils/numerics/saturate.hpp DESTINATION ${build_include_dir}/utils/numerics) -FILE(COPY ${include_dir}/utils/memory/stack_allocator.hpp DESTINATION ${build_include_dir}/utils/memory) -FILE(COPY ${include_dir}/utils/memory/block_allocator.hpp DESTINATION ${build_include_dir}/utils/memory) -FILE(COPY ${include_dir}/utils/exceptions/basic_exception.hpp DESTINATION ${build_include_dir}/utils/exceptions) -FILE(COPY ${include_dir}/utils/exceptions/out_of_memory.hpp DESTINATION ${build_include_dir}/utils/exceptions) - -FILE(COPY ${include_dir}/utils/iterator/iterator_base.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/virtual_iter.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/iterator.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/composable.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/count.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/accessor.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/combined.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/count.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/filter.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/flat_map.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/for_all.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/inspect.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/iterator_accessor.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/lambda_iterator.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/limited_map.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/map.hpp DESTINATION ${build_include_dir}/utils/iterator) -FILE(COPY ${include_dir}/utils/iterator/range_iterator.hpp DESTINATION ${build_include_dir}/utils/iterator) - -FILE(COPY ${include_dir}/communication/communication.hpp DESTINATION ${build_include_dir}/communication) -FILE(COPY ${include_dir}/communication/bolt/v1/config.hpp DESTINATION ${build_include_dir}/communication/bolt/v1) -FILE(COPY ${include_dir}/communication/bolt/v1/serialization/record_stream.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/serialization) -FILE(COPY ${include_dir}/communication/bolt/v1/serialization/bolt_serializer.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/serialization) -FILE(COPY ${include_dir}/communication/bolt/v1/transport/bolt_encoder.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/transport) -FILE(COPY ${include_dir}/communication/bolt/v1/transport/chunked_buffer.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/transport) -FILE(COPY ${include_dir}/communication/bolt/v1/transport/chunked_encoder.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/transport) -FILE(COPY ${include_dir}/communication/bolt/v1/transport/socket_stream.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/transport) -FILE(COPY ${include_dir}/communication/bolt/v1/transport/stream_error.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/transport) -FILE(COPY ${include_dir}/communication/bolt/v1/packing/codes.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/packing) -FILE(COPY ${include_dir}/communication/bolt/v1/messaging/codes.hpp DESTINATION ${build_include_dir}/communication/bolt/v1/messaging) - -FILE(COPY ${include_dir}/io/network/socket.hpp DESTINATION ${build_include_dir}/io/network) -FILE(COPY ${include_dir}/io/network/addrinfo.hpp DESTINATION ${build_include_dir}/io/network) -FILE(COPY ${include_dir}/io/network/network_error.hpp DESTINATION ${build_include_dir}/io/network) -FILE(COPY ${include_dir}/io/network/socket.hpp DESTINATION ${build_include_dir}/io/network) - -FILE(COPY ${include_dir}/logging/default.hpp DESTINATION ${build_include_dir}/logging) -FILE(COPY ${include_dir}/logging/log.hpp DESTINATION ${build_include_dir}/logging) -FILE(COPY ${include_dir}/logging/logger.hpp DESTINATION ${build_include_dir}/logging) -FILE(COPY ${include_dir}/logging/levels.hpp DESTINATION ${build_include_dir}/logging) -FILE(COPY ${include_dir}/logging/loggable.hpp DESTINATION ${build_include_dir}/logging) - -FILE(COPY ${include_dir}/snapshot/snapshot_engine.hpp DESTINATION ${build_include_dir}/snapshot) -# ----------------------------------------------------------------------------- diff --git a/cmake/gbenchmark.cmake b/cmake/gbenchmark.cmake deleted file mode 100644 index 4e268140e..000000000 --- a/cmake/gbenchmark.cmake +++ /dev/null @@ -1,18 +0,0 @@ -if (CMAKE_VERSION VERSION_LESS 3.2) - set(UPDATE_DISCONNECTED_IF_AVAILABLE "") -else() - set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1") -endif() - -include(DownloadProject/DownloadProject) - -download_project( - PROJ googlebenchmark - GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG master - ${UPDATE_DISCONNECTED_IF_AVAILABLE} -) - -add_subdirectory(${googlebenchmark_SOURCE_DIR} ${googlebenchmark_BINARY_DIR}) - -include_directories("${googlebenchmark_SOURCE_DIR}/include") diff --git a/cmake/gtest.cmake b/cmake/gtest.cmake deleted file mode 100644 index fd32785ae..000000000 --- a/cmake/gtest.cmake +++ /dev/null @@ -1,19 +0,0 @@ -if (CMAKE_VERSION VERSION_LESS 3.2) - set(UPDATE_DISCONNECTED_IF_AVAILABLE "") -else() - set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1") -endif() - -include(DownloadProject/DownloadProject) - -download_project( - PROJ googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG master - ${UPDATE_DISCONNECTED_IF_AVAILABLE} -) - -add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) - -include_directories("${googletest_SOURCE_DIR}/googletest/include") -include_directories("${googletest_SOURCE_DIR}/googlemock/include") diff --git a/cmake/setup.sh b/cmake/setup.sh deleted file mode 100755 index fd706978e..000000000 --- a/cmake/setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# DownloadProject -git clone https://github.com/Crascit/DownloadProject -download_project_tag="master" -cd DownloadProject -git checkout ${download_project_tag} -cd .. diff --git a/docker/crash_server.dockerfile b/docker/crash_server.dockerfile deleted file mode 100644 index ef92df88a..000000000 --- a/docker/crash_server.dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.5 - -COPY src/crash_analysis/server /server - -RUN pip install -r /server/requirements.txt - -WORKDIR /server - -CMD python app.py diff --git a/example/terminate_handler.cpp b/example/terminate_handler.cpp deleted file mode 100644 index 41703849f..000000000 --- a/example/terminate_handler.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -#include "utils/terminate_handler.hpp" - -int main() -{ - std::set_terminate(&terminate_handler); - - throw std::runtime_error("runtime error"); - - return 0; -} diff --git a/include/communication/gate/init.hpp b/include/communication/gate/init.hpp deleted file mode 100644 index 0ee82ec7f..000000000 --- a/include/communication/gate/init.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -/* Memgraph communication protocol - * gate is the first name proposal for the protocol */ - -// TODO diff --git a/include/communication/http/init.hpp b/include/communication/http/init.hpp deleted file mode 100644 index fe3005de7..000000000 --- a/include/communication/http/init.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -/* TODO: HTTP & HTTPS implementations */ diff --git a/include/io/network/event_loop.hpp b/include/io/network/event_loop.hpp deleted file mode 100644 index aa382d210..000000000 --- a/include/io/network/event_loop.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "io/network/socket.hpp" - -namespace io -{ - -class TcpConnection -{ - -}; - -class EventLoop -{ -public: - EventLoop() - { - - } - -private: - Even -}; - -} diff --git a/include/io/network/stream_dispatcher.hpp b/include/io/network/stream_dispatcher.hpp deleted file mode 100644 index 382514e94..000000000 --- a/include/io/network/stream_dispatcher.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - - -namespace io -{ - -class StreamDispatcher -{ - -}; - -} diff --git a/include/io/uv/blockbuffer.hpp b/include/io/uv/blockbuffer.hpp deleted file mode 100644 index 21e107bb4..000000000 --- a/include/io/uv/blockbuffer.hpp +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once - -#include -#include - -#include "utils/memory/block_allocator.hpp" - -namespace uv -{ - -template -class BlockBuffer -{ - static BlockAllocator allocator; - - struct Block : public uv_buf_t - { - Block() - { - // acquire a new block of memory for this buffer - base = static_cast(allocator.acquire()); - len = 0; - } - - ~Block() - { - // release the block of memory previously acquired - allocator.release(base); - } - - size_t append(const char* data, size_t size) - { - // compute the remaining capacity for this block - auto capacity = block_size - len; - - // if the capacity is smaller than the requested size, copy only - // up to the remaining capacity - if(size > capacity) - size = capacity; - - std::memcpy(base + len, data, size); - len += size; - - // return how much we've copied - return size; - } - }; - -public: - BlockBuffer() - { - // create the first buffer - buffers.emplace_back(); - } - - ~BlockBuffer() - { - buffers.clear(); - } - - BlockBuffer(BlockBuffer&) = delete; - BlockBuffer(BlockBuffer&&) = delete; - - size_t count() const - { - return buffers.size(); - } - - void clear() - { - // pop all buffers except for the first one since we need to allocate - // it again anyway so why not keep it in the first place - while(count() > 1) - buffers.pop_back(); - - // pretend we just allocated our first buffer and set it's length to 0 - buffers.back().len = 0; - } - - BlockBuffer& operator<<(const std::string& data) - { - append(data); - return *this; - } - - void append(const std::string& data) - { - append(data.c_str(), data.size()); - } - - void append(const char* data, size_t size) - { - while(true) - { - // try to copy as much data as possible - auto copied = buffers.back().append(data, size); - - // if we managed to copy everything, we're done - if(copied == size) - break; - - // move the pointer past the copied part - data += copied; - - // reduce the total size by the number of copied items - size -= copied; - - // since we ran out of space, construct a new buffer - buffers.emplace_back(); - } - } - - operator uv_buf_t*() - { - return buffers.data(); - } - -private: - std::vector buffers; -}; - -template -BlockAllocator BlockBuffer::allocator; - -} diff --git a/include/io/uv/core.hpp b/include/io/uv/core.hpp deleted file mode 100644 index 2bdac52e9..000000000 --- a/include/io/uv/core.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include - -namespace uv -{ - -using callback_t = void (*)(uv_handle_t *); - -} diff --git a/include/io/uv/tcpstream.hpp b/include/io/uv/tcpstream.hpp deleted file mode 100644 index 36c0f6fc3..000000000 --- a/include/io/uv/tcpstream.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include - -#include "core.hpp" -#include "uvloop.hpp" - -namespace uv -{ - -class TcpStream -{ -public: - TcpStream(UvLoop& loop); - - template - T* data(); - - template - void data(T* value); - - void close(callback_t callback); - - operator uv_handle_t*(); - operator uv_tcp_t*(); - operator uv_stream_t*(); - -private: - uv_tcp_t stream; -}; - -} diff --git a/include/io/uv/uv.hpp b/include/io/uv/uv.hpp deleted file mode 100644 index ea3941e4a..000000000 --- a/include/io/uv/uv.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "tcpstream.hpp" -#include "uvbuffer.hpp" -#include "uvloop.hpp" -#include "blockbuffer.hpp" - -#include "tcpstream.inl" -#include "uvbuffer.inl" diff --git a/include/io/uv/uv_error.hpp b/include/io/uv/uv_error.hpp deleted file mode 100644 index 5a9857da7..000000000 --- a/include/io/uv/uv_error.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include - -namespace uv -{ - -class UvError : public std::runtime_error -{ -public: - UvError(const std::string& message) - : std::runtime_error(message) {} -}; - -} diff --git a/include/io/uv/uvbuffer.hpp b/include/io/uv/uvbuffer.hpp deleted file mode 100644 index ceb599dec..000000000 --- a/include/io/uv/uvbuffer.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include -#include - -namespace uv -{ - -class UvBuffer -{ -public: - UvBuffer(); - UvBuffer(size_t capacity); - UvBuffer(const std::string& data); - - ~UvBuffer(); - - size_t size() const noexcept; - size_t length() const noexcept; - - void clear(); - - UvBuffer& append(const std::string& data); - UvBuffer& append(const char* data, size_t n); - - UvBuffer& operator<<(const std::string& data); - - operator uv_buf_t*(); - -private: - uv_buf_t buffer; - size_t capacity; -}; - -} diff --git a/include/io/uv/uvloop.hpp b/include/io/uv/uvloop.hpp deleted file mode 100644 index cec72b210..000000000 --- a/include/io/uv/uvloop.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include - -#include "uv_error.hpp" - -namespace uv -{ - -class UvLoop final -{ -public: - using sptr = std::shared_ptr; - - enum Mode { - Default = UV_RUN_DEFAULT, - Once = UV_RUN_ONCE, - NoWait = UV_RUN_NOWAIT - }; - - UvLoop() - { - uv_loop = uv_default_loop(); - - if(uv_loop == nullptr) - throw UvError("Failed to initialize libuv event loop"); - } - - ~UvLoop() - { - uv_loop_close(uv_loop); - } - - bool run(Mode mode) - { - return uv_run(uv_loop, static_cast(mode)); - } - - bool alive() - { - return uv_loop_alive(uv_loop); - } - - void stop() - { - uv_stop(uv_loop); - } - - operator uv_loop_t*() - { - return uv_loop; - } - -private: - uv_loop_t* uv_loop; -}; - -} diff --git a/include/query/backend/backend.hpp b/include/query/backend/backend.hpp deleted file mode 100644 index 1c3c735af..000000000 --- a/include/query/backend/backend.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "query/ir/tree/node.hpp" - -class Backend -{ -public: - virtual void process(ir::Node *node) = 0; - virtual ~Backend() {} -}; diff --git a/include/query/backend/code_generator.hpp b/include/query/backend/code_generator.hpp deleted file mode 100644 index b8a74f9ed..000000000 --- a/include/query/backend/code_generator.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -#include - -#include "query/backend/backend.hpp" - -class CodeGenerator : public Backend -{ -private: - struct Code - { - public: - void println(const std::string &line) - { - code.append(line + "\n"); - line_no++; - } - - void save(const std::string &) - { - throw std::runtime_error("TODO: implementation"); - } - - void reset() { code = ""; } - - std::string code; - uint64_t line_no; - }; - -protected: - Code code; - -public: - void emit(const std::string &line) { code.println(line); } - - void save(const std::string &path) { code.save(path); } - - void reset() { code.reset(); } -}; diff --git a/include/query/backend/cpp/code_generator.hpp b/include/query/backend/cpp/code_generator.hpp deleted file mode 100644 index b88bc31ec..000000000 --- a/include/query/backend/cpp/code_generator.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "query/backend/code_generator.hpp" - -/* - * Traverses the intermediate representation tree and generates - * C++ code. - */ -class CppCodeGenerator : public CodeGenerator -{ -public: - CppCodeGenerator() - { - throw std::runtime_error("TODO: implementation"); - } - - void process(ir::Node *) override - { - throw std::runtime_error("TODO: implementation"); - - } -}; diff --git a/include/query/backend/llvm/code_generator.hpp b/include/query/backend/llvm/code_generator.hpp deleted file mode 100644 index 3302e4e29..000000000 --- a/include/query/backend/llvm/code_generator.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -// TODO: implementation diff --git a/include/query/engine.hpp b/include/query/engine.hpp deleted file mode 100644 index cd707b5a4..000000000 --- a/include/query/engine.hpp +++ /dev/null @@ -1,222 +0,0 @@ -#pragma once - -#include -namespace fs = std::experimental::filesystem; - -#include "utils/exceptions/not_yet_implemented.hpp" -#include "config/config.hpp" - -#include "database/graph_db.hpp" -#include "logging/loggable.hpp" -#include "query/exception/query_engine.hpp" -#include "query/plan_compiler.hpp" -#include "query/plan_interface.hpp" -#include "query/preprocessor.hpp" -#include "utils/dynamic_lib.hpp" -#include "data_structures/concurrent/concurrent_map.hpp" - -// TODO: replace with openCypher and Antlr -#include "query/frontend/cypher.hpp" - -/** - * Responsible for query execution. - * - * Current Query Engine arhitecture: - * query -> query_stripper -> [plan_generator] -> [plan_compiler] -> execution - * - * @tparam Stream the query engine has to be aware of the Stream because Stream - * is passed to the dynamic shared library because that is the way how - * the results should be returned (more optimal then just return - * the whole result set) - */ -template -class QueryEngine : public Loggable -{ -private: - using QueryPlanLib = DynamicLib>; - -public: - QueryEngine() : Loggable("QueryEngine") {} - - /** - * Reloads query plan (plan_path contains compiled query plan). - * This methdo just calculates stripped query and offloads everything else - * to the LoadCpp method. - * - * @param query a query for which the plan will be loaded - * @param plan_path a custom made cpp query plan - * - * @return void - */ - auto ReloadCustom(const std::string &query, const fs::path &plan_path) - { - auto preprocessed = preprocessor.preprocess(query); - Unload(query); - LoadCpp(plan_path, preprocessed.hash); - } - - /** - * Executes query on the database with the stream. If a query plan is cached - * (based on query hash) it will be used. - * - * @param query a query that is going to be executed - * @param db database againt the query is going to be executed - * @param stream the resuts will be send to the stream - * - * @return query execution status: - * false if query wasn't executed successfully - * true if query execution was successfull - */ - auto Run(const std::string &query, GraphDbAccessor &db_accessor, Stream &stream) - { - try - { - auto preprocessed = preprocessor.preprocess(query); - auto plan = LoadCypher(preprocessed); - auto result = plan->run(db_accessor, preprocessed.arguments, stream); - if (UNLIKELY(!result)) - { - // info because it might be something like deadlock in which - // case one thread is stopped and user has try again - logger.info( - "Unable to execute query (execution returned false)"); - } - return result; - } - catch (CypherLexicalError &e) - { - logger.error("CypherLexicalError: {}", std::string(e.what())); - throw e; - } - catch (QueryEngineException &e) - { - logger.error("QueryEngineException: {}", std::string(e.what())); - throw e; - } - catch (std::exception &e) - { - throw BasicException(e.what()); - } - catch (...) - { - throw BasicException("unknown query engine exception"); - } - } - - /** - * Unloads query plan and release the resources (should be automatically). - * - * @param query a query for which the query plan will be unloaded. - * - * return bool is the plan unloaded - */ - auto Unload(const std::string &query) - { - return query_plans.access().remove(preprocessor.preprocess(query).hash); - } - - /** - * Checks is a plan for the query loaded. - * - * @param query for which a plan existance will be checked - * - * return bool - */ - auto Loaded(const std::string &query) - { - auto plans_accessor = query_plans.access(); - return plans_accessor.find(preprocessor.preprocess(query).hash) != - plans_accessor.end(); - } - - /** - * The number of loaded query plans. - * - * @return size_t the number of loaded query plans - */ - auto Size() { // TODO: const once whan ConcurrentMap::Accessor becomes const - return query_plans.access().size(); - } - // return query_plans.access().size(); } - -private: - /** - * Loads query plan eather from hardcoded folder or from the file that is - * generated in this method. - * - * @param stripped a stripped query - * - * @return runnable query plan - */ - auto LoadCypher(const StrippedQuery &stripped) - { - auto plans_accessor = query_plans.access(); - - // code is already compiled and loaded, just return runnable - // instance - auto query_plan_it = plans_accessor.find(stripped.hash); - if (query_plan_it != plans_accessor.end()) - return query_plan_it->second->instance(); - - // find hardcoded query plan if exists - auto hardcoded_path = - fs::path(CONFIG(config::COMPILE_PATH) + "hardcode/" + - std::to_string(stripped.hash) + ".cpp"); - if (fs::exists(hardcoded_path)) - return LoadCpp(hardcoded_path, stripped.hash); - - // generate query plan - auto generated_path = - fs::path(CONFIG(config::COMPILE_PATH) + std::to_string(stripped.hash) + ".cpp"); - // TODO implement CPP generator - // plan_generator.generate_plan(stripped.query, stripped.hash, generated_path); - throw NotYetImplemented(); - return LoadCpp(generated_path, stripped.hash); - } - - /** - * Load cpp query plan from a file. Or if plan is already cached from the - * cache. - * - * @param path_cpp a path to query plan - * @param hash query hash - * - * @return runnable query plan - */ - auto LoadCpp(const fs::path &path_cpp, const HashType hash) - { - auto plans_accessor = query_plans.access(); - - // code is already compiled and loaded, just return runnable - // instance - auto query_plan_it = plans_accessor.find(hash); - if (query_plan_it != plans_accessor.end()) - return query_plan_it->second->instance(); - - // generate dynamic lib path - // The timestamp has been added here because dlopen - // uses path and returns the same handler for the same path - // and that is a problem because at this point we want brand new - // dynamic lib. That is the tmp solution. The right solution would be - // to deal with this problem in DynamicLib - auto path_so = CONFIG(config::COMPILE_PATH) + std::to_string(hash) + - "_" + (std::string)Timestamp::now() + ".so"; - - plan_compiler.compile(path_cpp, path_so); - - auto query_plan = std::make_unique(path_so); - // TODO: underlying object has to be live during query execution - // fix that when Antler will be introduced into the database - - auto query_plan_instance = query_plan->instance(); // because of move - plans_accessor.insert(hash, std::move(query_plan)); - - // return an instance of runnable code (PlanInterface) - return query_plan_instance; - } - - QueryPreprocessor preprocessor; - PlanCompiler plan_compiler; - ConcurrentMap> - query_plans; -}; diff --git a/include/query/frontend/cypher.hpp b/include/query/frontend/cypher.hpp deleted file mode 100644 index 379371790..000000000 --- a/include/query/frontend/cypher.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include - -#include "logging/loggable.hpp" -#include "query/language/cypher/compiler.hpp" - -// DEPRICATED - -namespace cypher -{ - -class Frontend -{ -public: - Frontend() {} - - auto generate_ir(const std::string& query) - { - try { - return compiler.syntax_tree(query); - } catch (const BasicException &e) { - // logger.error("Parsing error while processing query: {}", query); - // logger.error(std::string(e.what())); - throw e; - } - } - -private: - cypher::Compiler compiler; -}; - -} diff --git a/include/query/frontend/cypher/traverser.hpp b/include/query/frontend/cypher/traverser.hpp deleted file mode 100644 index 8ca89f083..000000000 --- a/include/query/frontend/cypher/traverser.hpp +++ /dev/null @@ -1,611 +0,0 @@ -#pragma once - -#include - -#include "logging/default.hpp" -#include "query/backend/cpp_old/code.hpp" -#include "query/backend/cpp_old/cpp_generator.hpp" -#include "query/backend/cpp_old/entity_search.hpp" -#include "query/backend/cpp_old/structures.hpp" -#include "query/language/cypher/errors.hpp" -#include "query/language/cypher/visitor/traverser.hpp" - -struct SetElementState -{ - std::string set_entity; - std::string set_prop; - int64_t set_index; - - SetElementState() { clear(); } - - bool is_defined() const - { - if (set_entity.empty()) return false; - if (set_prop.empty()) return false; - if (set_index < 0) return false; - - return true; - } - - void clear() - { - set_entity = ""; - set_prop = ""; - set_index = -1; - } -}; - -struct PropertyState -{ - std::string property_name; - int64_t property_index; - - PropertyState() { clear(); } - - bool is_defined() const - { - if (property_name.empty()) return false; - if (property_index < 0) return false; - - return true; - } - - void clear() - { - property_name = ""; - property_index = -1; - } -}; - -// TODO: another idea is to user ast history in order to choose appropriate -// action - -class CppTraverser : public Traverser, public Code -{ -private: - // currently active entity name (node or relationship name) - std::string entity; - - // currently active state - CypherState state; // TODO: move to generator - QueryAction query_action; - ClauseAction clause_action; - - // linearization - CppGenerator generator; - - Vector visited_nodes; - - RelationshipData::Direction direction; - - SetElementState set_element_state; - LabelSetElement labels_set_element; - PropertyState property_state; - - void clear_state() - { - set_element_state.clear(); - property_state.clear(); - } - - // for the first release every query has to have a RETURN clause - // problem is where to put t.commit() - // TODO: remove this constraint - bool has_return; - - void finish_query_execution() - { - generator.add_action(QueryAction::TransactionCommit); - - code += generator.generate(); - - generator.clear(); - } - - Logger logger; - -public: - CppTraverser() : logger(logging::log->logger("CppTraverser")) {} - - void semantic_check() const - { - if (!has_return) - throw CypherSemanticError( - "The query doesn't have RETURN clause. Next " - "releases will support query without RETURN " - "clause"); - } - - void visit(ast::WriteQuery &write_query) override - { - // TODO: crate top level node (TransactionBegin can be - // only at the one place) - generator.add_action(QueryAction::TransactionBegin); - - Traverser::visit(write_query); - - // TODO: put this inside the top level mentioned above - finish_query_execution(); - } - - void visit(ast::ReadQuery &read_query) override - { - generator.add_action(QueryAction::TransactionBegin); - - Traverser::visit(read_query); - - finish_query_execution(); - } - - void visit(ast::UpdateQuery &update_query) override - { - generator.add_action(QueryAction::TransactionBegin); - - Traverser::visit(update_query); - - finish_query_execution(); - } - - void visit(ast::DeleteQuery &delete_query) override - { - generator.add_action(QueryAction::TransactionBegin); - - Traverser::visit(delete_query); - - finish_query_execution(); - } - - void visit(ast::ReadWriteQuery &read_write_query) override - { - generator.add_action(QueryAction::TransactionBegin); - - Traverser::visit(read_write_query); - - finish_query_execution(); - } - - void visit(ast::Match &ast_match) override - { - state = CypherState::Match; - - generator.add_action(QueryAction::Match); - - Traverser::visit(ast_match); - } - - void visit(ast::Where &ast_where) override - { - state = CypherState::Where; - - Traverser::visit(ast_where); - } - - void visit(ast::Create &ast_create) override - { - code += generator.generate(); - generator.add_action(QueryAction::Create); - - state = CypherState::Create; - query_action = QueryAction::Create; - - Traverser::visit(ast_create); - } - - void visit(ast::Set &ast_set) override - { - code += generator.generate(); - - generator.add_action(QueryAction::Set); - - state = CypherState::Set; - query_action = QueryAction::Set; - - Traverser::visit(ast_set); - - code += generator.generate(); - } - - void visit(ast::Return &ast_return) override - { - has_return = true; - - generator.add_action(QueryAction::Return); - - state = CypherState::Return; - query_action = QueryAction::Return; - - Traverser::visit(ast_return); - } - - void visit(ast::ReturnList &ast_return_list) override - { - Traverser::visit(ast_return_list); - } - - void visit(ast::PatternList &ast_pattern_list) override - { - Traverser::visit(ast_pattern_list); - } - - void visit(ast::Pattern &ast_pattern) override - { - // TODO: Is that traversal order OK for all cases? Probably NOT. - if (ast_pattern.has_next()) - { - visit(*ast_pattern.next); - visit(*ast_pattern.node); - visit(*ast_pattern.relationship); - } - else - { - Traverser::visit(ast_pattern); - } - } - - void visit(ast::Node &ast_node) override - { - auto &action_data = generator.action_data(); - auto &cypher_data = generator.cypher_data(); - - if (!ast_node.has_identifier()) return; - - auto name = ast_node.idn->name; - entity = name; - visited_nodes.push_back(name); - - if (state == CypherState::Match) - { - action_data.actions[name] = ClauseAction::MatchNode; - } - - if (state == CypherState::Create) - { - if (cypher_data.status(name) == EntityStatus::Matched) - { - action_data.actions[name] = ClauseAction::MatchNode; - } - else - { - action_data.actions[name] = ClauseAction::CreateNode; - } - } - - Traverser::visit(ast_node); - - if (cypher_data.status(name) != EntityStatus::Matched && - state == CypherState::Create) - { - cypher_data.node_created(name); - } - } - - void visit(ast::And &ast_and) override { Traverser::visit(ast_and); } - - void visit(ast::InternalIdExpr &internal_id_expr) override - { - if (!internal_id_expr.has_entity()) return; - if (!internal_id_expr.has_id()) return; - - auto name = internal_id_expr.entity_name(); - // because entity_id value will be index inside the parameters array - auto index = internal_id_expr.entity_id(); - - auto &data = generator.action_data(); - - data.parameter_index[ParameterIndexKey(InternalId, name)] = index; - data.csm.search_cost(name, entity_search::search_internal_id, - entity_search::internal_id_cost); - } - - // -- RELATIONSHIP -- - void create_relationship(const std::string &name) - { - auto &data = generator.action_data(); - data.actions[name] = ClauseAction::CreateRelationship; - auto nodes = visited_nodes.last_two(); - data.relationship_data.emplace(name, - RelationshipData(nodes, direction)); - } - - void visit(ast::Relationship &ast_relationship) override - { - auto &cypher_data = generator.cypher_data(); - auto &action_data = generator.action_data(); - - if (!ast_relationship.has_name()) return; - entity = ast_relationship.name(); - - using ast_direction = ast::Relationship::Direction; - using generator_direction = RelationshipData::Direction; - - if (ast_relationship.direction == ast_direction::Left) - direction = generator_direction::Left; - - if (ast_relationship.direction == ast_direction::Right) - direction = generator_direction::Right; - - // TODO: add suport for Direction::Both - - // TODO: simplify somehow - if (state == CypherState::Create) - { - if (!cypher_data.exist(entity)) - { - clause_action = ClauseAction::CreateRelationship; - create_relationship(entity); - } - } - - if (state == CypherState::Match) - { - if (!cypher_data.exist(entity)) - { - action_data.actions[entity] = ClauseAction::MatchRelationship; - } - } - - Traverser::visit(ast_relationship); - } - - void visit(ast::RelationshipSpecs &ast_relationship_specs) override - { - if (state == CypherState::Match) - { - if (ast_relationship_specs.has_identifier()) - { - auto name = ast_relationship_specs.name(); - auto &cypher_data = generator.cypher_data(); - if (!cypher_data.exist(name)) - { - clause_action = ClauseAction::MatchRelationship; - auto &data = generator.action_data(); - data.actions[name] = ClauseAction::MatchRelationship; - } - } - } - - if (state == CypherState::Create) - { - if (ast_relationship_specs.has_identifier()) - { - entity = ast_relationship_specs.name(); - } - } - - Traverser::visit(ast_relationship_specs); - } - - void visit(ast::RelationshipTypeList &ast_relationship_type_list) override - { - auto &action_data = generator.action_data(); - - if (ast_relationship_type_list.has_value()) - { - auto type = ast_relationship_type_list.value->name; - action_data.add_entity_tag(entity, type); - action_data.csm.search_cost(entity, - entity_search::search_type_index, - entity_search::type_cost); - } - - Traverser::visit(ast_relationship_type_list); - } - - void visit(ast::LabelList &ast_label_list) override - { - if (state == CypherState::Set) - { - clause_action = ClauseAction::UpdateEntityLabels_Labels; - Traverser::visit(ast_label_list); - return; - } - - auto &action_data = generator.action_data(); - auto &cypher_data = generator.cypher_data(); - - if (!ast_label_list.has_value()) return; - - auto label = ast_label_list.value->name; - - action_data.add_entity_tag(entity, label); - action_data.csm.search_cost(entity, entity_search::search_label_index, - entity_search::label_cost); - cypher_data.tag(entity, label); - // TODO: it shouldn't be decided here - cypher_data.source(entity, EntitySource::LabelIndex); - - Traverser::visit(ast_label_list); - } - - void visit(ast::PropertyList &ast_property_list) override - { - Traverser::visit(ast_property_list); - } - - void visit(ast::Property &ast_property) override - { - clear_state(); - - Traverser::visit(ast_property); - - // TODO: too ugly refactor somehow (clear_state part is awful) - if (entity.empty() || !property_state.is_defined()) - { - clear_state(); - return; - } - - auto prop = property_state.property_name; - auto index = property_state.property_index; - - // update action data - auto &action_data = generator.action_data(); - action_data.parameter_index.emplace(ParameterIndexKey(entity, prop), - index); - action_data.add_entitiy_property(entity, prop); - - // update cypher data - auto &cypher_data = generator.cypher_data(); - cypher_data.index(entity, prop, index); - - clear_state(); - } - - void visit(ast::Identifier &ast_identifier) override - { - property_state.property_name = ast_identifier.name; - - if (state == CypherState::Delete) - { - auto &action_data = generator.action_data(); - auto name = ast_identifier.name; - auto &cypher_data = generator.cypher_data(); - if (cypher_data.type(name) == EntityType::Node) - action_data.actions[name] = ClauseAction::DeleteNode; - if (cypher_data.type(name) == EntityType::Relationship) - action_data.actions[name] = ClauseAction::DeleteRelationship; - } - - if (state == CypherState::Set && - clause_action == ClauseAction::UpdateEntityLabels_Identifier) - { - labels_set_element.entity = ast_identifier.name; - } - - if (state == CypherState::Set && - clause_action == ClauseAction::UpdateEntityLabels_Labels) - { - labels_set_element.labels.emplace_back(ast_identifier.name); - } - } - - void visit(ast::Long &ast_long) override - { - set_element_state.set_index = ast_long.value; - property_state.property_index = ast_long.value; - } - - // -- SET subtree (node) - // QUERY: SET n.name = "bla", ... - // STRIP: SET n.name = 0, ... - // STATE: entity: n; prop: name; set_index: 0 - - void visit(ast::SetList &ast_set_list) override - { - Traverser::visit(ast_set_list); - } - - void visit(ast::SetElement &ast_set_element) override - { - Traverser::visit(ast_set_element); - - if (!set_element_state.is_defined()) - { - clear_state(); - return; - } - - auto entity = set_element_state.set_entity; - auto prop = set_element_state.set_prop; - auto index = set_element_state.set_index; - - auto &cypher_data = generator.cypher_data(); - auto entity_type = cypher_data.type(entity); - - if (entity_type == EntityType::None) - throw CypherSemanticError("Entity (" + entity + ") doesn't exist"); - - auto &action_data = generator.action_data(); - - if (entity_type == EntityType::Node) - action_data.actions[entity] = ClauseAction::UpdateNode; - if (entity_type == EntityType::Relationship) - action_data.actions[entity] = ClauseAction::UpdateRelationship; - - action_data.parameter_index.emplace(ParameterIndexKey(entity, prop), - index); - action_data.add_entitiy_property(entity, prop); - - clear_state(); - } - - void visit(ast::Accessor &ast_accessor) override - { - if (!ast_accessor.has_entity()) return; - - auto &action_data = generator.action_data(); - - if (state == CypherState::Return) - { - auto &return_elements = action_data.return_elements; - auto &entity = ast_accessor.entity_name(); - if (!ast_accessor.has_prop()) - { - return_elements.emplace_back(ReturnElement(entity)); - } - else - { - auto &property = ast_accessor.entity_prop(); - return_elements.emplace_back(ReturnElement(entity, property)); - } - } - - if (!ast_accessor.has_prop()) return; - - if (state == CypherState::Set) - { - set_element_state.set_entity = ast_accessor.entity_name(); - set_element_state.set_prop = ast_accessor.entity_prop(); - } - } - - void visit(ast::SetValue &ast_set_value) override - { - Traverser::visit(ast_set_value); - } - - void visit(ast::LabelSetElement &ast_label_set_element) override - { - clause_action = ClauseAction::UpdateEntityLabels_Identifier; - - labels_set_element.clear(); - - Traverser::visit(ast_label_set_element); - - auto &action_data = generator.action_data(); - - action_data.label_set_elements.emplace_back(std::move(labels_set_element)); - - clause_action = ClauseAction::Undefined; - } - - void visit(ast::Delete &ast_delete) override - { - code += generator.generate(); - - state = CypherState::Delete; - - auto &action_data = generator.add_action(QueryAction::Delete); - - Traverser::visit(ast_delete); - - code += generator.generate(); - } - - void visit(ast::CountFunction &ast_count) override - { - auto &action_data = generator.action_data(); - auto &cypher_data = generator.cypher_data(); - - // if (state == CypherState::Return) - // { - action_data.actions[ast_count.argument] = ClauseAction::ReturnCount; - // } - } - - void visit(ast::LabelsFunction &ast_label) override - { - auto &action_data = generator.action_data(); - action_data.actions[ast_label.argument] = ClauseAction::ReturnLabels; - } -}; diff --git a/include/query/frontend/opencypher.hpp b/include/query/frontend/opencypher.hpp deleted file mode 100644 index 8b38c3fa9..000000000 --- a/include/query/frontend/opencypher.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -namespace opencypher -{ - -class Fronted -{ -}; - -} diff --git a/include/query/frontend/opencypher/traverser.hpp b/include/query/frontend/opencypher/traverser.hpp deleted file mode 100644 index 3302e4e29..000000000 --- a/include/query/frontend/opencypher/traverser.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -// TODO: implementation diff --git a/include/query/language/cypher/.gitignore b/include/query/language/cypher/.gitignore deleted file mode 100644 index 3293fe729..000000000 --- a/include/query/language/cypher/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.o -cypher.cpp -cypher.h -cypher.hpp -parser -cypher.out -parser -sqlite.y diff --git a/include/query/language/cypher/ast/accessor.hpp b/include/query/language/cypher/ast/accessor.hpp deleted file mode 100644 index 2381e0c91..000000000 --- a/include/query/language/cypher/ast/accessor.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include - -#include "expr.hpp" -#include "identifier.hpp" - -namespace ast -{ - -struct Accessor : public ValueExpr -{ - Accessor(Identifier* entity, Identifier* prop) - : entity(entity), prop(prop) {} - - Identifier* entity; - Identifier* prop; - - bool has_entity() const { return entity != nullptr; } - bool has_prop() const { return prop != nullptr; } - - std::string &entity_name() const { return entity->name; } - std::string &entity_prop() const { return prop->name; } -}; - -} diff --git a/include/query/language/cypher/ast/alias.hpp b/include/query/language/cypher/ast/alias.hpp deleted file mode 100644 index f51d3eaef..000000000 --- a/include/query/language/cypher/ast/alias.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include - -#include "ast_node.hpp" - -namespace ast -{ - -// TODO: set identifier as base class -struct Alias : public AstNode -{ - Alias(std::string name, std::string alias) - : name(name), alias(alias) {} - - std::string name; - std::string alias; -}; - -} diff --git a/include/query/language/cypher/ast/ast.hpp b/include/query/language/cypher/ast/ast.hpp deleted file mode 100644 index 9bc1db7b4..000000000 --- a/include/query/language/cypher/ast/ast.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "accessor.hpp" -#include "values.hpp" -#include "identifier.hpp" -#include "alias.hpp" -#include "operators.hpp" -#include "property.hpp" -#include "relationship.hpp" -#include "node.hpp" -#include "distinct.hpp" -#include "return.hpp" -#include "pattern.hpp" -#include "return.hpp" -#include "delete.hpp" -#include "match.hpp" -#include "queries.hpp" -#include "start.hpp" -#include "set.hpp" -#include "expr.hpp" -#include "with.hpp" -#include "functions.hpp" -#include "merge.hpp" diff --git a/include/query/language/cypher/ast/ast_echo.hpp b/include/query/language/cypher/ast/ast_echo.hpp deleted file mode 100644 index 3e8e25edc..000000000 --- a/include/query/language/cypher/ast/ast_echo.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -#include "ast_visitor.hpp" -#include "values.hpp" - -namespace ast -{ - -class AstEcho : public AstVisitor -{ -public: - - virtual void visit(Boolean& node) - { - std::cout << "Boolean: " << node.value << std::endl; - } -}; - -} diff --git a/include/query/language/cypher/ast/ast_node.hpp b/include/query/language/cypher/ast/ast_node.hpp deleted file mode 100644 index ca33538ec..000000000 --- a/include/query/language/cypher/ast/ast_node.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include - -#include "utils/visitor/visitable.hpp" -#include "utils/crtp.hpp" -#include "ast_visitor.hpp" - -namespace ast -{ - -struct AstVisitor; - -struct AstVisitable : public Visitable -{ - using uptr = std::unique_ptr; -}; - -template -struct AstNode : public Crtp, public AstVisitable -{ - using uptr = std::unique_ptr; - - void accept(AstVisitor& visitor) override - { - visitor.visit(this->derived()); - } -}; - -} diff --git a/include/query/language/cypher/ast/ast_visitor.hpp b/include/query/language/cypher/ast/ast_visitor.hpp deleted file mode 100644 index 823a1f05a..000000000 --- a/include/query/language/cypher/ast/ast_visitor.hpp +++ /dev/null @@ -1,97 +0,0 @@ -#pragma once - -#include "utils/visitor/visitor.hpp" - -namespace ast -{ - -struct Identifier; -struct IdentifierList; -struct Alias; - -// properties -struct Property; -struct PropertyList; -struct Accessor; - -// values -struct Boolean; -struct Float; -struct Integer; -struct String; -struct Long; - -// operators -struct And; -struct Or; -struct Lt; -struct Gt; -struct Ge; -struct Le; -struct Eq; -struct Ne; -struct Plus; -struct Minus; -struct Star; -struct Slash; -struct Rem; - -// functions -struct CountFunction; -struct LabelsFunction; - -struct RelationshipSpecs; -struct RelationshipTypeList; -struct Relationship; - -struct Node; -struct LabelList; -struct Pattern; -struct PatternExpr; -struct PatternList; - -struct Return; -struct ReturnList; -struct Distinct; - -struct Create; -struct Merge; -struct Match; -struct Where; -struct Set; -struct Delete; - -struct Start; -struct WriteQuery; -struct ReadQuery; -struct UpdateQuery; -struct DeleteQuery; -struct ReadWriteQuery; -struct MergeQuery; - -struct SetKey; -struct SetValue; -struct SetElement; -struct LabelSetElement; -struct SetList; - -struct WithList; -struct WithClause; -struct WithQuery; - -struct InternalIdExpr; - -struct AstVisitor - : public Visitor< - Accessor, Boolean, Float, Identifier, Alias, Integer, String, - Property, And, Or, Lt, Gt, Ge, Le, Eq, Ne, Plus, Minus, Star, Slash, - Rem, PropertyList, RelationshipTypeList, Relationship, Node, - RelationshipSpecs, LabelList, ReturnList, Pattern, PatternExpr, - PatternList, Match, ReadQuery, Start, Where, WriteQuery, Create, - Return, Distinct, Delete, DeleteQuery, UpdateQuery, Set, SetKey, - ReadWriteQuery, IdentifierList, WithList, WithClause, WithQuery, Long, - CountFunction, LabelsFunction, InternalIdExpr, SetValue, SetElement, - MergeQuery, Merge, LabelSetElement, SetList> -{ -}; -} diff --git a/include/query/language/cypher/ast/create.hpp b/include/query/language/cypher/ast/create.hpp deleted file mode 100644 index 6b0c40fb3..000000000 --- a/include/query/language/cypher/ast/create.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "pattern.hpp" -#include "return.hpp" - -namespace ast -{ - -struct Create : public AstNode -{ - Create(Pattern* pattern) - : pattern(pattern) {} - - Pattern* pattern; -}; - -} diff --git a/include/query/language/cypher/ast/delete.hpp b/include/query/language/cypher/ast/delete.hpp deleted file mode 100644 index 1cbdbed05..000000000 --- a/include/query/language/cypher/ast/delete.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "identifier.hpp" - -namespace ast -{ - -struct Delete : public AstNode -{ - Delete(Identifier* identifier, bool is_detached = false) - : identifier(identifier), is_detached(is_detached) {} - - Identifier* identifier; - bool is_detached; -}; - -} diff --git a/include/query/language/cypher/ast/distinct.hpp b/include/query/language/cypher/ast/distinct.hpp deleted file mode 100644 index 61bc58fc2..000000000 --- a/include/query/language/cypher/ast/distinct.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "identifier.hpp" - -namespace ast -{ - -struct Distinct : public AstNode -{ - Distinct(Identifier* identifier) - : identifier(identifier) {} - - Identifier* identifier; -}; - -} diff --git a/include/query/language/cypher/ast/expr.hpp b/include/query/language/cypher/ast/expr.hpp deleted file mode 100644 index f85e902ca..000000000 --- a/include/query/language/cypher/ast/expr.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "ast_node.hpp" - -namespace ast -{ - -struct Expr : public AstVisitable -{ -}; - -template -struct ValueExpr : public Crtp, public Expr -{ - using uptr = std::unique_ptr; - - virtual void accept(AstVisitor &visitor) { visitor.visit(this->derived()); } -}; - -template -struct LeafExpr : public ValueExpr -{ - LeafExpr(T value) : value(value) {} - T value; -}; - -// T is argument type -template -struct FunctionExpr : public ValueExpr -{ - FunctionExpr(const std::string& name, T argument) : name(name), argument(argument) {} - - std::string name; - T argument; -}; - -template -struct BinaryExpr : public ValueExpr -{ - BinaryExpr(Expr *left, Expr *right) : left(left), right(right) {} - - Expr *left; - Expr *right; -}; - -struct PatternExpr : public Expr -{ - using uptr = std::unique_ptr; - - PatternExpr(Pattern *pattern) : pattern(pattern) {} - - virtual void accept(AstVisitor &visitor) { visitor.visit(*this); } - - Pattern *pattern; -}; - -} diff --git a/include/query/language/cypher/ast/functions.hpp b/include/query/language/cypher/ast/functions.hpp deleted file mode 100644 index c155e67a2..000000000 --- a/include/query/language/cypher/ast/functions.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "expr.hpp" - -namespace ast -{ - -struct CountFunction : public FunctionExpr -{ - CountFunction(const std::string &argument) : FunctionExpr("count", argument) - { - } -}; - -struct LabelsFunction : public FunctionExpr -{ - LabelsFunction(const std::string &argument) : FunctionExpr("labels", argument) - { - } -}; - -} diff --git a/include/query/language/cypher/ast/identifier.hpp b/include/query/language/cypher/ast/identifier.hpp deleted file mode 100644 index f9c7a6934..000000000 --- a/include/query/language/cypher/ast/identifier.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -#include "ast_node.hpp" -#include "list.hpp" - -namespace ast -{ - -struct Identifier : public AstNode -{ - Identifier(std::string name) - : name(name) {} - - std::string name; -}; - -struct IdentifierList : public List -{ - using List::List; -}; - -} diff --git a/include/query/language/cypher/ast/list.hpp b/include/query/language/cypher/ast/list.hpp deleted file mode 100644 index f4a8fa9fb..000000000 --- a/include/query/language/cypher/ast/list.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ast_node.hpp" - -namespace ast -{ - -template -struct List : public AstNode -{ - List(T* value, Derived* next) - : value(value), next(next) {} - - T* value; - Derived* next; - - bool has_value() const { return value != nullptr; } - bool has_next() const { return next != nullptr; } -}; - -} diff --git a/include/query/language/cypher/ast/match.hpp b/include/query/language/cypher/ast/match.hpp deleted file mode 100644 index e14bc0247..000000000 --- a/include/query/language/cypher/ast/match.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "pattern.hpp" -#include "where.hpp" - -namespace ast -{ - -struct Match : public AstNode -{ - Match(PatternList* pattern_list, Where* where) - : pattern_list(pattern_list), where(where) {} - - PatternList* pattern_list; - Where* where; -}; - -} diff --git a/include/query/language/cypher/ast/merge.hpp b/include/query/language/cypher/ast/merge.hpp deleted file mode 100644 index f6d7db518..000000000 --- a/include/query/language/cypher/ast/merge.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "pattern.hpp" -#include "return.hpp" - -namespace ast -{ - -struct Merge : public AstNode -{ - Merge(Pattern* pattern) - : pattern(pattern) {} - - Pattern* pattern; -}; - -} diff --git a/include/query/language/cypher/ast/node.hpp b/include/query/language/cypher/ast/node.hpp deleted file mode 100644 index 26c1e4d3d..000000000 --- a/include/query/language/cypher/ast/node.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "list.hpp" -#include "identifier.hpp" - -namespace ast -{ - -struct LabelList : public List -{ - using List::List; -}; - -struct Node : public AstNode -{ - Node(Identifier* idn, LabelList* labels, PropertyList* props) - : idn(idn), labels(labels), props(props) {} - - Identifier* idn; - LabelList* labels; - PropertyList* props; - - bool has_identifier() const - { - return idn != nullptr; - } -}; - -} diff --git a/include/query/language/cypher/ast/operators.hpp b/include/query/language/cypher/ast/operators.hpp deleted file mode 100644 index a3418ef2b..000000000 --- a/include/query/language/cypher/ast/operators.hpp +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include "expr.hpp" - -namespace ast -{ - -struct And : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Or : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Lt : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Gt : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Ge : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Le : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Eq : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Ne : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Plus : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Minus : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Star : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Slash : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -struct Rem : public BinaryExpr -{ - using BinaryExpr::BinaryExpr; -}; - -} diff --git a/include/query/language/cypher/ast/pattern.hpp b/include/query/language/cypher/ast/pattern.hpp deleted file mode 100644 index 0c7747ad1..000000000 --- a/include/query/language/cypher/ast/pattern.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "node.hpp" -#include "relationship.hpp" - -namespace ast -{ -struct Pattern : public AstNode -{ - Pattern(Node *node, Relationship *relationship, Pattern *next) - : node(node), relationship(relationship), next(next) - { - } - - Node *node; - Relationship *relationship; - Pattern *next; - - bool has_node() const { return node != nullptr; } - bool has_relationship() const { return relationship != nullptr; } - bool has_next() const { return next != nullptr; } -}; - -struct PatternList : public List -{ - using List::List; -}; -} diff --git a/include/query/language/cypher/ast/property.hpp b/include/query/language/cypher/ast/property.hpp deleted file mode 100644 index 34e1d9625..000000000 --- a/include/query/language/cypher/ast/property.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "list.hpp" -#include "identifier.hpp" -#include "expr.hpp" - -namespace ast -{ - -struct Property : public AstNode -{ - Property(Identifier* idn, Expr* value) - : idn(idn), value(value) {} - - Identifier* idn; - Expr* value; - - bool has_name() const { return idn != nullptr; } - bool has_value() const { return value != nullptr; } - - std::string name() const { return idn->name; } -}; - -struct PropertyList : public List -{ - using List::List; -}; - -} diff --git a/include/query/language/cypher/ast/queries.hpp b/include/query/language/cypher/ast/queries.hpp deleted file mode 100644 index 5ed262b23..000000000 --- a/include/query/language/cypher/ast/queries.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "create.hpp" -#include "delete.hpp" -#include "match.hpp" -#include "return.hpp" -#include "set.hpp" -#include "merge.hpp" - -namespace ast -{ - -struct WriteQuery : public AstNode -{ - WriteQuery(Create *create, Return *return_clause) - : create(create), return_clause(return_clause) - { - } - - Create *create; - Return *return_clause; -}; - -struct ReadQuery : public AstNode -{ - ReadQuery(Match *match, Return *return_clause) - : match(match), return_clause(return_clause) - { - } - - Match *match; - Return *return_clause; -}; - -struct UpdateQuery : public AstNode -{ - UpdateQuery(Match *match_clause, Set *set_clause, Return *return_clause) - : match_clause(match_clause), set_clause(set_clause), - return_clause(return_clause) - { - } - - Match *match_clause; - Set *set_clause; - Return *return_clause; -}; - -struct DeleteQuery : public AstNode -{ - DeleteQuery(Match *match, Delete *delete_clause) - : match(match), delete_clause(delete_clause) - { - } - - Match *match; - Delete *delete_clause; -}; - -struct ReadWriteQuery : public AstNode -{ - ReadWriteQuery(Match *match_clause, - Create *create_clause, Return *return_clause) - : match_clause(match_clause), - create_clause(create_clause), return_clause(return_clause) - { - } - - Match *match_clause; - Create *create_clause; - Return *return_clause; -}; - -struct MergeQuery : public AstNode -{ - MergeQuery(Merge* merge_clause, Set* set_clause, Return* return_clause) : - merge_clause(merge_clause), set_clause(set_clause), - return_clause(return_clause) - { - } - - Merge *merge_clause; - Set *set_clause; - Return *return_clause; -}; - -} diff --git a/include/query/language/cypher/ast/relationship.hpp b/include/query/language/cypher/ast/relationship.hpp deleted file mode 100644 index c80f8fe5b..000000000 --- a/include/query/language/cypher/ast/relationship.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include "identifier.hpp" -#include "list.hpp" - -namespace ast -{ - -struct RelationshipTypeList : public List -{ - using List::List; -}; - -struct RelationshipSpecs : public AstNode -{ - RelationshipSpecs(Identifier *idn, RelationshipTypeList *types, - PropertyList *props) - : idn(idn), types(types), props(props) - { - } - - Identifier *idn; - RelationshipTypeList *types; - PropertyList *props; - - bool has_identifier() const { return idn != nullptr; } - - std::string name() const { return idn->name; } -}; - -struct Relationship : public AstNode -{ - enum Direction - { - Left, - Right, - Both - }; - - Relationship(RelationshipSpecs *specs, Direction direction) - : specs(specs), direction(direction) - { - } - - RelationshipSpecs *specs; - Direction direction; - - bool has_relationship_specs() const { return specs != nullptr; } - bool has_name() const - { - return has_relationship_specs() && specs->has_identifier(); - } - - std::string name() const { return specs->name(); } -}; -} diff --git a/include/query/language/cypher/ast/return.hpp b/include/query/language/cypher/ast/return.hpp deleted file mode 100644 index 68d4c2e70..000000000 --- a/include/query/language/cypher/ast/return.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "list.hpp" -#include "expr.hpp" -#include "identifier.hpp" -#include "distinct.hpp" - -namespace ast -{ - -struct ReturnList : public List -{ - using List::List; -}; - -struct Return : public AstNode -{ - Return(ReturnList* return_list) - : return_list(return_list), distinct(nullptr) - { - } - - Return(Distinct* distinct) - : return_list(nullptr), distinct(distinct) - { - } - - ReturnList* return_list; - Distinct* distinct; -}; - -}; diff --git a/include/query/language/cypher/ast/set.hpp b/include/query/language/cypher/ast/set.hpp deleted file mode 100644 index 8ba49ad37..000000000 --- a/include/query/language/cypher/ast/set.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include "accessor.hpp" -#include "list.hpp" -#include "expr.hpp" - -namespace ast -{ -// -// SetList -// ^ -// | -// |------------------------------------| -// SetElement -// ^ -// | -// |-------------------| -// Accessor SetValue -// ^ ^ -// | | -// |-------| |-------| -// SET n.name = "Paul", n.surname = "Scholes" -// ^ ^ -// | | -// element entity element property -// - -struct SetValue : public AstNode -{ - SetValue(Expr* value) - : value(value) {} - - Expr* value; - - bool has_value() const { return value != nullptr; } -}; - -struct SetElementBase : public AstVisitable -{ -}; - -template -struct SetElementDerivedBase : public Crtp, public SetElementBase -{ - using uptr = std::unique_ptr; - - virtual void accept(AstVisitor &visitor) { visitor.visit(this->derived()); } -}; - -struct SetElement : public SetElementDerivedBase -{ - SetElement(Accessor* accessor, SetValue* set_value) - : accessor(accessor), set_value(set_value) {} - - Accessor* accessor; - SetValue* set_value; - - bool has_accessor() const { return accessor != nullptr; } - bool has_value() const { return set_value != nullptr; } -}; - -struct LabelSetElement : public SetElementDerivedBase -{ - LabelSetElement(Identifier* identifier, LabelList* label_list) - : identifier(identifier), label_list(label_list) {} - - Identifier* identifier; - LabelList* label_list; - - bool has_identifier() const { return identifier != nullptr; } - bool has_label_list() const { return label_list != nullptr; } -}; - -struct SetList : public List -{ - using List::List; -}; - -struct Set : public AstNode -{ - Set(SetList* set_list) - : set_list(set_list) {} - - SetList* set_list; -}; - -} diff --git a/include/query/language/cypher/ast/start.hpp b/include/query/language/cypher/ast/start.hpp deleted file mode 100644 index 779a5fc6e..000000000 --- a/include/query/language/cypher/ast/start.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "queries.hpp" - -namespace ast -{ - -struct Start : public AstNode -{ -}; - -}; diff --git a/include/query/language/cypher/ast/tree.hpp b/include/query/language/cypher/ast/tree.hpp deleted file mode 100644 index c19d53ad6..000000000 --- a/include/query/language/cypher/ast/tree.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include - -#include "ast_node.hpp" - -namespace ast -{ - -class Ast -{ -public: - Ast() = default; - Ast(const Ast&) = delete; - - Ast(Ast&& other) : root(other.root), items(std::move(other.items)) - { - other.root = nullptr; - } - - Ast& operator=(Ast&& other) - { - // TODO: write this more appropriate - // here is CP of above code - if(this != &other) { - this->root = other.root; - other.root = nullptr; - this->items = std::move(other.items); - } - return *this; - } - - AstVisitable* root; - - void traverse(AstVisitor& visitor) - { - root->accept(visitor); - } - - template - T* create(Args&&... args) - { - auto node = new T(std::forward(args)...); - items.push_back(std::unique_ptr(node)); - return node; - } - -private: - // basically a gc vector that destroys all ast nodes once this object is - // destroyed. parser generator is written in c and works only with raw - // pointers so this is what makes it leak free after the parser finishes - // parsing without using shared pointers - std::vector items; -}; - -} diff --git a/include/query/language/cypher/ast/values.hpp b/include/query/language/cypher/ast/values.hpp deleted file mode 100644 index 34fca12c1..000000000 --- a/include/query/language/cypher/ast/values.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include - -#include "expr.hpp" - -namespace ast -{ - -struct Float : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct Integer : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct Long : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct ULong : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct Boolean : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct String : public LeafExpr -{ - using LeafExpr::LeafExpr; -}; - -struct InternalIdExpr : public Expr -{ - InternalIdExpr(Identifier *entity, Long *id) - : entity(entity), id(id) - { - } - - Identifier *entity; - Long *id; - - virtual void accept(AstVisitor &visitor) { visitor.visit(*this); } - - bool has_entity() const { return entity != nullptr; } - bool has_id() const { return id != nullptr; } - - std::string entity_name() const { return entity->name; } - int64_t entity_id() const { return id->value; } - - -}; - -} diff --git a/include/query/language/cypher/ast/where.hpp b/include/query/language/cypher/ast/where.hpp deleted file mode 100644 index e55e053f2..000000000 --- a/include/query/language/cypher/ast/where.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "ast_node.hpp" -#include "expr.hpp" - -namespace ast -{ - -struct Where : public AstNode -{ - Where(Expr* expr) - : expr(expr) {} - - Expr* expr; -}; - -} diff --git a/include/query/language/cypher/ast/with.hpp b/include/query/language/cypher/ast/with.hpp deleted file mode 100644 index d44d2e53f..000000000 --- a/include/query/language/cypher/ast/with.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include - -#include "ast_node.hpp" -#include "identifier.hpp" -#include "match.hpp" - -namespace ast -{ - -struct WithClause : public AstNode -{ - WithClause(IdentifierList *identifier_list, Match *match_clause) - : identifier_list(identifier_list), match_clause(match_clause) - { - } - - IdentifierList *identifier_list; - Match *match_clause; -}; - -struct WithList : public List -{ - using List::List; -}; - -struct WithQuery : public AstNode -{ - WithQuery(Match *match_clause, WithList *with_list, Return *return_clause) - : match_clause(match_clause), with_list(with_list), - return_clause(return_clause) - { - } - - Match *match_clause; - WithList *with_list; - Return *return_clause; -}; - -} diff --git a/include/query/language/cypher/common.hpp b/include/query/language/cypher/common.hpp deleted file mode 100644 index f2701fed7..000000000 --- a/include/query/language/cypher/common.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -#include "utils/command_line/arguments.hpp" -#include "utils/string/file.hpp" - -auto extract_queries(const std::vector& arguments) -{ - std::vector queries; - - // load single query - if (contains_argument(arguments, "-q")) - { - queries.emplace_back(get_argument(arguments, "-q", "CREATE (n) RETURN n")); - return queries; - } - - // load multiple queries from file - auto default_file = "queries.cypher"; - auto file = get_argument(arguments, "-f", default_file); - return utils::read_lines(file.c_str()); -} - diff --git a/include/query/language/cypher/compiler.hpp b/include/query/language/cypher/compiler.hpp deleted file mode 100644 index 9c091357d..000000000 --- a/include/query/language/cypher/compiler.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "tokenizer/cypher_lexer.hpp" -#include "parser.hpp" - -namespace cypher -{ - -class Compiler -{ -public: - Compiler() = default; - - ast::Ast syntax_tree(const std::string& input) - { - auto parser = cypher::Parser(); - auto tokenizer = lexer.tokenize(input); - auto tree = parser.parse(tokenizer); - return tree; - } - -private: - CypherLexer lexer; -}; - -} diff --git a/include/query/language/cypher/cypher.y b/include/query/language/cypher/cypher.y deleted file mode 100644 index 28ed2d8d8..000000000 --- a/include/query/language/cypher/cypher.y +++ /dev/null @@ -1,589 +0,0 @@ -/* -** This file contains memgraph's grammar for Cypher. Process this file -** using the lemon parser generator to generate C code that runs -** the parser. Lemon will also generate a header file containing -** numeric codes for all of the tokens. -*/ - -%token_prefix TK_ - -%token_type {Token*} - -%extra_argument {ast::Ast* ast} - -%syntax_error -{ -#ifndef NDEBUG - int n = sizeof(yyTokenName) / sizeof(yyTokenName[0]); - for (int i = 0; i < n; ++i) { - int a = yy_find_shift_action(yypParser, (YYCODETYPE)i); - if (a < YYNSTATE + YYNRULE) { - printf("possible token: %s\n", yyTokenName[i]); - } - } - throw CypherSyntaxError(TOKEN->value); -#endif -} - -%stack_overflow -{ - throw CypherParsingError("Parser stack overflow"); -} - -%name cypher_parser - -%include -{ - #include - #include - #include - - #include "query/language/cypher/token.hpp" - #include "query/language/cypher/errors.hpp" - #include "query/language/cypher/ast/ast.hpp" - #include "query/language/cypher/ast/tree.hpp" - - #define DEBUG(X) std::cout << "PARSER: " << X << std::endl -} - -// define operator precedence -%left OR. -%left AND. -%right NOT. -%left IN IS_NULL IS_NOT_NULL NE EQ. -%left GT LE LT GE. -%left PLUS MINUS. -%left STAR SLASH REM. - -// -- start structure - -start ::= with_query(Q). { - ast->root = Q; -} - -start ::= write_query(Q). { - ast->root = Q; -} - -start ::= read_query(Q). { - ast->root = Q; -} - -start ::= update_query(Q). { - ast->root = Q; -} - -start ::= delete_query(Q). { - ast->root = Q; -} - -start ::= read_write_query(Q). { - ast->root = Q; -} - -start ::= merge_query(Q). { - ast->root = Q; -} - -// -- merge query - -%type merge_query {ast::MergeQuery*} - -merge_query(MQ) ::= merge_clause(MC) set_clause(SC) return_clause(RC). { - MQ = ast->create(MC, SC, RC); -} - -merge_query(MQ) ::= merge_clause(MC) return_clause(RC). { - MQ = ast->create(MC, nullptr, RC); -} - -// -- with query - -%type with_query {ast::WithQuery*} - -with_query(WQ) ::= with_start_clause(SQ) with_list(WL) return_clause(RC). { - WQ = ast->create(SQ, WL, RC); -} - -%type with_list {ast::WithList*} - -with_list(L) ::= WITH with_clause(WC) with_list(N). { - L = ast->create(WC, N); -} - -with_list(L) ::= . { - L = nullptr; -} - -// TODO: replace Match with something that has Match, Create, etc. -%type with_start_clause {ast::Match*} - -with_start_clause(WSC) ::= match_clause(MC). { - WSC = MC; -} - -%type with_clause {ast::WithClause*} - -with_clause(WC) ::= identifier_list(IL) with_match_clause(MC). { - WC = ast->create(IL, MC); -} - -%type with_match_clause {ast::Match*} - -with_match_clause(WMC) ::= match_clause(M). { - WMC = M; -} - -with_match_clause(WMC) ::= where_clause(WC). { - WMC = ast->create(nullptr, WC); -} - -// write query structure - -%type write_query {ast::WriteQuery*} - -write_query(WQ) ::= create_clause(C) return_clause(R). { - WQ = ast->create(C, R); -} - -write_query(WQ) ::= create_clause(C). { - WQ = ast->create(C, nullptr); -} - -// read query structure - -%type read_query {ast::ReadQuery*} - -read_query(RQ) ::= match_clause(M) return_clause(R). { - RQ = ast->create(M, R); -} - -// -- match create query - -%type read_write_query {ast::ReadWriteQuery*} - -read_write_query(Q) ::= match_clause(M) create_clause(C) return_clause(R). { - Q = ast->create(M, C, R); -} - -read_write_query(Q) ::= match_clause(M) create_clause(C). { - Q = ast->create(M, C, nullptr); -} - -// --------------------- - - -// update query structure - -%type update_query {ast::UpdateQuery*} - -update_query(UQ) ::= match_clause(M) set_clause(S) return_clause(R). { - UQ = ast->create(M, S, R); -} - -update_query(UQ) ::= match_clause(M) set_clause(S). { - UQ = ast->create(M, S, nullptr); -} - -// set clause - -%type set_clause {ast::Set*} - -set_clause(S) ::= SET set_list(L). { - S = ast->create(L); -} - -// delete query structure - -%type delete_query {ast::DeleteQuery*} - -delete_query(DQ) ::= match_clause(M) delete_clause(D). { - DQ = ast->create(M, D); -} - -%type create_clause {ast::Create*} - -create_clause(C) ::= CREATE pattern(P). { - C = ast->create(P); -} - -%type merge_clause {ast::Merge*} - -merge_clause(M) ::= MERGE pattern(P). { - M = ast->create(P); -} - -%type match_clause {ast::Match*} - -match_clause(M) ::= MATCH pattern_list(P) where_clause(W). { - M = ast->create(P, W); -} - -%type delete_clause {ast::Delete*} - -// TODO: expression list support - -delete_clause(D) ::= DELETE idn(I). { - D = ast->create(I, false); -} - -delete_clause(D) ::= DETACH DELETE idn(I). { - D = ast->create(I, true); -} - -// ---- pattern list - -%type pattern_list {ast::PatternList*} - -pattern_list(L) ::= pattern(P) COMMA pattern_list(N). { - L = ast->create(P, N); -} - -pattern_list(L) ::= pattern(P). { - L = ast->create(P, nullptr); -} - -// ---- - -%type pattern {ast::Pattern*} - -pattern(P) ::= node(N) rel(R) pattern(NEXT). { - P = ast->create(N, R, NEXT); -} - -pattern(P) ::= node(N). { - P = ast->create(N, nullptr, nullptr); -} - -// update query -// MATCH ... WITH ... SET ... RETURN - -%type rel {ast::Relationship*} - -rel(R) ::= MINUS rel_spec(S) MINUS. { // bidirectional - R = ast->create(S, ast::Relationship::Both); -} - -rel(R) ::= LT MINUS rel_spec(S) MINUS. { // left - R = ast->create(S, ast::Relationship::Left); -} - -rel(R) ::= MINUS rel_spec(S) MINUS GT. { // right - R = ast->create(S, ast::Relationship::Right); -} - -%type rel_spec {ast::RelationshipSpecs*} - -rel_spec(R) ::= LSP rel_idn(I) rel_type(T) properties(P) RSP. { - R = ast->create(I, T, P); -} - -rel_spec(R) ::= . { - R = nullptr; -} - -%type rel_idn {ast::Identifier*} - -rel_idn(R) ::= idn(I). { - R = I; -} - -rel_idn(R) ::= . { - R = nullptr; -} - -%type rel_type {ast::RelationshipTypeList*} - -rel_type(L) ::= COLON rel_list(R). { - L = R; -} - -rel_type(L) ::= . { - L = nullptr; -} - -%type rel_list {ast::RelationshipTypeList*} - -rel_list(L) ::= idn(I) PIPE rel_list(R). { - L = ast->create(I, R); -} - -rel_list(L) ::= idn(I). { - L = ast->create(I, nullptr); -} - -%type node {ast::Node*} - -// node specification -node(N) ::= LP node_idn(I) label_idn(L) properties(P) RP. { - N = ast->create(I, L, P); -} - -%type node_idn {ast::Identifier*} - -// a node identifier can be ommitted -node_idn(N) ::= idn(I). { - N = I; -} - -node_idn(N) ::= . { - N = nullptr; -} - -%type label_idn {ast::LabelList*} - -// a label can be ommited or there can be more of them -label_idn(L) ::= COLON idn(I) label_idn(N). { - L = ast->create(I, N); -} - -label_idn(L) ::= . { - L = nullptr; -} - -%type where_clause {ast::Where*} - -// where clause -where_clause(W) ::= WHERE expr(E). { - W = ast->create(E); -} - -where_clause(W) ::= . { - W = nullptr; -} - -%type return_clause {ast::Return*} - -return_clause(R) ::= RETURN return_list(L). { - R = ast->create(L); -} - -return_clause(R) ::= RETURN distinct(D). { - R = ast->create(D); -} - -%type return_list {ast::ReturnList*} - -return_list(R) ::= return_list(N) COMMA expr(E). { - R = ast->create(E, N); -} - -return_list(R) ::= expr(E). { - R = ast->create(E, nullptr); -} - -%type distinct {ast::Distinct*} - -distinct(R) ::= DISTINCT idn(I). { - R = ast->create(I); -} - -// list of properties -// e.g. { name: "wayne", surname: "rooney"} - -%type properties {ast::PropertyList*} - -// '{' '}' -properties(P) ::= LCP property_list(L) RCP. { - P = L; -} - -properties(P) ::= . { - P = nullptr; -} - -%type property_list {ast::PropertyList*} - -// [[',' ]]* -property_list(L) ::= property(P) COMMA property_list(N). { - L = ast->create(P, N); -} - -property_list(L) ::= property(P). { - L = ast->create(P, nullptr); -} - -%type property {ast::Property*} - -// IDENTIFIER ':' -property(P) ::= idn(I) COLON value_expr(E). { - P = ast->create(I, E); -} - -%type value_expr {ast::Expr*} - -value_expr(E) ::= value_expr(L) AND value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) OR value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) LT value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) GT value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) GE value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) LE value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) EQ value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) NE value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) PLUS value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) MINUS value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) STAR value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) SLASH value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= value_expr(L) REM value_expr(R). { - E = ast->create(L, R); -} - -value_expr(E) ::= idn(I). { - E = ast->create(I, nullptr); -} - -value_expr(E) ::= idn(I) DOT idn(P). { - E = ast->create(I, P); -} - -value_expr(E) ::= ID LP idn(I) RP EQ LONG(V). { - auto value = std::stol(V->value); - E = ast->create(I, ast->create(value)); -} - -%type idn {ast::Identifier*} - -idn(I) ::= IDN(X). { - I = ast->create(X->value); -} - -// ---- identifier list - -%type identifier_list {ast::IdentifierList*} - -identifier_list(L) ::= idn(I) COMMA identifier_list(N). { - L = ast->create(I, N); -} - -identifier_list(L) ::= idn(I). { - L = ast->create(I, nullptr); -} - -// ---- - -value_expr(E) ::= LONG(V). { - auto value = std::stol(V->value); - E = ast->create(value); -} - -value_expr(E) ::= FLOAT(V). { - auto value = std::stod(V->value); - E = ast->create(value); -} - -value_expr(E) ::= STR(V). { - auto value = V->value.substr(1, V->value.size() - 2); - E = ast->create(value); -} - -value_expr(E) ::= BOOL(V). { - auto value = V->value[0] == 't' || V->value[0] == 'T' ? true : false; - E = ast->create(value); -} - -%type pattern_expr {ast::Expr*} - -pattern_expr(E) ::= pattern(P). { - E = ast->create(P); -} - -%type function_expr {ast::Expr*} - -function_expr(E) ::= COUNT LP IDN(A) RP. { - E = ast->create(A->value); -} - -function_expr(E) ::= LABELS LP IDN(A) RP. { - E = ast->create(A->value); -} - -%type expr {ast::Expr*} - -expr(E) ::= value_expr(V). { - E = V; -} - -expr(E) ::= pattern_expr(P). { - E = P; -} - -expr(E) ::= function_expr(F). { - E = F; -} - -//%type alias {ast::Alias*} -// -//alias(A) ::= IDN(X) AS IDN(Y). { -// A = ast->create(X->value, Y->value); -//} - -// set list -// e.g. MATCH (n) SET n.name = "Ryan", n.surname = "Giggs" RETURN n - -%type set_list {ast::SetList*} - -set_list(L) ::= set_element(E) COMMA set_list(N). { - L = ast->create(E, N); -} - -set_list(L) ::= set_element(E). { - L = ast->create(E, nullptr); -} - -%type set_element {ast::SetElementBase*} - -set_element(E) ::= accessor(A) EQ set_value(V). { - E = ast->create(A, V); -} - -set_element(E) ::= idn(I) label_idn(L). { - E = ast->create(I, L); -} - -%type accessor {ast::Accessor*} - -accessor(A) ::= idn(E) DOT idn(P). { - A = ast->create(E, P); -} - -%type set_value {ast::SetValue*} - -set_value(V) ::= value_expr(E). { - V = ast->create(E); -} diff --git a/include/query/language/cypher/debug/tree_print.hpp b/include/query/language/cypher/debug/tree_print.hpp deleted file mode 100644 index b46742abb..000000000 --- a/include/query/language/cypher/debug/tree_print.hpp +++ /dev/null @@ -1,443 +0,0 @@ -#pragma once - -#include -#include - -#include "query/language/cypher/visitor/traverser.hpp" - -class PrintVisitor : public Traverser -{ -public: - class Printer - { - public: - friend class Entry; - - Printer(std::ostream &stream, const std::string &header) - : stream(stream) - { - // stream << header; - } - - ~Printer() { stream << std::endl; } - - class Entry - { - public: - explicit Entry(Printer &printer) : printer(printer), valid(true) - { - printer.level++; - - for (size_t i = 1; i < printer.level; ++i) - printer.stream << "| "; - - printer.stream << "+--"; - } - - Entry(const Entry &) = delete; - - Entry(Entry &&other) : printer(other.printer), valid(true) - { - other.valid = false; - } - - ~Entry() - { - if (valid) printer.level--; - } - - template - Entry &operator<<(const T &item) - { - printer.stream << item; - return *this; - } - - private: - Printer &printer; - bool valid; - }; - - Entry advance() - { - stream << std::endl; - return std::move(Entry(*this)); - } - - Entry advance(const std::string &text) - { - stream << std::endl; - auto entry = Entry(*this); - entry << text; - return std::move(entry); - } - - private: - std::ostream &stream; - size_t level = 0; - }; - - explicit PrintVisitor(std::ostream &stream) - : printer(stream, "Printing AST") {} - - void visit(ast::Start &start) override - { - auto entry = printer.advance("Start"); - Traverser::visit(start); - } - - void visit(ast::ReadQuery &read_query) override - { - auto entry = printer.advance("Read Query"); - Traverser::visit(read_query); - } - - void visit(ast::ReadWriteQuery &query) override - { - auto entry = printer.advance("Read Write Query"); - Traverser::visit(query); - } - - void visit(ast::Match &match) override - { - auto entry = printer.advance("Match"); - Traverser::visit(match); - } - - void visit(ast::Pattern &pattern) override - { - auto entry = printer.advance("Pattern"); - Traverser::visit(pattern); - } - - void visit(ast::PatternExpr &pattern_expr) override - { - auto entry = printer.advance("Pattern Expression"); - Traverser::visit(pattern_expr); - } - - void visit(ast::PatternList &pattern_list) override - { - auto entry = printer.advance("Pattern List"); - Traverser::visit(pattern_list); - } - - void visit(ast::Node &node) override - { - auto entry = printer.advance("Node"); - Traverser::visit(node); - } - - void visit(ast::Alias &alias) override - { - auto entry = printer.advance(); - entry << "Alias: '" << alias.name << "' AS '" << alias.alias << "'"; - } - - void visit(ast::Identifier &idn) override - { - auto entry = printer.advance(); - entry << "Identifier '" << idn.name << "'"; - } - - void visit(ast::IdentifierList &list) override - { - auto entry = printer.advance("Identifier List"); - Traverser::visit(list); - } - - void visit(ast::Return &return_clause) override - { - auto entry = printer.advance("Return"); - Traverser::visit(return_clause); - } - - void visit(ast::Distinct &distinct) override - { - auto entry = printer.advance("Distinct"); - Traverser::visit(distinct); - } - - void visit(ast::Accessor &accessor) override - { - auto entry = printer.advance("Accessor"); - Traverser::visit(accessor); - } - - void visit(ast::Boolean &boolean) override - { - auto entry = printer.advance(); - entry << "Boolean " << boolean.value; - } - - void visit(ast::Float &floating) override - { - auto entry = printer.advance(); - entry << "Float " << floating.value; - } - - void visit(ast::Integer &integer) override - { - auto entry = printer.advance(); - entry << "Integer " << integer.value; - } - - void visit(ast::Long &ast_long) override - { - auto entry = printer.advance(); - entry << "Long " << ast_long.value; - } - - // void visit(ast::ULong& ulong) override - // { - // auto entry = printer.advance(); - // entry << "ULong " << ulong.value; - // } - - void visit(ast::String &string) override - { - auto entry = printer.advance(); - entry << "String " << string.value; - } - - void visit(ast::InternalIdExpr &internal_id) override - { - auto entry = printer.advance("InternalId"); - Traverser::visit(internal_id); - } - - void visit(ast::Property &property) override - { - auto entry = printer.advance("Property"); - Traverser::visit(property); - } - - void visit(ast::And &and_expr) override - { - auto entry = printer.advance("And"); - Traverser::visit(and_expr); - } - - void visit(ast::Or &or_expr) override - { - auto entry = printer.advance("Or"); - Traverser::visit(or_expr); - } - - void visit(ast::Lt <_expr) override - { - auto entry = printer.advance("Less Than"); - Traverser::visit(lt_expr); - } - - void visit(ast::Gt >_expr) override - { - auto entry = printer.advance("Greater Than"); - Traverser::visit(gt_expr); - } - - void visit(ast::Ge &ge_expr) override - { - auto entry = printer.advance("Greater od Equal"); - Traverser::visit(ge_expr); - } - - void visit(ast::Le &le_expr) override - { - auto entry = printer.advance("Less or Equal"); - Traverser::visit(le_expr); - } - - void visit(ast::Eq &eq_expr) override - { - auto entry = printer.advance("Equal"); - Traverser::visit(eq_expr); - } - - void visit(ast::Ne &ne_expr) override - { - auto entry = printer.advance("Not Equal"); - Traverser::visit(ne_expr); - } - - void visit(ast::Plus &plus) override - { - auto entry = printer.advance("Plus"); - Traverser::visit(plus); - } - - void visit(ast::Minus &minus) override - { - auto entry = printer.advance("Minus"); - Traverser::visit(minus); - } - - void visit(ast::Star &star) override - { - auto entry = printer.advance("Star"); - Traverser::visit(star); - } - - void visit(ast::Slash &slash) override - { - auto entry = printer.advance("Slash"); - Traverser::visit(slash); - } - - void visit(ast::Rem &rem) override - { - auto entry = printer.advance("Rem (%)"); - Traverser::visit(rem); - } - - void visit(ast::CountFunction &count) override - { - auto entry = printer.advance("Count "); - entry << count.name << "(" << count.argument << ")"; - } - - void visit(ast::LabelsFunction &labels) override - { - auto entry = printer.advance("Labels "); - entry << labels.name << "(" << labels.argument << ")"; - } - - void visit(ast::PropertyList &prop_list) override - { - auto entry = printer.advance("Property List"); - Traverser::visit(prop_list); - } - - void visit(ast::RelationshipTypeList &rel_list) override - { - auto entry = printer.advance("Relationship Type List"); - Traverser::visit(rel_list); - } - - void visit(ast::Relationship &rel) override - { - auto entry = printer.advance("Relationship"); - entry << " direction: " << rel.direction; - Traverser::visit(rel); - } - - void visit(ast::RelationshipSpecs &rel_specs) override - { - auto entry = printer.advance("Relationship Specs"); - Traverser::visit(rel_specs); - } - - void visit(ast::LabelList &labels) override - { - auto entry = printer.advance("Label List"); - Traverser::visit(labels); - } - - void visit(ast::ReturnList &return_list) override - { - auto entry = printer.advance("Return List"); - Traverser::visit(return_list); - } - - void visit(ast::Where &where) override - { - auto entry = printer.advance("Where"); - Traverser::visit(where); - } - - void visit(ast::WriteQuery &write_query) override - { - auto entry = printer.advance("Write Query"); - Traverser::visit(write_query); - } - - void visit(ast::MergeQuery &merge_query) override - { - auto entry = printer.advance("Merge Query"); - Traverser::visit(merge_query); - } - - void visit(ast::DeleteQuery &delete_query) override - { - auto entry = printer.advance("Delete Query"); - Traverser::visit(delete_query); - } - - void visit(ast::Delete &delete_clause) override - { - auto is_detached = delete_clause.is_detached ? "yes" : "no"; - auto text_entry = - std::string("Delete - DETACH: ") + std::string(is_detached); - auto entry = printer.advance(text_entry); - Traverser::visit(delete_clause); - } - - void visit(ast::Create &create) override - { - auto entry = printer.advance("Create"); - Traverser::visit(create); - } - - void visit(ast::Merge &merge) override - { - auto entry = printer.advance("Merge"); - Traverser::visit(merge); - } - - void visit(ast::UpdateQuery &update_query) override - { - auto entry = printer.advance("Update Query"); - Traverser::visit(update_query); - } - - void visit(ast::Set &set_clause) override - { - auto entry = printer.advance("Set"); - Traverser::visit(set_clause); - } - - void visit(ast::SetValue &set_value) override - { - auto entry = printer.advance("Set Value"); - Traverser::visit(set_value); - } - - void visit(ast::SetElement &set_element) override - { - auto entry = printer.advance("Set Element"); - Traverser::visit(set_element); - } - - void visit(ast::LabelSetElement &label_set_element) override - { - auto entry = printer.advance("Label Set Element"); - Traverser::visit(label_set_element); - } - - void visit(ast::SetList &set_list) override - { - auto entry = printer.advance("Set List"); - Traverser::visit(set_list); - } - - void visit(ast::WithClause &with_clause) override - { - auto entry = printer.advance("With Clause"); - Traverser::visit(with_clause); - } - - void visit(ast::WithList &with_list) override - { - auto entry = printer.advance("With List"); - Traverser::visit(with_list); - } - - void visit(ast::WithQuery &with_query) override - { - auto entry = printer.advance("With Query"); - Traverser::visit(with_query); - } - -private: - Printer printer; -}; diff --git a/include/query/language/cypher/errors.hpp b/include/query/language/cypher/errors.hpp deleted file mode 100644 index e43b1381f..000000000 --- a/include/query/language/cypher/errors.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include - -#include "token.hpp" -#include "utils/exceptions/basic_exception.hpp" - -class CypherParsingError : public BasicException -{ -public: - CypherParsingError(const std::string &what) - : BasicException("Cypher Parsing Error: " + what) - { - } -}; - -class CypherLexicalError : public BasicException -{ -public: - CypherLexicalError(const Token &token) - : BasicException("Cypher Lexical Error: unrecognized token '" + - token.value + "'.") - { - } -}; - -class CypherSyntaxError : public BasicException -{ -public: - CypherSyntaxError(const std::string &near) - : BasicException("Cypher Syntax Error: near '" + near + "'.") - { - } -}; - -class CypherSemanticError : public BasicException -{ -public: - CypherSemanticError(const std::string &what) - : BasicException("Cypher Semanic Error: " + what) - { - } -}; diff --git a/include/query/language/cypher/lexer.cpp b/include/query/language/cypher/lexer.cpp deleted file mode 100644 index 2bda65a18..000000000 --- a/include/query/language/cypher/lexer.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include - -#include "cypher_lexer.hpp" - -int main() -{ - CypherLexer lexer; - - auto tokenizer = lexer.tokenize("{name: 'Dominik', lastName: 'Tomicevic', age: 24 }"); - - while(true) - { - auto token = tokenizer.lookup(); - - if(token.id == 0) - break; - - std::cout << token.id << " -> " << token.value << std::endl; - } - - - lexertl::rules rules; - lexertl::state_machine sm; - - rules.push("\\s+", sm.skip()); - rules.push("MATCH", 1); - rules.push("RETURN", 2); - - rules.push("'(.*?)'", 4); // string literal TODO single quote escape - rules.push("\\\"(.*?)\\\"", 4); // string literal TODO double quote escape - rules.push("[-+]?(\\d*[.])?\\d+", 5); // number - - rules.push("[_a-zA-Z][_a-zA-Z0-9]{0,30}", 3); // identifier - - lexertl::generator::build(rules, sm); - - std::string input("MATCH (user:User { name: 'Dominik', age: 24})-[has:HAS]->(item:Item) WHERE item.name = 'XPS 13', AND item.price = 14.99 RETURN user, has, item"); - lexertl::smatch results(input.begin(), input.end()); - - // Read ahead - lexertl::lookup(sm, results); - - while (results.id != 0) - { - std::cout << "Id: " << results.id << ", Token: '" << - results.str () << "'\n"; - lexertl::lookup(sm, results); - } - - std::cout << "-1 to uint64_t = " << uint64_t(-1) << std::endl; - - return 0; -} - diff --git a/include/query/language/cypher/parser.cpp b/include/query/language/cypher/parser.cpp deleted file mode 100644 index cfdbb5d50..000000000 --- a/include/query/language/cypher/parser.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include - -#include "compiler.hpp" -#include "debug/tree_print.hpp" -#include "utils/command_line/arguments.hpp" -#include "cypher/common.hpp" -#include "utils/terminate_handler.hpp" - -using std::cout; -using std::endl; - -// * INPUT ARGUMENTS * -// -q -> query -// -v -> visitor -// -f -> file -// -int main(int argc, char *argv[]) -{ - std::set_terminate(&terminate_handler); - - // arguments parsing - auto arguments = all_arguments(argc, argv); - - // query extraction - auto cypher_query = extract_query(arguments); - cout << "QUERY: " << cypher_query << endl; - - // traversers - auto traverser = get_argument(arguments, "-t", "code"); - auto print_traverser = Traverser::sptr(new PrintVisitor(cout)); - std::map traversers = { - {"print", print_traverser} - }; - - cypher::Compiler compiler; - auto tree = compiler.syntax_tree(cypher_query); - - auto t = traversers[traverser]; - tree.root->accept(*t); - - return 0; -} - diff --git a/include/query/language/cypher/parser.hpp b/include/query/language/cypher/parser.hpp deleted file mode 100644 index 71f322730..000000000 --- a/include/query/language/cypher/parser.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include "cypher/cypher.h" -#include "token.hpp" -#include "ast/tree.hpp" -#include "tokenizer/cypher_lexer.hpp" -#include "logging/default.hpp" - -void* cypher_parserAlloc(void* (*allocProc)(size_t)); -void cypher_parser(void*, int, Token*, ast::Ast* ast); -void cypher_parserFree(void*, void(*freeProc)(void*)); - -namespace cypher -{ - -class Parser -{ -public: - Parser() : logger(logging::log->logger("LexicalParser")) - { - parser = cypher_parserAlloc(malloc); - } - - ~Parser() - { - cypher_parserFree(parser, free); - } - - ast::Ast parse(Lexer::Tokenizer tokenizer) - { - auto tree = ast::Ast(); - std::list tokens; - - do - { - tokens.emplace_back(tokenizer.lookup()); - auto& token = tokens.back(); - // TODO: resolve fmt error with { - // logger.debug(token.repr()); - cypher_parser(parser, token.id, &token, &tree); - - } while(tokens.back().id != 0); - - return tree; - } - -protected: - Logger logger; - -private: - void* parser; -}; - -} diff --git a/include/query/language/cypher/token.hpp b/include/query/language/cypher/token.hpp deleted file mode 100644 index fb21e6d06..000000000 --- a/include/query/language/cypher/token.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -struct Token -{ - unsigned long id; - std::string value; - - /* - * Token is "True" if it's id is bigger than zero. Because - * lexer ids are all bigger than zero. - * - * This object could be used in while loop as a conditional element. - * E.g.: - * while (auto token = ...) - * { - * } - */ - explicit operator bool() const - { - return id > 0; - } - - /* - * String representation. - */ - std::string repr() const - { - // TODO: wrap fmt format - // return fmt::format("TOKEN id = {}, value = {}", id, value); - return ""; - } - - /* - * Ostream operator - * - * Prints token id and value in single line. - */ - friend std::ostream& operator<<(std::ostream& stream, const Token& token) - { - return stream << token.repr(); - } -}; diff --git a/include/query/language/cypher/tokenizer/cypher_lexer.hpp b/include/query/language/cypher/tokenizer/cypher_lexer.hpp deleted file mode 100644 index 619767992..000000000 --- a/include/query/language/cypher/tokenizer/cypher_lexer.hpp +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#include "cypher/cypher.h" -#include "lexer.hpp" - -class CypherLexer : public Lexer -{ -public: - CypherLexer() - { - // whitespace - rule("\\s+", sm->skip()); - - // special characters - rule("\\.", TK_DOT); - rule(",", TK_COMMA); - rule(":", TK_COLON); - rule("\\|", TK_PIPE); - rule("\\{", TK_LCP); - rule("\\}", TK_RCP); - rule("\\(", TK_LP); - rule("\\)", TK_RP); - rule("\\[", TK_LSP); - rule("\\]", TK_RSP); - - // operators - rule("\\+", TK_PLUS); - rule("-", TK_MINUS); - rule("\\*", TK_STAR); - rule("\\/", TK_SLASH); - rule("%", TK_REM); - - rule(">", TK_GT); - rule("<", TK_LT); - rule(">=", TK_GE); - rule("<=", TK_LE); - rule("=", TK_EQ); - rule("<>", TK_NE); - - // constants - rule("(?i:TRUE)", TK_BOOL); - rule("(?i:FALSE)", TK_BOOL); - - // keywords - rule("(?i:CREATE)", TK_CREATE); - rule("(?i:MERGE)", TK_MERGE); - rule("(?i:MATCH)", TK_MATCH); - rule("(?i:WHERE)", TK_WHERE); - rule("(?i:SET)", TK_SET); - rule("(?i:RETURN)", TK_RETURN); - rule("(?i:DISTINCT)", TK_DISTINCT); - rule("(?i:DETACH)", TK_DETACH); - rule("(?i:DELETE)", TK_DELETE); - rule("(?i:WITH)", TK_WITH); - // TODO: here should be better regex - // problem is that id in property list isn't ID from where - // part - rule("(?-i:ID)", TK_ID); - - rule("(?i:AND)", TK_AND); - rule("(?i:OR)", TK_OR); - - // functions - rule("(?i:COUNT)", TK_COUNT); - rule("(?i:LABELS)", TK_LABELS); - - // string literal TODO single quote escape - rule("'(.*?)'", TK_STR); - - // string literal TODO double quote escape - rule("\\\"(.*?)\\\"", TK_STR); - // ALL BELOW COMBNATIONS DON'T WORK - // rule("(?#\\\")(.*?)(?#\\\")", TK_STR); - // rule("[\"](.*?)[\"]", TK_STR); - // rule("(?:\")(.*?)(?:\")", TK_STR); - // rule("(?#:\")(.*?)(?#:\")", TK_STR); - // rule("(?#\")(.*?)(?#\")", TK_STR); - - // number - rule("\\d+", TK_LONG); - rule("\\d*[.]?\\d+", TK_FLOAT); - - // identifier - rule("[_a-zA-Z][_a-zA-Z0-9]{0,30}", TK_IDN); - - build(); - } - CypherLexer(CypherLexer &other) = delete; - CypherLexer(CypherLexer &&other) = default; -}; diff --git a/include/query/language/cypher/tokenizer/lexer.hpp b/include/query/language/cypher/tokenizer/lexer.hpp deleted file mode 100644 index 1075ea40a..000000000 --- a/include/query/language/cypher/tokenizer/lexer.hpp +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once - -#include -#include - -// unfortunatelly, lexertl uses some stuff deprecated in c++11 so we get some -// warnings during compile time, mainly for the auto_ptr -// auto_ptr > is deprecated -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "lexertl/generator.hpp" -#include "lexertl/lookup.hpp" -#pragma GCC diagnostic pop - -#include "query/language/cypher/errors.hpp" -#include "query/language/cypher/token.hpp" - -class Lexer -{ -public: - - // public pointer declarations - using uptr = std::unique_ptr; - using sptr = std::shared_ptr; - - // constructors - // default constructor creates unique pointers to object - // members - Lexer() : - rules(std::make_unique()), - sm(std::make_unique()) - { - } - // copy constructor is deleted - Lexer(Lexer& other) = delete; - // move constructor has default implementation - Lexer(Lexer&& other) : - rules(std::move(other.rules)), - sm(std::move(other.sm)) - { - } - - // TODO take care of concurrnecy and moving the lexer object when - // some Tokenizer already uses the it (right now I'm not - // sure what is going to happen) - // check this ASAP - class Tokenizer - { - public: - Tokenizer(const Lexer& lexer, const std::string& str) - : lexer(lexer), results(str.begin(), str.end()) {} - - Token lookup() - { - lexertl::lookup(*lexer.sm, results); - auto token = Token {results.id, results.str()}; - - if(results.id == static_cast(-1)) - throw CypherLexicalError(token); - - return token; - } - - private: - const Lexer& lexer; - lexertl::smatch results; - }; - - Tokenizer tokenize(const std::string& str) - { - return Tokenizer(*this, str); - } - - void build() - { - lexertl::generator::build(*rules, *sm); - } - - void rule(const std::string& regex, uint64_t id) - { - rules->push(regex, id); - } - -protected: - - using uptr_lexertl_rules = std::unique_ptr; - using uptr_lexertl_sm = std::unique_ptr; - - uptr_lexertl_rules rules; - uptr_lexertl_sm sm; -}; diff --git a/include/query/language/cypher/visitor/traverser.hpp b/include/query/language/cypher/visitor/traverser.hpp deleted file mode 100644 index 708410548..000000000 --- a/include/query/language/cypher/visitor/traverser.hpp +++ /dev/null @@ -1,317 +0,0 @@ -#pragma once - -#include "query/language/cypher/ast/ast.hpp" -#include "query/language/cypher/ast/ast_visitor.hpp" - -class Traverser : public ast::AstVisitor -{ -public: - using uptr = std::unique_ptr; - using sptr = std::shared_ptr; - - void visit(ast::Start& start_query) override - { - // DELETE - } - - void visit(ast::DeleteQuery& delete_query) override - { - accept(delete_query.match); - accept(delete_query.delete_clause); - } - - void visit(ast::ReadQuery& read_query) override - { - accept(read_query.match); - accept(read_query.return_clause); - } - - void visit(ast::ReadWriteQuery& query) override - { - accept(query.match_clause); - accept(query.create_clause); - accept(query.return_clause); - } - - void visit(ast::MergeQuery& query) override - { - accept(query.merge_clause); - accept(query.set_clause); - accept(query.return_clause); - } - - void visit(ast::Match& match) override - { - accept(match.pattern_list); - accept(match.where); - } - - void visit(ast::Pattern& pattern) override - { - accept(pattern.node); - accept(pattern.relationship); - accept(pattern.next); - } - - void visit(ast::PatternExpr& pattern_expr) override - { - accept(pattern_expr.pattern); - } - - void visit(ast::Node& node) override - { - accept(node.idn); - accept(node.labels); - accept(node.props); - } - - void visit(ast::Return& return_clause) override - { - accept(return_clause.return_list); - accept(return_clause.distinct); - } - - void visit(ast::Accessor& accessor) override - { - accept(accessor.entity); - accept(accessor.prop); - } - void visit(ast::Property& property) override - { - accept(property.idn); - accept(property.value); - } - - void visit(ast::And& and_expr) override - { - accept(and_expr.left); - accept(and_expr.right); - } - - void visit(ast::Or& or_expr) override - { - accept(or_expr.left); - accept(or_expr.right); - } - - void visit(ast::Lt& lt_expr) override - { - accept(lt_expr.left); - accept(lt_expr.right); - } - - void visit(ast::Gt& gt_expr) override - { - accept(gt_expr.left); - accept(gt_expr.right); - } - - void visit(ast::Ge& ge_expr) override - { - accept(ge_expr.left); - accept(ge_expr.right); - } - - void visit(ast::Le& le_expr) override - { - accept(le_expr.left); - accept(le_expr.right); - } - - void visit(ast::Eq& eq_expr) override - { - accept(eq_expr.left); - accept(eq_expr.right); - } - - void visit(ast::Ne& ne_expr) override - { - accept(ne_expr.left); - accept(ne_expr.right); - } - - void visit(ast::Plus& plus) override - { - accept(plus.left); - accept(plus.right); - } - - void visit(ast::Minus& minus) override - { - accept(minus.left); - accept(minus.right); - } - - void visit(ast::Star& star) override - { - accept(star.left); - accept(star.right); - } - - void visit(ast::Slash& slash) override - { - accept(slash.left); - accept(slash.right); - } - - void visit(ast::Rem& rem) override - { - accept(rem.left); - accept(rem.right); - } - - void visit(ast::CountFunction& count) override - { - } - - void visit(ast::LabelsFunction& labels) override - { - } - - void visit(ast::PropertyList& prop_list) override - { - accept(prop_list.value); - accept(prop_list.next); - } - - void visit(ast::PatternList& pattern_list) override - { - accept(pattern_list.value); - accept(pattern_list.next); - } - - void visit(ast::RelationshipTypeList& rel_list) override - { - accept(rel_list.value); - accept(rel_list.next); - } - - void visit(ast::IdentifierList& list) override - { - accept(list.value); - accept(list.next); - } - - void visit(ast::Relationship& rel) override - { - accept(rel.specs); - } - - void visit(ast::RelationshipSpecs& rel_specs) override - { - accept(rel_specs.idn); - accept(rel_specs.types); - accept(rel_specs.props); - } - - void visit(ast::LabelList& labels) override - { - accept(labels.value); - accept(labels.next); - } - - void visit(ast::ReturnList& return_list) override - { - accept(return_list.value); - accept(return_list.next); - } - - void visit(ast::Where& where) override - { - accept(where.expr); - } - - void visit(ast::WriteQuery& write_query) override - { - accept(write_query.create); - accept(write_query.return_clause); - } - - void visit(ast::UpdateQuery& update_query) override - { - accept(update_query.match_clause); - accept(update_query.set_clause); - accept(update_query.return_clause); - } - - void visit(ast::Set& set_clause) override - { - accept(set_clause.set_list); - } - - void visit(ast::SetValue& set_value) override - { - accept(set_value.value); - } - - void visit(ast::SetElement& set_element) override - { - accept(set_element.accessor); - accept(set_element.set_value); - } - - void visit(ast::LabelSetElement& label_set_element) override - { - accept(label_set_element.identifier); - accept(label_set_element.label_list); - } - - void visit(ast::SetList& set_list) override - { - accept(set_list.value); - accept(set_list.next); - } - - void visit(ast::Create& create) override - { - accept(create.pattern); - } - - void visit(ast::Merge& merge) override - { - accept(merge.pattern); - } - - void visit(ast::Distinct& distinct) override - { - accept(distinct.identifier); - } - - void visit(ast::Delete& delete_clause) override - { - accept(delete_clause.identifier); - } - - void visit(ast::WithClause& with_clause) override - { - accept(with_clause.identifier_list); - accept(with_clause.match_clause); - } - - void visit(ast::WithList& with_list) override - { - accept(with_list.value); - accept(with_list.next); - } - - void visit(ast::WithQuery& with_query) override - { - accept(with_query.match_clause); - accept(with_query.with_list); - accept(with_query.return_clause); - } - - void visit(ast::InternalIdExpr& internal_id) override - { - accept(internal_id.entity); - accept(internal_id.id); - } - -protected: - template - void accept(T* node) - { - if(node != nullptr) - node->accept(*this); - } -}; diff --git a/include/query/plan_compiler.hpp b/include/query/plan_compiler.hpp deleted file mode 100644 index 07de15f69..000000000 --- a/include/query/plan_compiler.hpp +++ /dev/null @@ -1,93 +0,0 @@ -#pragma once - -#include - -#include "logging/default.hpp" -#include "query/exception/plan_compilation.hpp" -#include "utils/string/join.hpp" -#include "logging/loggable.hpp" - -// TODO: -// * all libraries have to be compiled in the server compile time -// * compile command has to be generated - -/** - * Compiles code into shared object (.so) - */ -class PlanCompiler : public Loggable -{ -public: - PlanCompiler() : Loggable("PlanCompiler") {} - - /** - * Compiles in_file into out_file (.cpp -> .so) - * - * @param in_file C++ file that can be compiled into dynamic lib - * @param out_file dynamic lib (on linux .so) - * - * @return void - */ - void compile(const std::string &in_file, const std::string &out_file) - { - std::string flags; - -// TODO: sync this with cmake configuration -#ifdef NDEBUG - flags += " -DNDEBUG -O2"; -#endif -#ifdef LOG_NO_TRACE - flags += " -DLOG_NO_TRACE"; -#endif -#ifdef LOG_NO_DEBUG - flags += " -DLOG_NO_DEBUG"; -#endif -#ifdef LOG_NO_INFO - flags += " -DLOG_NO_INFO"; -#endif -#ifdef LOG_NO_WARN - flags += " -DLOG_NO_WARN"; -#endif -#ifdef LOG_NO_ERROR - flags += " -DLOG_NO_ERROR"; -#endif - - // TODO: load from config (generate compile command) - // generate compile command - auto compile_command = utils::prints( - "clang++" + flags, - // "-std=c++1y -O2 -DNDEBUG", - "-std=c++1y", // compile flags - in_file, // input file - "-o", out_file, // ouput file - "-I./include", // include paths - "-I../include", - "-I../../include", - "-I../../../include", - "-I../libs/fmt", - "-I../../libs/fmt", - "-I../../../libs/fmt", - "-L./ -L../ -L../../", - "-lmemgraph_pic", - "-shared -fPIC" // shared library flags - ); - - logger.debug("compile command -> {}", compile_command); - - // synchronous call - auto compile_status = system(compile_command.c_str()); - - logger.debug("compile status {}", compile_status); - - // if compilation has failed throw exception - if (compile_status != 0) { - logger.debug("FAIL: Query Code Compilation: {} -> {}", in_file, - out_file); - throw PlanCompilationException( - "Code compilation error. Generated code is not compilable or " - "compilation settings are wrong"); - } - - logger.debug("SUCCESS: Query Code Compilation: {} -> {}", in_file, - out_file); - } -}; diff --git a/include/query/plan_interface.hpp b/include/query/plan_interface.hpp deleted file mode 100644 index 04feccd23..000000000 --- a/include/query/plan_interface.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include "communication/communication.hpp" -#include "database/graph_db_accessor.hpp" -#include "query/stripped.hpp" - -/** - * @class PlanInterface - * - * @brief Pure Abstract class that is interface to query plans. - * - * @tparam Stream stream for results writing. - */ -template -class PlanInterface -{ -public: - /** - * In derived classes this method has to be overriden in order to implement - * concrete execution plan. - * - * @param db_accessor Accessor for ihe database. - * @param args plan argument (vector of literal values from the query) - * @param stream stream for results writing - * - * @return bool status after execution (success OR fail) - */ - virtual bool run(GraphDbAccessor &db_accessor, const TypedValueStore<> &args, Stream &stream) = 0; - - /** - * Virtual destructor in base class. - */ - virtual ~PlanInterface() {} -}; - -/** - * Defines type of underlying extern C functions and library object class name. - * (ObjectPrototype). - * - * @tparam underlying object depends on Stream template parameter because - * it will send the results throughout a custom Stream object. - */ -template -struct QueryPlanTrait -{ - using ObjectPrototype = PlanInterface; - using ProducePrototype = PlanInterface *(*)(); - using DestructPrototype = void (*)(PlanInterface *); -}; diff --git a/include/query/preprocessor.hpp b/include/query/preprocessor.hpp deleted file mode 100644 index 1b3d9162c..000000000 --- a/include/query/preprocessor.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "logging/loggable.hpp" -#include "query/stripper.hpp" - -/* - * Query preprocessing contains: - * * query stripping - * - * This class is here because conceptually process of query preprocessing - * might have more than one step + in current version of C++ standard - * isn't trivial to instantiate QueryStripper because of template arguments + - * it depends on underlying lexical analyser. - * - * The preprocessing results are: - * * stripped query | - * * stripped arguments |-> StrippedQuery - * * stripped query hash | - */ -class QueryPreprocessor : public Loggable -{ -private: - // In C++17 the ints will be removed. - // as far as I understand in C++17 class template parameters - // can be deduced just like function template parameters - // TODO: once C++ 17 will be well suported by comilers - // refactor this piece of code because it is hard to maintain. - using QueryStripperT = QueryStripper; - -public: - QueryPreprocessor() : Loggable("QueryPreprocessor"), - stripper(make_query_stripper(TK_LONG, TK_FLOAT, TK_STR, TK_BOOL)) - { - } - - /** - * Preprocess the query: - * * strip parameters - * * calculate query hash - * - * @param query that is going to be stripped - * - * @return QueryStripped object - */ - auto preprocess(const std::string &query) - { - auto preprocessed = stripper.strip(query); - - logger.info("stripped_query = {}", preprocessed.query); - logger.info("query_hash = {}", preprocessed.hash); - - return stripper.strip(query); - } - -private: - QueryStripperT stripper; -}; diff --git a/include/query/stripped.hpp b/include/query/stripped.hpp deleted file mode 100644 index aaee243a1..000000000 --- a/include/query/stripped.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "storage/typed_value_store.hpp" -#include "utils/hashing/fnv.hpp" - -/* -* StrippedQuery contains: -* * stripped query -* * plan arguments stripped from query -* * hash of stripped query -*/ -struct StrippedQuery { - - StrippedQuery(const std::string &&query, TypedValueStore<> &&arguments, HashType hash) - : query(std::forward(query)), - arguments(std::forward>(arguments)), hash(hash) {} - - /** - * Copy constructor is deleted because we don't want to make unecessary - * copies of this object (copying of string and vector could be expensive) - */ - StrippedQuery(const StrippedQuery &other) = delete; - StrippedQuery &operator=(const StrippedQuery &other) = delete; - - /** - * Move is allowed operation because it is not expensive and we can - * move the object after it was created. - */ - StrippedQuery(StrippedQuery &&other) = default; - StrippedQuery &operator=(StrippedQuery &&other) = default; - - /** - * Stripped query - */ - const std::string query; - - /** - * Stripped arguments - */ - const TypedValueStore<> arguments; - - /** - * Hash based on stripped query. - */ - const HashType hash; -}; diff --git a/include/query/stripper.hpp b/include/query/stripper.hpp deleted file mode 100644 index 79a085343..000000000 --- a/include/query/stripper.hpp +++ /dev/null @@ -1,122 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "cypher/cypher.h" -#include "logging/loggable.hpp" -#include "query/language/cypher/tokenizer/cypher_lexer.hpp" -#include "query/stripped.hpp" -#include "storage/typed_value_store.hpp" -#include "utils/hashing/fnv.hpp" -#include "utils/string/transform.hpp" -#include "utils/variadic/variadic.hpp" - -// TODO: all todos will be resolved once Antler will be integrated -template -class QueryStripper : public Loggable { -public: - QueryStripper(Ts &&... strip_types) - : Loggable("QueryStripper"), - strip_types(std::make_tuple(std::forward(strip_types)...)), - lexer(std::make_unique()) { - } - - QueryStripper(QueryStripper &other) = delete; - - QueryStripper(QueryStripper &&other) - : Loggable("QueryStripper"), strip_types(std::move(other.strip_types)), - lexer(std::move(other.lexer)) { - } - - auto strip(const std::string &query, const std::string &separator = " ") { - // ------------------------------------------------------------------- - // TODO: write speed tests and then optimize, because this - // function is called before every query execution ! - // ------------------------------------------------------------------- - - // TODO write this more optimal (resplace string - // concatenation with something smarter) - // TODO: in place substring replacement - - auto tokenizer = lexer->tokenize(query); - - // TMP size of supported token types - constexpr auto size = std::tuple_size::value; - - TypedValueStore<> stripped_arguments; - std::string stripped_query; - stripped_query.reserve(query.size()); - - int counter = 0; // how many arguments have we processed so far - while (auto token = tokenizer.lookup()) { - if (_or(token.id, strip_types, std::make_index_sequence < size > {})) { - switch (token.id) { - case TK_LONG: - stripped_arguments.set(counter, std::stoi(token.value)); - break; - case TK_STR: - // TODO: remove quotes view lexertl - token.value.erase(0, 1); - token.value.erase(token.value.length() - 1, 1); - // TODO: remove - stripped_arguments.set(counter, token.value); - break; - case TK_BOOL: { - bool value = token.value[0] == 'T' || token.value[0] == 't'; - stripped_arguments.set(counter, value); - break; - } - case TK_FLOAT: - stripped_arguments.set(counter, std::stof(token.value)); - break; - default: - // TODO: other properties - assert(false); - } - stripped_query += std::to_string(counter++) + separator; - } else { - // if token is keyword then lowercase because query hash - // should be the same - // TODO: probably we shoud do the lowercase before - // or during the tokenization (SPEED TESTS) - if (token.id == TK_OR || token.id == TK_AND || - token.id == TK_NOT || token.id == TK_WITH || - token.id == TK_SET || token.id == TK_CREATE || - token.id == TK_MERGE || token.id == TK_MATCH || - token.id == TK_DELETE || token.id == TK_DETACH || - token.id == TK_WHERE || token.id == TK_RETURN || - token.id == TK_DISTINCT || token.id == TK_COUNT || - token.id == TK_LABELS) { - std::transform(token.value.begin(), token.value.end(), - token.value.begin(), ::tolower); - } - stripped_query += token.value + separator; - } - } - - // TODO: hash function should be a template parameter - HashType hash = fnv(stripped_query); - return StrippedQuery(std::move(stripped_query), - std::move(stripped_arguments), hash); - } - -private: - std::tuple strip_types; - CypherLexer::uptr lexer; - - template - bool _or(Value &&value, Tuple &&tuple, std::index_sequence) { - return utils::or_vargs(std::forward(value), - std::get(std::forward(tuple))...); - } -}; - -template -decltype(auto) make_query_stripper(Ts &&... ts) { - return QueryStripper(std::forward(ts)...); -} diff --git a/include/query/util.hpp b/include/query/util.hpp deleted file mode 100644 index 0b887ad42..000000000 --- a/include/query/util.hpp +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "fmt/format.h" -#include "logging/default.hpp" -#include "utils/exceptions/basic_exception.hpp" - -using std::cout; -using std::endl; - -// this is a nice way how to avoid multiple definition problem with -// headers because it will create a unique namespace for each compilation unit -// http://stackoverflow.com/questions/2727582/multiple-definition-in-header-file -// but sometimes that might be a problem -namespace { - - class CodeLineFormatException : public BasicException { - public: - using BasicException::BasicException; - }; - - template - std::string format(const std::string &format_str, const Args &... args) { - return fmt::format(format_str, args...); - } - - template - std::string code_line(const std::string &format_str, const Args &... args) { - try { - return "\t" + format(format_str, args...) + "\n"; - } catch (std::runtime_error &e) { - throw CodeLineFormatException(std::string(e.what()) + " " + format_str); - } - } - - class CoutSocket { - public: - CoutSocket() : logger(logging::log->logger("Cout Socket")) {} - - int write(const std::string &str) { - logger.info(str); - return str.size(); - } - - int write(const char *data, size_t len) { - logger.info(std::string(data, len)); - return len; - } - - int write(const byte *data, size_t len) { - std::stringstream ss; - for (int i = 0; i < len; i++) { - ss << data[i]; - } - std::string output(ss.str()); - cout << output << endl; - logger.info(output); - return len; - } - - private: - Logger logger; - }; - -} diff --git a/include/test.txt b/include/test.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/init.sh b/init.sh index a93b7bc3f..0adeba289 100755 --- a/init.sh +++ b/init.sh @@ -20,4 +20,8 @@ cd libs ./setup.sh cd .. +cd build +wget http://www.antlr.org/download/antlr-4.6-complete.jar +cd .. + echo "DONE" diff --git a/libs/.gitignore b/libs/.gitignore index e161b1247..a989a7491 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -2,3 +2,4 @@ !.gitignore !setup.sh !cleanup.sh +!CMakeLists.txt diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt new file mode 100644 index 000000000..010d8aa04 --- /dev/null +++ b/libs/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.1) + +# setup antlr +option(WITH_LIBCXX "" OFF) # because of debian bug +# http://stackoverflow.com/questions/37096062/get-a-basic-c-program-to-compile-using-clang-on-ubuntu-16/38385967#38385967 +add_subdirectory(antlr4/runtime/Cpp) + +# setup google benchmark +add_subdirectory(benchmark) + +# setup cppitertools +include_directories(cppitertools) + +# setup fmt format +# fmt uses google test but if fmt isn't top project (here it isn't) fmt tests +# are disabled (reasonable configuration) +add_subdirectory(fmt) + +# setup google test +add_subdirectory(googletest) + +# setup yaml cpp +# disable tests because yaml doesn't have MASTER_PROJECT flag like fmt has +# to override an option use option :) +option(YAML_CPP_BUILD_TOOLS "" OFF) +add_subdirectory(yaml-cpp) diff --git a/libs/setup.sh b/libs/setup.sh index 755f4d442..dbb8c4b69 100755 --- a/libs/setup.sh +++ b/libs/setup.sh @@ -1,43 +1,47 @@ #!/bin/bash -# Catch -git clone https://github.com/philsquared/Catch.git -catch_tag="master" -cd Catch -git checkout ${catch_tag} +# antlr +git clone https://github.com/antlr/antlr4.git +antlr4_tag="aacd2a2c95816d8dc1c05814051d631bfec4cf3e" # v4.6 +cd antlr4 +git checkout ${antlr4_tag} +cd .. + +# cppitertools +git clone https://github.com/ryanhaining/cppitertools.git +cd cppitertools +cppitertools_tag="394cc4debcd037db199551546b6fbc3ea3066722" # master 7 Oct 2016 +# because last release was v0.2 and at the point when +# the lib was added master had 104 commits more than v0.2 +git checkout ${cppitertools_tag} cd .. # fmt git clone https://github.com/fmtlib/fmt.git -fmt_tag="e5e4fb370ccf327bbdcdcd782eb3e53580e11094" +fmt_tag="e5e4fb370ccf327bbdcdcd782eb3e53580e11094" # v3.0.0 cd fmt git checkout ${fmt_tag} -cmake . -make +cd .. + +# google benchmark +git clone https://github.com/google/benchmark.git +benchmark_tag="4f8bfeae470950ef005327973f15b0044eceaceb" # v1.1.0 +cd benchmark +git checkout ${benchmark_tag} +cd .. + +# google test +git clone https://github.com/google/googletest.git +googletest_tag="ec44c6c1675c25b9827aacd08c02433cccde7780" # v1.8.0 +cd googletest +git checkout ${googletest_tag} cd .. # yaml-cpp git clone https://github.com/jbeder/yaml-cpp -yaml_cpp_tag="519d33fea3fbcbe7e1f89f97ee0fa539cec33eb7" +yaml_cpp_tag="519d33fea3fbcbe7e1f89f97ee0fa539cec33eb7" # master 18 Aug 2016 +# because a bug with link process had been fixed somewhen between +# this commit and v0.5.3 cd yaml-cpp git checkout ${yaml_cpp_tag} -cmake . -make -cd .. - -# lemon -mkdir lemon -cd lemon -lemon_tag="09a96bed19955697a5e20c49ad863ec2005815a2" -wget http://www.sqlite.org/src/raw/tool/lemon.c?name=${lemon_tag} -O lemon.c -lempar_tag="8c4e9d8517e50da391f1d89a519e743dd4afbc09" -wget http://www.sqlite.org/src/raw/tool/lempar.c?name=${lempar_tag} -O lempar.c -clang lemon.c -o lemon -O2 -cd .. - -# lexertl -git clone https://github.com/BenHanson/lexertl.git -lexertl_tag=7d4d36a357027df0e817453cc9cf948f71047ca9 -cd lexertl -git checkout ${lexertl_tag} cd .. diff --git a/include/communication/communication.hpp b/src/communication/bolt/communication.hpp similarity index 100% rename from include/communication/communication.hpp rename to src/communication/bolt/communication.hpp diff --git a/include/communication/bolt/v1/bolt.hpp b/src/communication/bolt/v1/bolt.hpp similarity index 100% rename from include/communication/bolt/v1/bolt.hpp rename to src/communication/bolt/v1/bolt.hpp diff --git a/include/communication/bolt/v1/config.hpp b/src/communication/bolt/v1/config.hpp similarity index 100% rename from include/communication/bolt/v1/config.hpp rename to src/communication/bolt/v1/config.hpp diff --git a/include/communication/bolt/v1/messaging/codes.hpp b/src/communication/bolt/v1/messaging/codes.hpp similarity index 100% rename from include/communication/bolt/v1/messaging/codes.hpp rename to src/communication/bolt/v1/messaging/codes.hpp diff --git a/include/communication/bolt/v1/packing/codes.hpp b/src/communication/bolt/v1/packing/codes.hpp similarity index 100% rename from include/communication/bolt/v1/packing/codes.hpp rename to src/communication/bolt/v1/packing/codes.hpp diff --git a/include/communication/bolt/v1/packing/types.hpp b/src/communication/bolt/v1/packing/types.hpp similarity index 100% rename from include/communication/bolt/v1/packing/types.hpp rename to src/communication/bolt/v1/packing/types.hpp diff --git a/include/communication/bolt/v1/serialization/bolt_serializer.hpp b/src/communication/bolt/v1/serialization/bolt_serializer.hpp similarity index 100% rename from include/communication/bolt/v1/serialization/bolt_serializer.hpp rename to src/communication/bolt/v1/serialization/bolt_serializer.hpp diff --git a/include/communication/bolt/v1/serialization/record_stream.hpp b/src/communication/bolt/v1/serialization/record_stream.hpp similarity index 100% rename from include/communication/bolt/v1/serialization/record_stream.hpp rename to src/communication/bolt/v1/serialization/record_stream.hpp diff --git a/include/communication/bolt/v1/server/server.hpp b/src/communication/bolt/v1/server/server.hpp similarity index 100% rename from include/communication/bolt/v1/server/server.hpp rename to src/communication/bolt/v1/server/server.hpp diff --git a/include/communication/bolt/v1/server/worker.hpp b/src/communication/bolt/v1/server/worker.hpp similarity index 100% rename from include/communication/bolt/v1/server/worker.hpp rename to src/communication/bolt/v1/server/worker.hpp diff --git a/include/communication/bolt/v1/session.hpp b/src/communication/bolt/v1/session.hpp similarity index 94% rename from include/communication/bolt/v1/session.hpp rename to src/communication/bolt/v1/session.hpp index b20b97109..6f58c4d43 100644 --- a/include/communication/bolt/v1/session.hpp +++ b/src/communication/bolt/v1/session.hpp @@ -8,7 +8,7 @@ #include "communication/bolt/v1/states/state.hpp" #include "communication/bolt/v1/transport/bolt_decoder.hpp" #include "communication/bolt/v1/transport/bolt_encoder.hpp" -#include "communication/communication.hpp" +#include "communication/bolt/communication.hpp" #include "logging/default.hpp" diff --git a/include/communication/bolt/v1/states.hpp b/src/communication/bolt/v1/states.hpp similarity index 100% rename from include/communication/bolt/v1/states.hpp rename to src/communication/bolt/v1/states.hpp diff --git a/include/communication/bolt/v1/states/error.hpp b/src/communication/bolt/v1/states/error.hpp similarity index 100% rename from include/communication/bolt/v1/states/error.hpp rename to src/communication/bolt/v1/states/error.hpp diff --git a/src/communication/bolt/v1/states/executor.cpp b/src/communication/bolt/v1/states/executor.cpp index bac0965d6..fb79e1752 100644 --- a/src/communication/bolt/v1/states/executor.cpp +++ b/src/communication/bolt/v1/states/executor.cpp @@ -32,14 +32,6 @@ State *Executor::run(Session &session) return this->run(session, q); // TODO: RETURN success MAYBE } - catch (const CypherLexicalError &e) - { - session.output_stream.write_failure( - {{"code", "Memgraph.CypherLexicalError"}, - {"message", e.what()}}); - session.output_stream.send(); - return session.bolt.states.error.get(); - } catch (const QueryEngineException &e) { session.output_stream.write_failure( diff --git a/include/communication/bolt/v1/states/executor.hpp b/src/communication/bolt/v1/states/executor.hpp similarity index 100% rename from include/communication/bolt/v1/states/executor.hpp rename to src/communication/bolt/v1/states/executor.hpp diff --git a/include/communication/bolt/v1/states/handshake.hpp b/src/communication/bolt/v1/states/handshake.hpp similarity index 100% rename from include/communication/bolt/v1/states/handshake.hpp rename to src/communication/bolt/v1/states/handshake.hpp diff --git a/include/communication/bolt/v1/states/init.hpp b/src/communication/bolt/v1/states/init.hpp similarity index 100% rename from include/communication/bolt/v1/states/init.hpp rename to src/communication/bolt/v1/states/init.hpp diff --git a/include/communication/bolt/v1/states/message_parser.hpp b/src/communication/bolt/v1/states/message_parser.hpp similarity index 100% rename from include/communication/bolt/v1/states/message_parser.hpp rename to src/communication/bolt/v1/states/message_parser.hpp diff --git a/include/communication/bolt/v1/states/state.hpp b/src/communication/bolt/v1/states/state.hpp similarity index 100% rename from include/communication/bolt/v1/states/state.hpp rename to src/communication/bolt/v1/states/state.hpp diff --git a/include/communication/bolt/v1/transport/bolt_decoder.hpp b/src/communication/bolt/v1/transport/bolt_decoder.hpp similarity index 100% rename from include/communication/bolt/v1/transport/bolt_decoder.hpp rename to src/communication/bolt/v1/transport/bolt_decoder.hpp diff --git a/include/communication/bolt/v1/transport/bolt_encoder.hpp b/src/communication/bolt/v1/transport/bolt_encoder.hpp similarity index 100% rename from include/communication/bolt/v1/transport/bolt_encoder.hpp rename to src/communication/bolt/v1/transport/bolt_encoder.hpp diff --git a/include/communication/bolt/v1/transport/buffer.hpp b/src/communication/bolt/v1/transport/buffer.hpp similarity index 100% rename from include/communication/bolt/v1/transport/buffer.hpp rename to src/communication/bolt/v1/transport/buffer.hpp diff --git a/include/communication/bolt/v1/transport/chunked_buffer.hpp b/src/communication/bolt/v1/transport/chunked_buffer.hpp similarity index 100% rename from include/communication/bolt/v1/transport/chunked_buffer.hpp rename to src/communication/bolt/v1/transport/chunked_buffer.hpp diff --git a/include/communication/bolt/v1/transport/chunked_decoder.hpp b/src/communication/bolt/v1/transport/chunked_decoder.hpp similarity index 100% rename from include/communication/bolt/v1/transport/chunked_decoder.hpp rename to src/communication/bolt/v1/transport/chunked_decoder.hpp diff --git a/include/communication/bolt/v1/transport/chunked_encoder.hpp b/src/communication/bolt/v1/transport/chunked_encoder.hpp similarity index 100% rename from include/communication/bolt/v1/transport/chunked_encoder.hpp rename to src/communication/bolt/v1/transport/chunked_encoder.hpp diff --git a/include/communication/bolt/v1/transport/socket_stream.hpp b/src/communication/bolt/v1/transport/socket_stream.hpp similarity index 100% rename from include/communication/bolt/v1/transport/socket_stream.hpp rename to src/communication/bolt/v1/transport/socket_stream.hpp diff --git a/include/communication/bolt/v1/transport/stream_error.hpp b/src/communication/bolt/v1/transport/stream_error.hpp similarity index 100% rename from include/communication/bolt/v1/transport/stream_error.hpp rename to src/communication/bolt/v1/transport/stream_error.hpp diff --git a/include/communication/bolt/v1/transport/streamed_bolt_decoder.hpp b/src/communication/bolt/v1/transport/streamed_bolt_decoder.hpp similarity index 100% rename from include/communication/bolt/v1/transport/streamed_bolt_decoder.hpp rename to src/communication/bolt/v1/transport/streamed_bolt_decoder.hpp diff --git a/include/config/config.hpp b/src/config/config.hpp similarity index 97% rename from include/config/config.hpp rename to src/config/config.hpp index 0e1c3929f..fa88e4924 100644 --- a/include/config/config.hpp +++ b/src/config/config.hpp @@ -9,7 +9,7 @@ namespace config { // this class is used as a Definition class of config::Config class from utils -// number of elements shoud be small, +// number of elements should be small, // it depends on implementation of config::Config class // in other words number of fields in Definition class should be related // to the number of config keys diff --git a/src/crash_analysis/server/.gitignore b/src/crash_analysis/server/.gitignore deleted file mode 100644 index af8b9686e..000000000 --- a/src/crash_analysis/server/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ve/ diff --git a/src/crash_analysis/server/app.py b/src/crash_analysis/server/app.py deleted file mode 100644 index 92bd23c9e..000000000 --- a/src/crash_analysis/server/app.py +++ /dev/null @@ -1,19 +0,0 @@ -import json -from flask import Flask, request - -app = Flask(__name__) - -@app.route("/crash", methods=["POST"]) -def crash(): - ''' - Appends json body to a log file and print it to the stdout. - ''' - body_dump = json.dumps(request.json) - with open("crash.log", "a") as f: - f.write(body_dump) - f.write('\n') - print(body_dump) - return '', 204 - -if __name__ == "__main__": - app.run(host="0.0.0.0", port=8080) diff --git a/src/crash_analysis/server/requirements.txt b/src/crash_analysis/server/requirements.txt deleted file mode 100644 index 4d3e216bf..000000000 --- a/src/crash_analysis/server/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -click==6.6 -Flask==0.11.1 -itsdangerous==0.24 -Jinja2==2.8 -MarkupSafe==0.23 -Werkzeug==0.11.10 diff --git a/include/data_structures/bitset/dynamic_bitset.hpp b/src/data_structures/bitset/dynamic_bitset.hpp similarity index 100% rename from include/data_structures/bitset/dynamic_bitset.hpp rename to src/data_structures/bitset/dynamic_bitset.hpp diff --git a/include/data_structures/bloom/bloom_filter.hpp b/src/data_structures/bloom/bloom_filter.hpp similarity index 100% rename from include/data_structures/bloom/bloom_filter.hpp rename to src/data_structures/bloom/bloom_filter.hpp diff --git a/include/data_structures/concurrent/common.hpp b/src/data_structures/concurrent/common.hpp similarity index 100% rename from include/data_structures/concurrent/common.hpp rename to src/data_structures/concurrent/common.hpp diff --git a/include/data_structures/concurrent/concurrent_bloom_map.hpp b/src/data_structures/concurrent/concurrent_bloom_map.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_bloom_map.hpp rename to src/data_structures/concurrent/concurrent_bloom_map.hpp diff --git a/include/data_structures/concurrent/concurrent_list.hpp b/src/data_structures/concurrent/concurrent_list.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_list.hpp rename to src/data_structures/concurrent/concurrent_list.hpp diff --git a/include/data_structures/concurrent/concurrent_map.hpp b/src/data_structures/concurrent/concurrent_map.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_map.hpp rename to src/data_structures/concurrent/concurrent_map.hpp diff --git a/include/data_structures/concurrent/concurrent_multimap.hpp b/src/data_structures/concurrent/concurrent_multimap.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_multimap.hpp rename to src/data_structures/concurrent/concurrent_multimap.hpp diff --git a/include/data_structures/concurrent/concurrent_multiset.hpp b/src/data_structures/concurrent/concurrent_multiset.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_multiset.hpp rename to src/data_structures/concurrent/concurrent_multiset.hpp diff --git a/include/data_structures/concurrent/concurrent_set.hpp b/src/data_structures/concurrent/concurrent_set.hpp similarity index 100% rename from include/data_structures/concurrent/concurrent_set.hpp rename to src/data_structures/concurrent/concurrent_set.hpp diff --git a/include/data_structures/concurrent/skiplist.hpp b/src/data_structures/concurrent/skiplist.hpp similarity index 100% rename from include/data_structures/concurrent/skiplist.hpp rename to src/data_structures/concurrent/skiplist.hpp diff --git a/include/data_structures/concurrent/skiplist_gc.hpp b/src/data_structures/concurrent/skiplist_gc.hpp similarity index 100% rename from include/data_structures/concurrent/skiplist_gc.hpp rename to src/data_structures/concurrent/skiplist_gc.hpp diff --git a/include/data_structures/kdtree/build.hpp b/src/data_structures/kdtree/build.hpp similarity index 100% rename from include/data_structures/kdtree/build.hpp rename to src/data_structures/kdtree/build.hpp diff --git a/include/data_structures/kdtree/kdnode.hpp b/src/data_structures/kdtree/kdnode.hpp similarity index 100% rename from include/data_structures/kdtree/kdnode.hpp rename to src/data_structures/kdtree/kdnode.hpp diff --git a/include/data_structures/kdtree/kdtree.hpp b/src/data_structures/kdtree/kdtree.hpp similarity index 100% rename from include/data_structures/kdtree/kdtree.hpp rename to src/data_structures/kdtree/kdtree.hpp diff --git a/include/data_structures/kdtree/math.hpp b/src/data_structures/kdtree/math.hpp similarity index 100% rename from include/data_structures/kdtree/math.hpp rename to src/data_structures/kdtree/math.hpp diff --git a/include/data_structures/kdtree/nns.hpp b/src/data_structures/kdtree/nns.hpp similarity index 100% rename from include/data_structures/kdtree/nns.hpp rename to src/data_structures/kdtree/nns.hpp diff --git a/include/data_structures/kdtree/point.hpp b/src/data_structures/kdtree/point.hpp similarity index 100% rename from include/data_structures/kdtree/point.hpp rename to src/data_structures/kdtree/point.hpp diff --git a/include/data_structures/list/lockfree_list.hpp b/src/data_structures/list/lockfree_list.hpp similarity index 100% rename from include/data_structures/list/lockfree_list.hpp rename to src/data_structures/list/lockfree_list.hpp diff --git a/include/data_structures/map/rh_common.hpp b/src/data_structures/map/rh_common.hpp similarity index 100% rename from include/data_structures/map/rh_common.hpp rename to src/data_structures/map/rh_common.hpp diff --git a/include/data_structures/map/rh_hashmap.hpp b/src/data_structures/map/rh_hashmap.hpp similarity index 100% rename from include/data_structures/map/rh_hashmap.hpp rename to src/data_structures/map/rh_hashmap.hpp diff --git a/include/data_structures/map/rh_hashmultimap.hpp b/src/data_structures/map/rh_hashmultimap.hpp similarity index 100% rename from include/data_structures/map/rh_hashmultimap.hpp rename to src/data_structures/map/rh_hashmultimap.hpp diff --git a/include/data_structures/ptr_int.hpp b/src/data_structures/ptr_int.hpp similarity index 100% rename from include/data_structures/ptr_int.hpp rename to src/data_structures/ptr_int.hpp diff --git a/include/data_structures/queue/bounded_spsc_queue.hpp b/src/data_structures/queue/bounded_spsc_queue.hpp similarity index 100% rename from include/data_structures/queue/bounded_spsc_queue.hpp rename to src/data_structures/queue/bounded_spsc_queue.hpp diff --git a/include/data_structures/queue/mpsc_queue.hpp b/src/data_structures/queue/mpsc_queue.hpp similarity index 100% rename from include/data_structures/queue/mpsc_queue.hpp rename to src/data_structures/queue/mpsc_queue.hpp diff --git a/include/data_structures/queue/slqueue.hpp b/src/data_structures/queue/slqueue.hpp similarity index 100% rename from include/data_structures/queue/slqueue.hpp rename to src/data_structures/queue/slqueue.hpp diff --git a/include/data_structures/slrbtree.hpp b/src/data_structures/slrbtree.hpp similarity index 100% rename from include/data_structures/slrbtree.hpp rename to src/data_structures/slrbtree.hpp diff --git a/include/data_structures/slstack.hpp b/src/data_structures/slstack.hpp similarity index 100% rename from include/data_structures/slstack.hpp rename to src/data_structures/slstack.hpp diff --git a/include/data_structures/stack/array_stack.hpp b/src/data_structures/stack/array_stack.hpp similarity index 100% rename from include/data_structures/stack/array_stack.hpp rename to src/data_structures/stack/array_stack.hpp diff --git a/include/data_structures/static_array.hpp b/src/data_structures/static_array.hpp similarity index 100% rename from include/data_structures/static_array.hpp rename to src/data_structures/static_array.hpp diff --git a/include/data_structures/union_find/union_find.hpp b/src/data_structures/union_find/union_find.hpp similarity index 100% rename from include/data_structures/union_find/union_find.hpp rename to src/data_structures/union_find/union_find.hpp diff --git a/include/database/creation_exception.hpp b/src/database/creation_exception.hpp similarity index 100% rename from include/database/creation_exception.hpp rename to src/database/creation_exception.hpp diff --git a/include/database/graph_db.hpp b/src/database/graph_db.hpp similarity index 100% rename from include/database/graph_db.hpp rename to src/database/graph_db.hpp diff --git a/include/database/graph_db_accessor.hpp b/src/database/graph_db_accessor.hpp similarity index 100% rename from include/database/graph_db_accessor.hpp rename to src/database/graph_db_accessor.hpp diff --git a/include/dbms/cleaner.hpp b/src/dbms/cleaner.hpp similarity index 100% rename from include/dbms/cleaner.hpp rename to src/dbms/cleaner.hpp diff --git a/include/dbms/dbms.hpp b/src/dbms/dbms.hpp similarity index 100% rename from include/dbms/dbms.hpp rename to src/dbms/dbms.hpp diff --git a/src/http/connection.hpp b/src/http/connection.hpp deleted file mode 100644 index e385e440f..000000000 --- a/src/http/connection.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "io/network/tcp/stream.hpp" -#include "memory/literals.hpp" - -namespace http -{ -using namespace memory::literals; - -template -class Connection : public io::tcp::Stream -{ -public: - struct Buffers - { - char headers[8_kB]; - char body[64_kB]; - - static constexpr size_t size = sizeof headers + sizeof body; - }; - - Connection(io::Socket&& socket) : io::tcp::Stream(std::move(socket)), - response(this->socket) {} - - // tcp stream reads into these buffers - Buffers buffers; - - Req request; - Res response; -}; - -} diff --git a/src/http/headers.hpp b/src/http/headers.hpp deleted file mode 100644 index 302d364ad..000000000 --- a/src/http/headers.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include - -#include "utils/string/weak_string.hpp" - -namespace http -{ - -class Headers -{ - static constexpr WeakString empty = WeakString(); - -public: - struct Header - { - WeakString key; - WeakString value; - }; - - std::pair operator[](const std::string& key) - { - auto ww = WeakString(); - - for(auto& header : headers) - if(key == header.key) - return {true, header.value}; - - return {false, ww}; - } - -private: - std::array headers; -}; - - -} diff --git a/src/http/parser.hpp b/src/http/parser.hpp deleted file mode 100644 index 33c84dec0..000000000 --- a/src/http/parser.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace htpp -{ - -class Parser -{ - - -}; - -} diff --git a/src/http/parser_test.cpp b/src/http/parser_test.cpp deleted file mode 100644 index 8e3841181..000000000 --- a/src/http/parser_test.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include - -#include "io/network/tcp_server.hpp" -#include "http/worker.hpp" - -int main(void) -{ - const char* req = "GET /foo/bar/7/comments HTTP/1.1\r\n" - "Content-Type : application/javascript\r\n" - "Content-Length: 3872\r\n" - "Connection:keep-alive\r\n" - "Accept-Ranges: bytes\r\n" - "Last-modified: Sun, 8 october 2015 GMT\r\n" - "\r\n" - "{alo:'bre', bre: 'alo sta ti je'}\r\n"; - - io::TcpServer server; - - server.bind("0.0.0.0", "7474").listen(8, 128, []() { - std::cout << "response!" << std::endl; - }); - - return 0; -}; diff --git a/src/http/request.hpp b/src/http/request.hpp deleted file mode 100644 index 482408658..000000000 --- a/src/http/request.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace http -{ - -class Request -{ -public: - Request() = default; - -}; - -} diff --git a/src/http/response.hpp b/src/http/response.hpp deleted file mode 100644 index aa10db30f..000000000 --- a/src/http/response.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include - -#include "io/network/socket.hpp" -#include "memory/literals.hpp" - -namespace http -{ -using namespace memory::literals; - -class Response -{ - template - struct Buffer - { - public: - Buffer() = default; - - size_t write(const char* data, size_t n) - { - ::memcpy(buf + len, data, std::max(n, capacity - len)); - } - - char buf[capacity]; - size_t len {0}; - }; - -public: - Response(io::Socket& socket) : socket(socket) {} - - Response& write(const char* data, size_t len) - { - /* while(true) */ - /* { */ - /* auto bytes_written = buffer.write(data, len); */ - - /* if(len - bytes_written == 0) */ - /* break; */ - - /* len -= bytes_written, data += bytes_written; */ - - /* char* ptr = buffer.buf; */ - - /* socket.write(p */ - - /* } */ - - - - return *this; - } - -private: - io::Socket& socket; - Buffer<64_kB> buffer; - - /* void flush_socket() */ -}; - -} diff --git a/src/http/worker.hpp b/src/http/worker.hpp deleted file mode 100644 index 86640e33f..000000000 --- a/src/http/worker.hpp +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include "io/network/server.hpp" -#include "debug/log.hpp" -#include "connection.hpp" - -namespace http -{ - -/* const char* body = "Now that the internet can be accessed on any mobile device, whether a laptop, desktop, tablets, smartphone, websites are designed in responsive web version. It is the ability to change the page and font size according to the screen size of the user. desktop, tablets, smartphone, websites are designed in responsive web version. It is the ability to change the page and font size according to the screen size of the user. Thus a website is accessible anytime on any instrument. CSS3 frameworks were widely accepted in 2014 and is growing in 2015. It reduces time and money by helping not creating different sites for different users"; */ - -/* const char* body = ""; */ - -std::string response = "HTTP/1.1 200 OK\r\nContent-Length:0\r\n\r\n"; - -template -class Parser : public io::Server, Connection> -{ - using Connection = Connection; - using Buffer = typename io::StreamReader, Connection>::Buffer; - -public: - char buf[65536]; - - Parser() = default; - - Connection& on_connect(io::Socket&& socket) - { - auto stream = new Connection(std::move(socket)); - LOG_DEBUG("on_connect socket " << stream->id()); - - return *stream; - } - - void on_error(Connection& conn) - { - LOG_DEBUG("on_error: " << conn.id()); - } - - void on_wait_timeout() {} - - Buffer on_alloc(Connection& conn) - { - LOG_DEBUG("on_alloc socket " << conn.id()); - return Buffer { buf, sizeof buf }; - } - - void on_read(Connection& conn, Buffer& buf) - { - LOG_DEBUG("on_read socket " << conn.id()); - auto& socket = conn.socket; - socket.write(response.c_str(), response.size()); - } - - void on_close(Connection& conn) - { - LOG_DEBUG("on_close socket " << conn.id()); - conn.close(); - } -}; - -} diff --git a/include/import/base_import.hpp b/src/import/base_import.hpp similarity index 100% rename from include/import/base_import.hpp rename to src/import/base_import.hpp diff --git a/include/import/csv_import.hpp b/src/import/csv_import.hpp similarity index 100% rename from include/import/csv_import.hpp rename to src/import/csv_import.hpp diff --git a/include/import/element_skeleton.hpp b/src/import/element_skeleton.hpp similarity index 100% rename from include/import/element_skeleton.hpp rename to src/import/element_skeleton.hpp diff --git a/include/import/fillings/bool.hpp b/src/import/fillings/bool.hpp similarity index 100% rename from include/import/fillings/bool.hpp rename to src/import/fillings/bool.hpp diff --git a/include/import/fillings/common.hpp b/src/import/fillings/common.hpp similarity index 100% rename from include/import/fillings/common.hpp rename to src/import/fillings/common.hpp diff --git a/include/import/fillings/filler.hpp b/src/import/fillings/filler.hpp similarity index 100% rename from include/import/fillings/filler.hpp rename to src/import/fillings/filler.hpp diff --git a/include/import/fillings/float.hpp b/src/import/fillings/float.hpp similarity index 100% rename from include/import/fillings/float.hpp rename to src/import/fillings/float.hpp diff --git a/include/import/fillings/from.hpp b/src/import/fillings/from.hpp similarity index 100% rename from include/import/fillings/from.hpp rename to src/import/fillings/from.hpp diff --git a/include/import/fillings/id.hpp b/src/import/fillings/id.hpp similarity index 100% rename from include/import/fillings/id.hpp rename to src/import/fillings/id.hpp diff --git a/include/import/fillings/int64.hpp b/src/import/fillings/int64.hpp similarity index 100% rename from include/import/fillings/int64.hpp rename to src/import/fillings/int64.hpp diff --git a/include/import/fillings/label.hpp b/src/import/fillings/label.hpp similarity index 100% rename from include/import/fillings/label.hpp rename to src/import/fillings/label.hpp diff --git a/include/import/fillings/skip.hpp b/src/import/fillings/skip.hpp similarity index 100% rename from include/import/fillings/skip.hpp rename to src/import/fillings/skip.hpp diff --git a/include/import/fillings/string.hpp b/src/import/fillings/string.hpp similarity index 100% rename from include/import/fillings/string.hpp rename to src/import/fillings/string.hpp diff --git a/include/import/fillings/to.hpp b/src/import/fillings/to.hpp similarity index 100% rename from include/import/fillings/to.hpp rename to src/import/fillings/to.hpp diff --git a/include/import/fillings/type.hpp b/src/import/fillings/type.hpp similarity index 100% rename from include/import/fillings/type.hpp rename to src/import/fillings/type.hpp diff --git a/include/io/network/.gitignore b/src/io/network/.gitignore similarity index 100% rename from include/io/network/.gitignore rename to src/io/network/.gitignore diff --git a/include/io/network/addrinfo.hpp b/src/io/network/addrinfo.hpp similarity index 100% rename from include/io/network/addrinfo.hpp rename to src/io/network/addrinfo.hpp diff --git a/include/io/network/client.hpp b/src/io/network/client.hpp similarity index 100% rename from include/io/network/client.hpp rename to src/io/network/client.hpp diff --git a/include/io/network/epoll.hpp b/src/io/network/epoll.hpp similarity index 100% rename from include/io/network/epoll.hpp rename to src/io/network/epoll.hpp diff --git a/include/io/network/event_listener.hpp b/src/io/network/event_listener.hpp similarity index 100% rename from include/io/network/event_listener.hpp rename to src/io/network/event_listener.hpp diff --git a/include/io/network/network_error.hpp b/src/io/network/network_error.hpp similarity index 100% rename from include/io/network/network_error.hpp rename to src/io/network/network_error.hpp diff --git a/include/io/network/secure_socket.hpp b/src/io/network/secure_socket.hpp similarity index 100% rename from include/io/network/secure_socket.hpp rename to src/io/network/secure_socket.hpp diff --git a/include/io/network/secure_stream_reader.hpp b/src/io/network/secure_stream_reader.hpp similarity index 100% rename from include/io/network/secure_stream_reader.hpp rename to src/io/network/secure_stream_reader.hpp diff --git a/include/io/network/server.hpp b/src/io/network/server.hpp similarity index 100% rename from include/io/network/server.hpp rename to src/io/network/server.hpp diff --git a/include/io/network/socket.hpp b/src/io/network/socket.hpp similarity index 100% rename from include/io/network/socket.hpp rename to src/io/network/socket.hpp diff --git a/include/io/network/stream_listener.hpp b/src/io/network/stream_listener.hpp similarity index 100% rename from include/io/network/stream_listener.hpp rename to src/io/network/stream_listener.hpp diff --git a/include/io/network/stream_reader.hpp b/src/io/network/stream_reader.hpp similarity index 100% rename from include/io/network/stream_reader.hpp rename to src/io/network/stream_reader.hpp diff --git a/include/io/network/tcp/stream.hpp b/src/io/network/tcp/stream.hpp similarity index 100% rename from include/io/network/tcp/stream.hpp rename to src/io/network/tcp/stream.hpp diff --git a/include/io/network/tls.hpp b/src/io/network/tls.hpp similarity index 100% rename from include/io/network/tls.hpp rename to src/io/network/tls.hpp diff --git a/include/io/network/tls_error.hpp b/src/io/network/tls_error.hpp similarity index 100% rename from include/io/network/tls_error.hpp rename to src/io/network/tls_error.hpp diff --git a/src/io/uv/tcpstream.inl b/src/io/uv/tcpstream.inl deleted file mode 100644 index be1bc2169..000000000 --- a/src/io/uv/tcpstream.inl +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include "io/uv/tcpstream.hpp" - -namespace uv -{ - -TcpStream::TcpStream(UvLoop& loop) -{ - uv_tcp_init(loop, &stream); -} - -template -T* TcpStream::data() -{ - return reinterpret_cast(stream.data); -} - -template -void TcpStream::data(T* value) -{ - stream.data = reinterpret_cast(value); -} - -void TcpStream::close(callback_t callback) -{ - uv_close(reinterpret_cast(&stream), callback); -} - -TcpStream::operator uv_tcp_t*() -{ - return &stream; -} - -TcpStream::operator uv_stream_t*() -{ - return reinterpret_cast(&stream); -} - -TcpStream::operator uv_handle_t*() -{ - return reinterpret_cast(&stream); -} - -} diff --git a/src/io/uv/uvbuffer.inl b/src/io/uv/uvbuffer.inl deleted file mode 100644 index 7192e0b40..000000000 --- a/src/io/uv/uvbuffer.inl +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include -#include - -#include "io/uv/uvbuffer.hpp" - -namespace uv -{ - -UvBuffer::UvBuffer() - : capacity(0) -{ - buffer.len = 0; - buffer.base = nullptr; -} - -UvBuffer::UvBuffer(size_t capacity) - : capacity(capacity) -{ - buffer.len = 0; - buffer.base = static_cast(malloc(capacity)); -} - -UvBuffer::UvBuffer(const std::string& data) - : capacity(data.size()) -{ - buffer.len = data.size(); - buffer.base = static_cast(malloc(capacity)); - - std::memcpy(buffer.base, data.c_str(), buffer.len); -} - -UvBuffer::~UvBuffer() -{ - if(buffer.base == nullptr) - return; - - free(buffer.base); -} - -size_t UvBuffer::size() const noexcept -{ - return buffer.len; -} - -size_t UvBuffer::length() const noexcept -{ - return this->size(); -} - -void UvBuffer::clear() -{ - buffer.len = 0; -} - -UvBuffer& UvBuffer::append(const std::string& data) -{ - return this->append(data.c_str(), data.size()); -} - -UvBuffer& UvBuffer::append(const char* data, size_t n) -{ - auto new_size = size() + n; - - if(capacity < new_size) - { - capacity = new_size; - buffer.base = static_cast(realloc(buffer.base, new_size)); - } - - auto ptr = buffer.base + size(); - - for(size_t i = 0; i < n; ++i, ++ptr, ++data) - *ptr = *data; - - buffer.len = new_size; - - return *this; -} - -UvBuffer& UvBuffer::operator<<(const std::string& data) -{ - return this->append(data); -} - -UvBuffer::operator uv_buf_t*() -{ - return &buffer; -} - -} diff --git a/include/logging/default.hpp b/src/logging/default.hpp similarity index 100% rename from include/logging/default.hpp rename to src/logging/default.hpp diff --git a/include/logging/levels.hpp b/src/logging/levels.hpp similarity index 100% rename from include/logging/levels.hpp rename to src/logging/levels.hpp diff --git a/include/logging/log.hpp b/src/logging/log.hpp similarity index 100% rename from include/logging/log.hpp rename to src/logging/log.hpp diff --git a/include/logging/loggable.hpp b/src/logging/loggable.hpp similarity index 100% rename from include/logging/loggable.hpp rename to src/logging/loggable.hpp diff --git a/include/logging/logger.hpp b/src/logging/logger.hpp similarity index 100% rename from include/logging/logger.hpp rename to src/logging/logger.hpp diff --git a/include/logging/logs/async_log.hpp b/src/logging/logs/async_log.hpp similarity index 100% rename from include/logging/logs/async_log.hpp rename to src/logging/logs/async_log.hpp diff --git a/include/logging/logs/sync_log.hpp b/src/logging/logs/sync_log.hpp similarity index 100% rename from include/logging/logs/sync_log.hpp rename to src/logging/logs/sync_log.hpp diff --git a/include/logging/streams/format.hpp b/src/logging/streams/format.hpp similarity index 100% rename from include/logging/streams/format.hpp rename to src/logging/streams/format.hpp diff --git a/include/logging/streams/stderr.hpp b/src/logging/streams/stderr.hpp similarity index 100% rename from include/logging/streams/stderr.hpp rename to src/logging/streams/stderr.hpp diff --git a/include/logging/streams/stdout.hpp b/src/logging/streams/stdout.hpp similarity index 100% rename from include/logging/streams/stdout.hpp rename to src/logging/streams/stdout.hpp diff --git a/src/memgraph_http.cpp b/src/memgraph_http.cpp deleted file mode 100644 index 709e7e616..000000000 --- a/src/memgraph_http.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include - -#include "debug/log.hpp" -#include "utils/ioc/container.hpp" - -#include "database/graph_db.hpp" - -#include "api/resources/include.hpp" -#include "speedy/speedy.hpp" - -#include "threading/pool.hpp" -#include "threading/task.hpp" - -#include "utils/terminate_handler.hpp" - -int main(int argc, char *argv[]) -{ - if (argc < 2) { - std::cout << "Port not defined" << std::endl; - std::exit(0); - } - - auto port = std::stoi(argv[1]); - - std::set_terminate(&terminate_handler); - - ioc::Container container; - - container.singleton(); - - auto loop = container.singleton(); - - auto app = container.singleton("/db/data"); - container.singleton(); - - init(container); - - http::Ipv4 ip("0.0.0.0", port); - app->listen(ip); - - loop->run(uv::UvLoop::Mode::Default); - - return 0; -} diff --git a/include/memory/deferred_recycler.hpp b/src/memory/deferred_recycler.hpp similarity index 100% rename from include/memory/deferred_recycler.hpp rename to src/memory/deferred_recycler.hpp diff --git a/include/memory/freelist.hpp b/src/memory/freelist.hpp similarity index 100% rename from include/memory/freelist.hpp rename to src/memory/freelist.hpp diff --git a/include/memory/hp.hpp b/src/memory/hp.hpp similarity index 100% rename from include/memory/hp.hpp rename to src/memory/hp.hpp diff --git a/include/memory/lazy_gc.hpp b/src/memory/lazy_gc.hpp similarity index 100% rename from include/memory/lazy_gc.hpp rename to src/memory/lazy_gc.hpp diff --git a/include/memory/literals.hpp b/src/memory/literals.hpp similarity index 100% rename from include/memory/literals.hpp rename to src/memory/literals.hpp diff --git a/include/memory/memory.hpp b/src/memory/memory.hpp similarity index 100% rename from include/memory/memory.hpp rename to src/memory/memory.hpp diff --git a/include/memory/recycler.hpp b/src/memory/recycler.hpp similarity index 100% rename from include/memory/recycler.hpp rename to src/memory/recycler.hpp diff --git a/src/mvcc/atom.hpp b/src/mvcc/atom.hpp deleted file mode 100644 index 6349bc79c..000000000 --- a/src/mvcc/atom.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "mvcc/id.hpp" -#include "mvcc/version.hpp" -#include "threading/sync/lockable.hpp" -#include "transactions/transaction.hpp" - -namespace mvcc -{ - -// TODO: this can be deleted !! DEPRICATED !! - -template -class Atom : public Version, public Lockable -{ -public: - Atom(const Id &id, T *first) : Version(first), id(id) - { - // it's illegal that the first version is nullptr. there should be at - // least one version of a record - assert(first != nullptr); - } - - T *first() { return this->newer(); } - - // inspects the record change history and returns the record version visible - // to the current transaction if it exists, otherwise it returns nullptr - T *latest_visible(const tx::Transaction &t) - { - return first()->latest_visible(t); - } - - // every record has a unique id. 2^64 = 1.8 x 10^19. that should be enough - // for a looong time :) but keep in mind that some vacuuming would be nice - // to reuse indices for deleted nodes. - Id id; - - std::atomic *> next; -}; -} diff --git a/include/mvcc/cre_exp.hpp b/src/mvcc/cre_exp.hpp similarity index 100% rename from include/mvcc/cre_exp.hpp rename to src/mvcc/cre_exp.hpp diff --git a/include/mvcc/hints.hpp b/src/mvcc/hints.hpp similarity index 100% rename from include/mvcc/hints.hpp rename to src/mvcc/hints.hpp diff --git a/include/mvcc/id.hpp b/src/mvcc/id.hpp similarity index 100% rename from include/mvcc/id.hpp rename to src/mvcc/id.hpp diff --git a/include/mvcc/mvcc_error.hpp b/src/mvcc/mvcc_error.hpp similarity index 100% rename from include/mvcc/mvcc_error.hpp rename to src/mvcc/mvcc_error.hpp diff --git a/include/mvcc/record.hpp b/src/mvcc/record.hpp similarity index 100% rename from include/mvcc/record.hpp rename to src/mvcc/record.hpp diff --git a/include/mvcc/serialization_error.hpp b/src/mvcc/serialization_error.hpp similarity index 100% rename from include/mvcc/serialization_error.hpp rename to src/mvcc/serialization_error.hpp diff --git a/src/mvcc/store.hpp b/src/mvcc/store.hpp deleted file mode 100644 index 809720769..000000000 --- a/src/mvcc/store.hpp +++ /dev/null @@ -1,100 +0,0 @@ -#pragma once - -#include "transactions/transaction.hpp" -#include "mvcc/atom.hpp" -#include "mvcc/mvcc_error.hpp" - -#include "data_structures/list/lockfree_list.hpp" -#include "utils/counters/atomic_counter.hpp" - -// some interesting concepts described there, keep in mind for the future -// Serializable Isolation for Snapshot Databases, J. Cahill, et al. - -// TODO: remove if not in use !! DEPRICATED !! - -namespace mvcc -{ - -template -class MvccStore -{ - using list_t = lockfree::List>; - -public: - using read_iterator = typename list_t::read_iterator; - using read_write_iterator = typename list_t::read_write_iterator; - - MvccStore() : counter(0) {} - - read_iterator begin() - { - return data.begin(); - } - - read_write_iterator rw_begin() - { - return data.rw_begin(); - } - - Atom* insert(const tx::Transaction& t) - { - // create a first version of the record - auto record = new T(); - - // mark the record as created by the transaction t - record->mark_created(t); - - // create an Atom to put in the list - auto atom = new Atom(counter.next(), record); - - // put the atom with the record to the linked list - data.push_front(atom); - - return atom; - } - - T* update(Atom& atom, T& record, const tx::Transaction& t) - { - auto guard = atom.acquire(); - - // if xmax is not zero, that means there is a newer version of this - // record or it has been deleted. we cannot do anything here until - // we implement some more intelligent locking mechanisms - if(record.tx.max()) - throw MvccError("can't serialize due to concurrent operation(s)"); - - assert(atom.latest_visible(t) == &record); - assert(atom.latest_visible(t) == record.latest_visible(t)); - - // make a new version - auto updated = new T(); - *updated = *record; - - // mark the new version as created - updated->mark_created(t); - - // mark the current version as deleted - record.mark_deleted(t); - record.newer(updated); - - return updated; - } - - void remove(Atom& atom, T& record, const tx::Transaction& t) - { - auto guard = atom.acquire(); - - // if xmax is not zero, that means there is a newer version of this - // record or it has been deleted. we cannot do anything here - if(record.tx.max()) - throw MvccError("can't serialize due to concurrent operation(s)"); - - record.mark_deleted(t); - } - -private: - AtomicCounter counter; - lockfree::List> data; -}; - -} diff --git a/include/mvcc/version.hpp b/src/mvcc/version.hpp similarity index 100% rename from include/mvcc/version.hpp rename to src/mvcc/version.hpp diff --git a/include/mvcc/version_list.hpp b/src/mvcc/version_list.hpp similarity index 100% rename from include/mvcc/version_list.hpp rename to src/mvcc/version_list.hpp diff --git a/src/query/backend/cpp/generator.hpp b/src/query/backend/cpp/generator.hpp new file mode 100644 index 000000000..18557fb3f --- /dev/null +++ b/src/query/backend/cpp/generator.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include +namespace fs = std::experimental::filesystem; + +namespace backend { + +namespace cpp { + +/** + * Traverse AST and generate C++ + */ +class Generator { + public: + /** + * Generates cpp code inside file on the path. + * + * @tparam Ast type of AST structure + */ + template + void generate_plan(const Ast &ast, const std::string &query, + const uint64_t stripped_hash, const fs::path &path) { + throw std::runtime_error("TODO: implementation"); + } +}; +} +} diff --git a/src/query/engine.hpp b/src/query/engine.hpp new file mode 100644 index 000000000..59c300d4f --- /dev/null +++ b/src/query/engine.hpp @@ -0,0 +1,198 @@ +#pragma once + +#include +namespace fs = std::experimental::filesystem; + +#include "config/config.hpp" +#include "data_structures/concurrent/concurrent_map.hpp" +#include "database/graph_db.hpp" +#include "logging/loggable.hpp" +#include "query/exception/query_engine.hpp" +#include "query/frontend/opencypher/parser.hpp" +#include "query/backend/cpp/generator.hpp" +#include "query/plan_compiler.hpp" +#include "query/plan_interface.hpp" +#include "query/plan_generator.hpp" +#include "query/preprocessor.hpp" +#include "utils/dynamic_lib.hpp" + +/** + * Responsible for query execution. + * + * Current Query Engine arhitecture: + * query -> query_stripper -> [plan_generator] -> [plan_compiler] -> execution + * + * @tparam Stream the query engine has to be aware of the Stream because Stream + * is passed to the dynamic shared library because that is the way how + * the results should be returned (more optimal then just return + * the whole result set) + */ +template +class QueryEngine : public Loggable { + private: + using QueryPlanLib = DynamicLib>; + + public: + QueryEngine() : Loggable("QueryEngine") {} + + /** + * Reloads query plan (plan_path contains compiled query plan). + * This method just calculates stripped query and offloads everything else + * to the LoadCpp method. + * + * @param query a query for which the plan will be loaded + * @param plan_path a custom made cpp query plan + * + * @return void + */ + auto ReloadCustom(const std::string &query, const fs::path &plan_path) { + auto preprocessed = preprocessor.preprocess(query); + Unload(query); + LoadCpp(plan_path, preprocessed.hash); + } + + /** + * Executes query on the database with the stream. If a query plan is cached + * (based on query hash) it will be used. + * + * @param query a query that is going to be executed + * @param db database againt the query is going to be executed + * @param stream the resuts will be send to the stream + * + * @return query execution status: + * false if query wasn't executed successfully + * true if query execution was successfull + */ + auto Run(const std::string &query, GraphDbAccessor &db_accessor, + Stream &stream) { + try { + auto preprocessed = preprocessor.preprocess(query); + auto plan = LoadCypher(preprocessed); + auto result = plan->run(db_accessor, preprocessed.arguments, stream); + if (UNLIKELY(!result)) { + // info because it might be something like deadlock in which + // case one thread is stopped and user has try again + logger.info("Unable to execute query (execution returned false)"); + } + return result; + } catch (QueryEngineException &e) { + logger.error("QueryEngineException: {}", std::string(e.what())); + throw e; + } catch (std::exception &e) { + throw BasicException(e.what()); + } catch (...) { + throw BasicException("unknown query engine exception"); + } + } + + /** + * Unloads query plan and release the resources (should be automatically). + * + * @param query a query for which the query plan will be unloaded. + * + * return bool is the plan unloaded + */ + auto Unload(const std::string &query) { + return query_plans.access().remove(preprocessor.preprocess(query).hash); + } + + /** + * Checks is a plan for the query loaded. + * + * @param query for which a plan existance will be checked + * + * return bool + */ + auto Loaded(const std::string &query) { + auto plans_accessor = query_plans.access(); + return plans_accessor.find(preprocessor.preprocess(query).hash) != + plans_accessor.end(); + } + + /** + * The number of loaded query plans. + * + * @return size_t the number of loaded query plans + */ + auto Size() { // TODO: const once whan ConcurrentMap::Accessor becomes const + return query_plans.access().size(); + } + // return query_plans.access().size(); } + + private: + /** + * Loads query plan eather from hardcoded folder or from the file that is + * generated in this method. + * + * @param stripped a stripped query + * + * @return runnable query plan + */ + auto LoadCypher(const StrippedQuery &stripped) { + auto plans_accessor = query_plans.access(); + + // code is already compiled and loaded, just return runnable + // instance + auto query_plan_it = plans_accessor.find(stripped.hash); + if (query_plan_it != plans_accessor.end()) + return query_plan_it->second->instance(); + + // find hardcoded query plan if exists + auto hardcoded_path = fs::path(CONFIG(config::COMPILE_PATH) + "hardcode/" + + std::to_string(stripped.hash) + ".cpp"); + if (fs::exists(hardcoded_path)) + return LoadCpp(hardcoded_path, stripped.hash); + + // generate query plan + auto generated_path = fs::path(CONFIG(config::COMPILE_PATH) + + std::to_string(stripped.hash) + ".cpp"); + + plan_generator.generate_plan(stripped.query, stripped.hash, generated_path); + return LoadCpp(generated_path, stripped.hash); + } + + /** + * Load cpp query plan from a file. Or if plan is already cached from the + * cache. + * + * @param path_cpp a path to query plan + * @param hash query hash + * + * @return runnable query plan + */ + auto LoadCpp(const fs::path &path_cpp, const HashType hash) { + auto plans_accessor = query_plans.access(); + + // code is already compiled and loaded, just return runnable + // instance + auto query_plan_it = plans_accessor.find(hash); + if (query_plan_it != plans_accessor.end()) + return query_plan_it->second->instance(); + + // generate dynamic lib path + // The timestamp has been added here because dlopen + // uses path and returns the same handler for the same path + // and that is a problem because at this point we want brand new + // dynamic lib. That is the tmp solution. The right solution would be + // to deal with this problem in DynamicLib + auto path_so = CONFIG(config::COMPILE_PATH) + std::to_string(hash) + "_" + + (std::string)Timestamp::now() + ".so"; + + plan_compiler.compile(path_cpp, path_so); + + auto query_plan = std::make_unique(path_so); + // TODO: underlying object has to be live during query execution + // fix that when Antler will be introduced into the database + + auto query_plan_instance = query_plan->instance(); // because of move + plans_accessor.insert(hash, std::move(query_plan)); + + // return an instance of runnable code (PlanInterface) + return query_plan_instance; + } + + QueryPreprocessor preprocessor; + PlanCompiler plan_compiler; + PlanGenerator plan_generator; + ConcurrentMap> query_plans; +}; diff --git a/include/query/exception/cpp_code_generator.hpp b/src/query/exception/cpp_code_generator.hpp similarity index 100% rename from include/query/exception/cpp_code_generator.hpp rename to src/query/exception/cpp_code_generator.hpp diff --git a/include/query/exception/decoder_exception.hpp b/src/query/exception/decoder_exception.hpp similarity index 100% rename from include/query/exception/decoder_exception.hpp rename to src/query/exception/decoder_exception.hpp diff --git a/include/query/exception/plan_compilation.hpp b/src/query/exception/plan_compilation.hpp similarity index 100% rename from include/query/exception/plan_compilation.hpp rename to src/query/exception/plan_compilation.hpp diff --git a/include/query/exception/plan_execution.hpp b/src/query/exception/plan_execution.hpp similarity index 100% rename from include/query/exception/plan_execution.hpp rename to src/query/exception/plan_execution.hpp diff --git a/include/query/exception/query_engine.hpp b/src/query/exception/query_engine.hpp similarity index 100% rename from include/query/exception/query_engine.hpp rename to src/query/exception/query_engine.hpp diff --git a/src/query/frontend/opencypher/generated/Cypher.tokens b/src/query/frontend/opencypher/generated/Cypher.tokens new file mode 100644 index 000000000..befaa26c3 --- /dev/null +++ b/src/query/frontend/opencypher/generated/Cypher.tokens @@ -0,0 +1,164 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +T__28=29 +T__29=30 +T__30=31 +T__31=32 +T__32=33 +T__33=34 +T__34=35 +T__35=36 +T__36=37 +T__37=38 +T__38=39 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +T__44=45 +T__45=46 +T__46=47 +T__47=48 +T__48=49 +StringLiteral=50 +EscapedChar=51 +HexInteger=52 +DecimalInteger=53 +OctalInteger=54 +HexLetter=55 +HexDigit=56 +Digit=57 +NonZeroDigit=58 +NonZeroOctDigit=59 +OctDigit=60 +ZeroDigit=61 +ExponentDecimalReal=62 +RegularDecimalReal=63 +UNION=64 +ALL=65 +OPTIONAL=66 +MATCH=67 +UNWIND=68 +AS=69 +MERGE=70 +ON=71 +CREATE=72 +SET=73 +DETACH=74 +DELETE=75 +REMOVE=76 +WITH=77 +DISTINCT=78 +RETURN=79 +ORDER=80 +BY=81 +L_SKIP=82 +LIMIT=83 +ASCENDING=84 +ASC=85 +DESCENDING=86 +DESC=87 +WHERE=88 +OR=89 +XOR=90 +AND=91 +NOT=92 +IN=93 +STARTS=94 +ENDS=95 +CONTAINS=96 +IS=97 +CYPHERNULL=98 +COUNT=99 +FILTER=100 +EXTRACT=101 +ANY=102 +NONE=103 +SINGLE=104 +TRUE=105 +FALSE=106 +UnescapedSymbolicName=107 +IdentifierStart=108 +IdentifierPart=109 +EscapedSymbolicName=110 +SP=111 +WHITESPACE=112 +Comment=113 +L_0X=114 +';'=1 +','=2 +'='=3 +'+='=4 +'*'=5 +'('=6 +')'=7 +'['=8 +'?'=9 +']'=10 +':'=11 +'|'=12 +'..'=13 +'+'=14 +'-'=15 +'/'=16 +'%'=17 +'^'=18 +'=~'=19 +'<>'=20 +'!='=21 +'<'=22 +'>'=23 +'<='=24 +'>='=25 +'.'=26 +'!'=27 +'{'=28 +'}'=29 +'$'=30 +'⟨'=31 +'〈'=32 +'﹤'=33 +'<'=34 +'⟩'=35 +'〉'=36 +'﹥'=37 +'>'=38 +'­'=39 +'‐'=40 +'‑'=41 +'‒'=42 +'–'=43 +'—'=44 +'―'=45 +'−'=46 +'﹘'=47 +'﹣'=48 +'-'=49 +'0'=61 diff --git a/src/query/frontend/opencypher/generated/CypherBaseListener.cpp b/src/query/frontend/opencypher/generated/CypherBaseListener.cpp new file mode 100644 index 000000000..69698edef --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherBaseListener.cpp @@ -0,0 +1,9 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherBaseListener.h" + + +using namespace antlrcpptest; + diff --git a/src/query/frontend/opencypher/generated/CypherBaseListener.h b/src/query/frontend/opencypher/generated/CypherBaseListener.h new file mode 100644 index 000000000..a40bcf8ea --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherBaseListener.h @@ -0,0 +1,266 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" +#include "CypherListener.h" + + +namespace antlrcpptest { + +/** + * This class provides an empty implementation of CypherListener, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +class CypherBaseListener : public CypherListener { +public: + + virtual void enterCypher(CypherParser::CypherContext * /*ctx*/) override { } + virtual void exitCypher(CypherParser::CypherContext * /*ctx*/) override { } + + virtual void enterStatement(CypherParser::StatementContext * /*ctx*/) override { } + virtual void exitStatement(CypherParser::StatementContext * /*ctx*/) override { } + + virtual void enterQuery(CypherParser::QueryContext * /*ctx*/) override { } + virtual void exitQuery(CypherParser::QueryContext * /*ctx*/) override { } + + virtual void enterRegularQuery(CypherParser::RegularQueryContext * /*ctx*/) override { } + virtual void exitRegularQuery(CypherParser::RegularQueryContext * /*ctx*/) override { } + + virtual void enterSingleQuery(CypherParser::SingleQueryContext * /*ctx*/) override { } + virtual void exitSingleQuery(CypherParser::SingleQueryContext * /*ctx*/) override { } + + virtual void enterCypherUnion(CypherParser::CypherUnionContext * /*ctx*/) override { } + virtual void exitCypherUnion(CypherParser::CypherUnionContext * /*ctx*/) override { } + + virtual void enterClause(CypherParser::ClauseContext * /*ctx*/) override { } + virtual void exitClause(CypherParser::ClauseContext * /*ctx*/) override { } + + virtual void enterCypherMatch(CypherParser::CypherMatchContext * /*ctx*/) override { } + virtual void exitCypherMatch(CypherParser::CypherMatchContext * /*ctx*/) override { } + + virtual void enterUnwind(CypherParser::UnwindContext * /*ctx*/) override { } + virtual void exitUnwind(CypherParser::UnwindContext * /*ctx*/) override { } + + virtual void enterMerge(CypherParser::MergeContext * /*ctx*/) override { } + virtual void exitMerge(CypherParser::MergeContext * /*ctx*/) override { } + + virtual void enterMergeAction(CypherParser::MergeActionContext * /*ctx*/) override { } + virtual void exitMergeAction(CypherParser::MergeActionContext * /*ctx*/) override { } + + virtual void enterCreate(CypherParser::CreateContext * /*ctx*/) override { } + virtual void exitCreate(CypherParser::CreateContext * /*ctx*/) override { } + + virtual void enterSet(CypherParser::SetContext * /*ctx*/) override { } + virtual void exitSet(CypherParser::SetContext * /*ctx*/) override { } + + virtual void enterSetItem(CypherParser::SetItemContext * /*ctx*/) override { } + virtual void exitSetItem(CypherParser::SetItemContext * /*ctx*/) override { } + + virtual void enterCypherDelete(CypherParser::CypherDeleteContext * /*ctx*/) override { } + virtual void exitCypherDelete(CypherParser::CypherDeleteContext * /*ctx*/) override { } + + virtual void enterRemove(CypherParser::RemoveContext * /*ctx*/) override { } + virtual void exitRemove(CypherParser::RemoveContext * /*ctx*/) override { } + + virtual void enterRemoveItem(CypherParser::RemoveItemContext * /*ctx*/) override { } + virtual void exitRemoveItem(CypherParser::RemoveItemContext * /*ctx*/) override { } + + virtual void enterWith(CypherParser::WithContext * /*ctx*/) override { } + virtual void exitWith(CypherParser::WithContext * /*ctx*/) override { } + + virtual void enterCypherReturn(CypherParser::CypherReturnContext * /*ctx*/) override { } + virtual void exitCypherReturn(CypherParser::CypherReturnContext * /*ctx*/) override { } + + virtual void enterReturnBody(CypherParser::ReturnBodyContext * /*ctx*/) override { } + virtual void exitReturnBody(CypherParser::ReturnBodyContext * /*ctx*/) override { } + + virtual void enterReturnItems(CypherParser::ReturnItemsContext * /*ctx*/) override { } + virtual void exitReturnItems(CypherParser::ReturnItemsContext * /*ctx*/) override { } + + virtual void enterReturnItem(CypherParser::ReturnItemContext * /*ctx*/) override { } + virtual void exitReturnItem(CypherParser::ReturnItemContext * /*ctx*/) override { } + + virtual void enterOrder(CypherParser::OrderContext * /*ctx*/) override { } + virtual void exitOrder(CypherParser::OrderContext * /*ctx*/) override { } + + virtual void enterSkip(CypherParser::SkipContext * /*ctx*/) override { } + virtual void exitSkip(CypherParser::SkipContext * /*ctx*/) override { } + + virtual void enterLimit(CypherParser::LimitContext * /*ctx*/) override { } + virtual void exitLimit(CypherParser::LimitContext * /*ctx*/) override { } + + virtual void enterSortItem(CypherParser::SortItemContext * /*ctx*/) override { } + virtual void exitSortItem(CypherParser::SortItemContext * /*ctx*/) override { } + + virtual void enterWhere(CypherParser::WhereContext * /*ctx*/) override { } + virtual void exitWhere(CypherParser::WhereContext * /*ctx*/) override { } + + virtual void enterPattern(CypherParser::PatternContext * /*ctx*/) override { } + virtual void exitPattern(CypherParser::PatternContext * /*ctx*/) override { } + + virtual void enterPatternPart(CypherParser::PatternPartContext * /*ctx*/) override { } + virtual void exitPatternPart(CypherParser::PatternPartContext * /*ctx*/) override { } + + virtual void enterAnonymousPatternPart(CypherParser::AnonymousPatternPartContext * /*ctx*/) override { } + virtual void exitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext * /*ctx*/) override { } + + virtual void enterPatternElement(CypherParser::PatternElementContext * /*ctx*/) override { } + virtual void exitPatternElement(CypherParser::PatternElementContext * /*ctx*/) override { } + + virtual void enterNodePattern(CypherParser::NodePatternContext * /*ctx*/) override { } + virtual void exitNodePattern(CypherParser::NodePatternContext * /*ctx*/) override { } + + virtual void enterPatternElementChain(CypherParser::PatternElementChainContext * /*ctx*/) override { } + virtual void exitPatternElementChain(CypherParser::PatternElementChainContext * /*ctx*/) override { } + + virtual void enterRelationshipPattern(CypherParser::RelationshipPatternContext * /*ctx*/) override { } + virtual void exitRelationshipPattern(CypherParser::RelationshipPatternContext * /*ctx*/) override { } + + virtual void enterRelationshipDetail(CypherParser::RelationshipDetailContext * /*ctx*/) override { } + virtual void exitRelationshipDetail(CypherParser::RelationshipDetailContext * /*ctx*/) override { } + + virtual void enterProperties(CypherParser::PropertiesContext * /*ctx*/) override { } + virtual void exitProperties(CypherParser::PropertiesContext * /*ctx*/) override { } + + virtual void enterRelationshipTypes(CypherParser::RelationshipTypesContext * /*ctx*/) override { } + virtual void exitRelationshipTypes(CypherParser::RelationshipTypesContext * /*ctx*/) override { } + + virtual void enterNodeLabels(CypherParser::NodeLabelsContext * /*ctx*/) override { } + virtual void exitNodeLabels(CypherParser::NodeLabelsContext * /*ctx*/) override { } + + virtual void enterNodeLabel(CypherParser::NodeLabelContext * /*ctx*/) override { } + virtual void exitNodeLabel(CypherParser::NodeLabelContext * /*ctx*/) override { } + + virtual void enterRangeLiteral(CypherParser::RangeLiteralContext * /*ctx*/) override { } + virtual void exitRangeLiteral(CypherParser::RangeLiteralContext * /*ctx*/) override { } + + virtual void enterLabelName(CypherParser::LabelNameContext * /*ctx*/) override { } + virtual void exitLabelName(CypherParser::LabelNameContext * /*ctx*/) override { } + + virtual void enterRelTypeName(CypherParser::RelTypeNameContext * /*ctx*/) override { } + virtual void exitRelTypeName(CypherParser::RelTypeNameContext * /*ctx*/) override { } + + virtual void enterExpression(CypherParser::ExpressionContext * /*ctx*/) override { } + virtual void exitExpression(CypherParser::ExpressionContext * /*ctx*/) override { } + + virtual void enterExpression12(CypherParser::Expression12Context * /*ctx*/) override { } + virtual void exitExpression12(CypherParser::Expression12Context * /*ctx*/) override { } + + virtual void enterExpression11(CypherParser::Expression11Context * /*ctx*/) override { } + virtual void exitExpression11(CypherParser::Expression11Context * /*ctx*/) override { } + + virtual void enterExpression10(CypherParser::Expression10Context * /*ctx*/) override { } + virtual void exitExpression10(CypherParser::Expression10Context * /*ctx*/) override { } + + virtual void enterExpression9(CypherParser::Expression9Context * /*ctx*/) override { } + virtual void exitExpression9(CypherParser::Expression9Context * /*ctx*/) override { } + + virtual void enterExpression8(CypherParser::Expression8Context * /*ctx*/) override { } + virtual void exitExpression8(CypherParser::Expression8Context * /*ctx*/) override { } + + virtual void enterExpression7(CypherParser::Expression7Context * /*ctx*/) override { } + virtual void exitExpression7(CypherParser::Expression7Context * /*ctx*/) override { } + + virtual void enterExpression6(CypherParser::Expression6Context * /*ctx*/) override { } + virtual void exitExpression6(CypherParser::Expression6Context * /*ctx*/) override { } + + virtual void enterExpression5(CypherParser::Expression5Context * /*ctx*/) override { } + virtual void exitExpression5(CypherParser::Expression5Context * /*ctx*/) override { } + + virtual void enterExpression4(CypherParser::Expression4Context * /*ctx*/) override { } + virtual void exitExpression4(CypherParser::Expression4Context * /*ctx*/) override { } + + virtual void enterExpression3(CypherParser::Expression3Context * /*ctx*/) override { } + virtual void exitExpression3(CypherParser::Expression3Context * /*ctx*/) override { } + + virtual void enterExpression2(CypherParser::Expression2Context * /*ctx*/) override { } + virtual void exitExpression2(CypherParser::Expression2Context * /*ctx*/) override { } + + virtual void enterAtom(CypherParser::AtomContext * /*ctx*/) override { } + virtual void exitAtom(CypherParser::AtomContext * /*ctx*/) override { } + + virtual void enterLiteral(CypherParser::LiteralContext * /*ctx*/) override { } + virtual void exitLiteral(CypherParser::LiteralContext * /*ctx*/) override { } + + virtual void enterBooleanLiteral(CypherParser::BooleanLiteralContext * /*ctx*/) override { } + virtual void exitBooleanLiteral(CypherParser::BooleanLiteralContext * /*ctx*/) override { } + + virtual void enterListLiteral(CypherParser::ListLiteralContext * /*ctx*/) override { } + virtual void exitListLiteral(CypherParser::ListLiteralContext * /*ctx*/) override { } + + virtual void enterPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext * /*ctx*/) override { } + virtual void exitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext * /*ctx*/) override { } + + virtual void enterParenthesizedExpression(CypherParser::ParenthesizedExpressionContext * /*ctx*/) override { } + virtual void exitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext * /*ctx*/) override { } + + virtual void enterRelationshipsPattern(CypherParser::RelationshipsPatternContext * /*ctx*/) override { } + virtual void exitRelationshipsPattern(CypherParser::RelationshipsPatternContext * /*ctx*/) override { } + + virtual void enterFilterExpression(CypherParser::FilterExpressionContext * /*ctx*/) override { } + virtual void exitFilterExpression(CypherParser::FilterExpressionContext * /*ctx*/) override { } + + virtual void enterIdInColl(CypherParser::IdInCollContext * /*ctx*/) override { } + virtual void exitIdInColl(CypherParser::IdInCollContext * /*ctx*/) override { } + + virtual void enterFunctionInvocation(CypherParser::FunctionInvocationContext * /*ctx*/) override { } + virtual void exitFunctionInvocation(CypherParser::FunctionInvocationContext * /*ctx*/) override { } + + virtual void enterFunctionName(CypherParser::FunctionNameContext * /*ctx*/) override { } + virtual void exitFunctionName(CypherParser::FunctionNameContext * /*ctx*/) override { } + + virtual void enterListComprehension(CypherParser::ListComprehensionContext * /*ctx*/) override { } + virtual void exitListComprehension(CypherParser::ListComprehensionContext * /*ctx*/) override { } + + virtual void enterPropertyLookup(CypherParser::PropertyLookupContext * /*ctx*/) override { } + virtual void exitPropertyLookup(CypherParser::PropertyLookupContext * /*ctx*/) override { } + + virtual void enterVariable(CypherParser::VariableContext * /*ctx*/) override { } + virtual void exitVariable(CypherParser::VariableContext * /*ctx*/) override { } + + virtual void enterNumberLiteral(CypherParser::NumberLiteralContext * /*ctx*/) override { } + virtual void exitNumberLiteral(CypherParser::NumberLiteralContext * /*ctx*/) override { } + + virtual void enterMapLiteral(CypherParser::MapLiteralContext * /*ctx*/) override { } + virtual void exitMapLiteral(CypherParser::MapLiteralContext * /*ctx*/) override { } + + virtual void enterParameter(CypherParser::ParameterContext * /*ctx*/) override { } + virtual void exitParameter(CypherParser::ParameterContext * /*ctx*/) override { } + + virtual void enterPropertyExpression(CypherParser::PropertyExpressionContext * /*ctx*/) override { } + virtual void exitPropertyExpression(CypherParser::PropertyExpressionContext * /*ctx*/) override { } + + virtual void enterPropertyKeyName(CypherParser::PropertyKeyNameContext * /*ctx*/) override { } + virtual void exitPropertyKeyName(CypherParser::PropertyKeyNameContext * /*ctx*/) override { } + + virtual void enterIntegerLiteral(CypherParser::IntegerLiteralContext * /*ctx*/) override { } + virtual void exitIntegerLiteral(CypherParser::IntegerLiteralContext * /*ctx*/) override { } + + virtual void enterDoubleLiteral(CypherParser::DoubleLiteralContext * /*ctx*/) override { } + virtual void exitDoubleLiteral(CypherParser::DoubleLiteralContext * /*ctx*/) override { } + + virtual void enterSymbolicName(CypherParser::SymbolicNameContext * /*ctx*/) override { } + virtual void exitSymbolicName(CypherParser::SymbolicNameContext * /*ctx*/) override { } + + virtual void enterLeftArrowHead(CypherParser::LeftArrowHeadContext * /*ctx*/) override { } + virtual void exitLeftArrowHead(CypherParser::LeftArrowHeadContext * /*ctx*/) override { } + + virtual void enterRightArrowHead(CypherParser::RightArrowHeadContext * /*ctx*/) override { } + virtual void exitRightArrowHead(CypherParser::RightArrowHeadContext * /*ctx*/) override { } + + virtual void enterDash(CypherParser::DashContext * /*ctx*/) override { } + virtual void exitDash(CypherParser::DashContext * /*ctx*/) override { } + + + virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { } + virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { } + virtual void visitTerminal(antlr4::tree::TerminalNode * /*node*/) override { } + virtual void visitErrorNode(antlr4::tree::ErrorNode * /*node*/) override { } + +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/generated/CypherBaseVisitor.cpp b/src/query/frontend/opencypher/generated/CypherBaseVisitor.cpp new file mode 100644 index 000000000..f0de270b2 --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherBaseVisitor.cpp @@ -0,0 +1,9 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherBaseVisitor.h" + + +using namespace antlrcpptest; + diff --git a/src/query/frontend/opencypher/generated/CypherBaseVisitor.h b/src/query/frontend/opencypher/generated/CypherBaseVisitor.h new file mode 100644 index 000000000..b190de96a --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherBaseVisitor.h @@ -0,0 +1,339 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" +#include "CypherVisitor.h" + + +namespace antlrcpptest { + +/** + * This class provides an empty implementation of CypherVisitor, which can be + * extended to create a visitor which only needs to handle a subset of the available methods. + */ +class CypherBaseVisitor : public CypherVisitor { +public: + + virtual antlrcpp::Any visitCypher(CypherParser::CypherContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitStatement(CypherParser::StatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitQuery(CypherParser::QueryContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRegularQuery(CypherParser::RegularQueryContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSingleQuery(CypherParser::SingleQueryContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCypherUnion(CypherParser::CypherUnionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitClause(CypherParser::ClauseContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCypherMatch(CypherParser::CypherMatchContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitUnwind(CypherParser::UnwindContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitMerge(CypherParser::MergeContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitMergeAction(CypherParser::MergeActionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCreate(CypherParser::CreateContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSet(CypherParser::SetContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSetItem(CypherParser::SetItemContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCypherDelete(CypherParser::CypherDeleteContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRemove(CypherParser::RemoveContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRemoveItem(CypherParser::RemoveItemContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitWith(CypherParser::WithContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCypherReturn(CypherParser::CypherReturnContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitReturnBody(CypherParser::ReturnBodyContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitReturnItems(CypherParser::ReturnItemsContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitReturnItem(CypherParser::ReturnItemContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitOrder(CypherParser::OrderContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSkip(CypherParser::SkipContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLimit(CypherParser::LimitContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSortItem(CypherParser::SortItemContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitWhere(CypherParser::WhereContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPattern(CypherParser::PatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPatternPart(CypherParser::PatternPartContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPatternElement(CypherParser::PatternElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNodePattern(CypherParser::NodePatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPatternElementChain(CypherParser::PatternElementChainContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitProperties(CypherParser::PropertiesContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNodeLabel(CypherParser::NodeLabelContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRangeLiteral(CypherParser::RangeLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLabelName(CypherParser::LabelNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRelTypeName(CypherParser::RelTypeNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression(CypherParser::ExpressionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression12(CypherParser::Expression12Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression11(CypherParser::Expression11Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression10(CypherParser::Expression10Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression9(CypherParser::Expression9Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression8(CypherParser::Expression8Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression7(CypherParser::Expression7Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression6(CypherParser::Expression6Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression5(CypherParser::Expression5Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression4(CypherParser::Expression4Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression3(CypherParser::Expression3Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitExpression2(CypherParser::Expression2Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAtom(CypherParser::AtomContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLiteral(CypherParser::LiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitListLiteral(CypherParser::ListLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFilterExpression(CypherParser::FilterExpressionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitIdInColl(CypherParser::IdInCollContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFunctionName(CypherParser::FunctionNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitListComprehension(CypherParser::ListComprehensionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPropertyLookup(CypherParser::PropertyLookupContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVariable(CypherParser::VariableContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNumberLiteral(CypherParser::NumberLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitParameter(CypherParser::ParameterContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPropertyExpression(CypherParser::PropertyExpressionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSymbolicName(CypherParser::SymbolicNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRightArrowHead(CypherParser::RightArrowHeadContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitDash(CypherParser::DashContext *ctx) override { + return visitChildren(ctx); + } + + +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/generated/CypherLexer.cpp b/src/query/frontend/opencypher/generated/CypherLexer.cpp new file mode 100644 index 000000000..bc38e7c41 --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherLexer.cpp @@ -0,0 +1,934 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherLexer.h" + + +using namespace antlr4; + +using namespace antlrcpptest; + +CypherLexer::CypherLexer(CharStream *input) : Lexer(input) { + _interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); +} + +CypherLexer::~CypherLexer() { + delete _interpreter; +} + +std::string CypherLexer::getGrammarFileName() const { + return "Cypher.g4"; +} + +const std::vector& CypherLexer::getRuleNames() const { + return _ruleNames; +} + +const std::vector& CypherLexer::getModeNames() const { + return _modeNames; +} + +const std::vector& CypherLexer::getTokenNames() const { + return _tokenNames; +} + +dfa::Vocabulary& CypherLexer::getVocabulary() const { + return _vocabulary; +} + +const std::vector CypherLexer::getSerializedATN() const { + return _serializedATN; +} + +const atn::ATN& CypherLexer::getATN() const { + return _atn; +} + + + + +// Static vars and initialization. +std::vector CypherLexer::_decisionToDFA; +atn::PredictionContextCache CypherLexer::_sharedContextCache; + +// We own the ATN which in turn owns the ATN states. +atn::ATN CypherLexer::_atn; +std::vector CypherLexer::_serializedATN; + +std::vector CypherLexer::_ruleNames = { + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", + "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", + "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", + "T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32", + "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40", + "T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48", + "StringLiteral", "EscapedChar", "HexInteger", "DecimalInteger", "OctalInteger", + "HexLetter", "HexDigit", "Digit", "NonZeroDigit", "NonZeroOctDigit", "OctDigit", + "ZeroDigit", "ExponentDecimalReal", "RegularDecimalReal", "UNION", "ALL", + "OPTIONAL", "MATCH", "UNWIND", "AS", "MERGE", "ON", "CREATE", "SET", "DETACH", + "DELETE", "REMOVE", "WITH", "DISTINCT", "RETURN", "ORDER", "BY", "L_SKIP", + "LIMIT", "ASCENDING", "ASC", "DESCENDING", "DESC", "WHERE", "OR", "XOR", + "AND", "NOT", "IN", "STARTS", "ENDS", "CONTAINS", "IS", "CYPHERNULL", + "COUNT", "FILTER", "EXTRACT", "ANY", "NONE", "SINGLE", "TRUE", "FALSE", + "UnescapedSymbolicName", "IdentifierStart", "IdentifierPart", "EscapedSymbolicName", + "SP", "WHITESPACE", "Comment", "L_0X", "FF", "EscapedSymbolicName_0", + "RS", "ID_Continue", "Comment_1", "StringLiteral_1", "Comment_3", "Comment_2", + "GS", "FS", "CR", "Sc", "SPACE", "TAB", "StringLiteral_0", "LF", "VT", + "US", "ID_Start" +}; + +std::vector CypherLexer::_modeNames = { + "DEFAULT_MODE" +}; + +std::vector CypherLexer::_literalNames = { + "", "';'", "','", "'='", "'+='", "'*'", "'('", "')'", "'['", "'?'", "']'", + "':'", "'|'", "'..'", "'+'", "'-'", "'/'", "'%'", "'^'", "'=~'", "'<>'", + "'!='", "'<'", "'>'", "'<='", "'>='", "'.'", "'!'", "'{'", "'}'", "'$'", + "'⟨'", "'〈'", "'﹤'", "'<'", "'⟩'", "'〉'", "'﹥'", "'>'", "'­'", "'‐'", + "'‑'", "'‒'", "'–'", "'—'", "'―'", "'−'", "'﹘'", "'﹣'", "'-'", "", "", + "", "", "", "", "", "", "", "", "", "'0'" +}; + +std::vector CypherLexer::_symbolicNames = { + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "StringLiteral", + "EscapedChar", "HexInteger", "DecimalInteger", "OctalInteger", "HexLetter", + "HexDigit", "Digit", "NonZeroDigit", "NonZeroOctDigit", "OctDigit", "ZeroDigit", + "ExponentDecimalReal", "RegularDecimalReal", "UNION", "ALL", "OPTIONAL", + "MATCH", "UNWIND", "AS", "MERGE", "ON", "CREATE", "SET", "DETACH", "DELETE", + "REMOVE", "WITH", "DISTINCT", "RETURN", "ORDER", "BY", "L_SKIP", "LIMIT", + "ASCENDING", "ASC", "DESCENDING", "DESC", "WHERE", "OR", "XOR", "AND", + "NOT", "IN", "STARTS", "ENDS", "CONTAINS", "IS", "CYPHERNULL", "COUNT", + "FILTER", "EXTRACT", "ANY", "NONE", "SINGLE", "TRUE", "FALSE", "UnescapedSymbolicName", + "IdentifierStart", "IdentifierPart", "EscapedSymbolicName", "SP", "WHITESPACE", + "Comment", "L_0X" +}; + +dfa::Vocabulary CypherLexer::_vocabulary(_literalNames, _symbolicNames); + +std::vector CypherLexer::_tokenNames; + +CypherLexer::Initializer::Initializer() { + // This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there. + for (size_t i = 0; i < _symbolicNames.size(); ++i) { + std::string name = _vocabulary.getLiteralName(i); + if (name.empty()) { + name = _vocabulary.getSymbolicName(i); + } + + if (name.empty()) { + _tokenNames.push_back(""); + } else { + _tokenNames.push_back(name); + } + } + + _serializedATN = { + 0x3, 0x430, 0xd6d1, 0x8206, 0xad2d, 0x4417, 0xaef1, 0x8d80, 0xaadd, + 0x2, 0x74, 0x363, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, + 0x4, 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, + 0x9, 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, + 0x4, 0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe, + 0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, 0x9, 0x10, 0x4, 0x11, 0x9, + 0x11, 0x4, 0x12, 0x9, 0x12, 0x4, 0x13, 0x9, 0x13, 0x4, 0x14, 0x9, 0x14, + 0x4, 0x15, 0x9, 0x15, 0x4, 0x16, 0x9, 0x16, 0x4, 0x17, 0x9, 0x17, 0x4, + 0x18, 0x9, 0x18, 0x4, 0x19, 0x9, 0x19, 0x4, 0x1a, 0x9, 0x1a, 0x4, 0x1b, + 0x9, 0x1b, 0x4, 0x1c, 0x9, 0x1c, 0x4, 0x1d, 0x9, 0x1d, 0x4, 0x1e, 0x9, + 0x1e, 0x4, 0x1f, 0x9, 0x1f, 0x4, 0x20, 0x9, 0x20, 0x4, 0x21, 0x9,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x72, 0x5, 0x72, 0x333, 0xa, 0x72, 0x3, 0x72, 0x3, 0x72, + 0x5, 0x72, 0x337, 0xa, 0x72, 0x5, 0x72, 0x339, 0xa, 0x72, 0x3, 0x73, + 0x3, 0x73, 0x3, 0x73, 0x3, 0x74, 0x3, 0x74, 0x3, 0x75, 0x3, 0x75, 0x3, + 0x76, 0x3, 0x76, 0x3, 0x77, 0x3, 0x77, 0x3, 0x78, 0x3, 0x78, 0x3, 0x79, + 0x3, 0x79, 0x3, 0x7a, 0x3, 0x7a, 0x3, 0x7b, 0x3, 0x7b, 0x3, 0x7c, 0x3, + 0x7c, 0x3, 0x7d, 0x3, 0x7d, 0x3, 0x7e, 0x3, 0x7e, 0x3, 0x7f, 0x3, 0x7f, + 0x3, 0x80, 0x3, 0x80, 0x3, 0x81, 0x3, 0x81, 0x3, 0x82, 0x3, 0x82, 0x3, + 0x83, 0x3, 0x83, 0x3, 0x84, 0x3, 0x84, 0x3, 0x85, 0x3, 0x85, 0x3, 0x86, + 0x3, 0x86, 0x2, 0x2, 0x87, 0x3, 0x3, 0x5, 0x4, 0x7, 0x5, 0x9, 0x6, 0xb, + 0x7, 0xd, 0x8, 0xf, 0x9, 0x11, 0xa, 0x13, 0xb, 0x15, 0xc, 0x17, 0xd, + 0x19, 0xe, 0x1b, 0xf, 0x1d, 0x10, 0x1f, 0x11, 0x21, 0x12, 0x23, 0x13, + 0x25, 0x14, 0x27, 0x15, 0x29, 0x16, 0x2b, 0x17, 0x2d, 0x18, 0x2f, 0x19, + 0x31, 0x1a, 0x33, 0x1b, 0x35, 0x1c, 0x37, 0x1d, 0x39, 0x1e, 0x3b, 0x1f, + 0x3d, 0x20, 0x3f, 0x21, 0x41, 0x22, 0x43, 0x23, 0x45, 0x24, 0x47, 0x25, + 0x49, 0x26, 0x4b, 0x27, 0x4d, 0x28, 0x4f, 0x29, 0x51, 0x2a, 0x53, 0x2b, + 0x55, 0x2c, 0x57, 0x2d, 0x59, 0x2e, 0x5b, 0x2f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0x29, + 0x29, 0x44, 0x44, 0x48, 0x48, 0x50, 0x50, 0x54, 0x54, 0x56, 0x56, 0x5e, + 0x5e, 0x61, 0x61, 0x64, 0x64, 0x68, 0x68, 0x70, 0x70, 0x74, 0x74, 0x76, + 0x76, 0x4, 0x2, 0x57, 0x57, 0x77, 0x77, 0x4, 0x2, 0x43, 0x48, 0x63, + 0x68, 0x4, 0x2, 0x47, 0x47, 0x67, 0x67, 0x4, 0x2, 0x50, 0x50, 0x70, + 0x70, 0x4, 0x2, 0x4b, 0x4b, 0x6b, 0x6b, 0x4, 0x2, 0x51, 0x51, 0x71, + 0x71, 0x4, 0x2, 0x43, 0x43, 0x63, 0x63, 0x4, 0x2, 0x4e, 0x4e, 0x6e, + 0x6e, 0x4, 0x2, 0x52, 0x52, 0x72, 0x72, 0x4, 0x2, 0x56, 0x56, 0x76, + 0x76, 0x4, 0x2, 0x4f, 0x4f, 0x6f, 0x6f, 0x4, 0x2, 0x45, 0x45, 0x65, + 0x65, 0x4, 0x2, 0x4a, 0x4a, 0x6a, 0x6a, 0x4, 0x2, 0x59, 0x59, 0x79, + 0x79, 0x4, 0x2, 0x46, 0x46, 0x66, 0x66, 0x4, 0x2, 0x55, 0x55, 0x75, + 0x75, 0x4, 0x2, 0x54, 0x54, 0x74, 0x74, 0x4, 0x2, 0x49, 0x49, 0x69, + 0x69, 0x4, 0x2, 0x58, 0x58, 0x78, 0x78, 0x4, 0x2, 0x44, 0x44, 0x64, + 0x64, 0x4, 0x2, 0x5b, 0x5b, 0x7b, 0x7b, 0x4, 0x2, 0x4d, 0x4d, 0x6d, + 0x6d, 0x4, 0x2, 0x5a, 0x5a, 0x7a, 0x7a, 0x4, 0x2, 0x48, 0x48, 0x68, + 0x68, 0x8, 0x2, 0x61, 0x61, 0x2041, 0x2042, 0x2056, 0x2056, 0xfe35, + 0xfe36, 0xfe4f, 0xfe51, 0xff41, 0xff41, 0xa, 0x2, 0xa2, 0xa2, 0x1682, + 0x1682, 0x1810, 0x1810, 0x2002, 0x200c, 0x202a, 0x202b, 0x2031, 0x2031, + 0x2061, 0x2061, 0x3002, 0x3002, 0x3, 0x2, 0xe, 0xe, 0x4, 0x2, 0x2, 0x61, + 0x63, 0x1, 0x3, 0x2, 0x20, 0x20, 0x1af, 0x2, 0x32, 0x3b, 0x43, 0x5c, + 0x61, 0x61, 0x63, 0x7c, 0xac, 0xac, 0xb7, 0xb7, 0xb9, 0xb9, 0xbc, 0xbc, + 0xc2, 0xd8, 0xda, 0xf8, 0xfa, 0x2c3, 0x2c8, 0x2d3, 0x2e2, 0x2e6, 0x2ee, + 0x2ee, 0x2f0, 0x2f0, 0x302, 0x376, 0x378, 0x379, 0x37c, 0x37f, 0x388, + 0x38c, 0x38e, 0x38e, 0x390, 0x3a3, 0x3a5, 0x3f7, 0x3f9, 0x483, 0x485, + 0x489, 0x48c, 0x529, 0x533, 0x558, 0x55b, 0x55b, 0x563, 0x589, 0x593, + 0x5bf, 0x5c1, 0x5c1, 0x5c3, 0x5c4, 0x5c6, 0x5c7, 0x5c9, 0x5c9, 0x5d2, + 0x5ec, 0x5f2, 0x5f4, 0x612, 0x61c, 0x622, 0x66b, 0x670, 0x6d5, 0x6d7, + 0x6de, 0x6e1, 0x6ea, 0x6ec, 0x6fe, 0x701, 0x701, 0x712, 0x74c, 0x74f, + 0x7b3, 0x7c2, 0x7f7, 0x7fc, 0x7fc, 0x802, 0x82f, 0x842, 0x85d, 0x8a2, + 0x8a2, 0x8a4, 0x8ae, 0x8e6, 0x900, 0x902, 0x965, 0x968, 0x971, 0x973, + 0x979, 0x97b, 0x981, 0x983, 0x985, 0x987, 0x98e, 0x991, 0x992, 0x995, + 0x9aa, 0x9ac, 0x9b2, 0x9b4, 0x9b4, 0x9b8, 0x9bb, 0x9be, 0x9c6, 0x9c9, + 0x9ca, 0x9cd, 0x9d0, 0x9d9, 0x9d9, 0x9de, 0x9df, 0x9e1, 0x9e5, 0x9e8, + 0x9f3, 0xa03, 0xa05, 0xa07, 0xa0c, 0xa11, 0xa12, 0xa15, 0xa2a, 0xa2c, + 0xa32, 0xa34, 0xa35, 0xa37, 0xa38, 0xa3a, 0xa3b, 0xa3e, 0xa3e, 0xa40, + 0xa44, 0xa49, 0xa4a, 0xa4d, 0xa4f, 0xa53, 0xa53, 0xa5b, 0xa5e, 0xa60, + 0xa60, 0xa68, 0xa77, 0xa83, 0xa85, 0xa87, 0xa8f, 0xa91, 0xa93, 0xa95, + 0xaaa, 0xaac, 0xab2, 0xab4, 0xab5, 0xab7, 0xabb, 0xabe, 0xac7, 0xac9, + 0xacb, 0xacd, 0xacf, 0xad2, 0xad2, 0xae2, 0xae5, 0xae8, 0xaf1, 0xb03, + 0xb05, 0xb07, 0xb0e, 0xb11, 0xb12, 0xb15, 0xb2a, 0xb2c, 0xb32, 0xb34, + 0xb35, 0xb37, 0xb3b, 0xb3e, 0xb46, 0xb49, 0xb4a, 0xb4d, 0xb4f, 0xb58, + 0xb59, 0xb5e, 0xb5f, 0xb61, 0xb65, 0xb68, 0xb71, 0xb73, 0xb73, 0xb84, + 0xb85, 0xb87, 0xb8c, 0xb90, 0xb92, 0xb94, 0xb97, 0xb9b, 0xb9c, 0xb9e, + 0xb9e, 0xba0, 0xba1, 0xba5, 0xba6, 0xbaa, 0xbac, 0xbb0, 0xbbb, 0xbc0, + 0xbc4, 0xbc8, 0xbca, 0xbcc, 0xbcf, 0xbd2, 0xbd2, 0xbd9, 0xbd9, 0xbe8, + 0xbf1, 0xc03, 0xc05, 0xc07, 0xc0e, 0xc10, 0xc12, 0xc14, 0xc2a, 0xc2c, + 0xc35, 0xc37, 0xc3b, 0xc3f, 0xc46, 0xc48, 0xc4a, 0xc4c, 0xc4f, 0xc57, + 0xc58, 0xc5a, 0xc5b, 0xc62, 0xc65, 0xc68, 0xc71, 0xc84, 0xc85, 0xc87, + 0xc8e, 0xc90, 0xc92, 0xc94, 0xcaa, 0xcac, 0xcb5, 0xcb7, 0xcbb, 0xcbe, + 0xcc6, 0xcc8, 0xcca, 0xccc, 0xccf, 0xcd7, 0xcd8, 0xce0, 0xce0, 0xce2, + 0xce5, 0xce8, 0xcf1, 0xcf3, 0xcf4, 0xd04, 0xd05, 0xd07, 0xd0e, 0xd10, + 0xd12, 0xd14, 0xd3c, 0xd3f, 0xd46, 0xd48, 0xd4a, 0xd4c, 0xd50, 0xd59, + 0xd59, 0xd62, 0xd65, 0xd68, 0xd71, 0xd7c, 0xd81, 0xd84, 0xd85, 0xd87, + 0xd98, 0xd9c, 0xdb3, 0xdb5, 0xdbd, 0xdbf, 0xdbf, 0xdc2, 0xdc8, 0xdcc, + 0xdcc, 0xdd1, 0xdd6, 0xdd8, 0xdd8, 0xdda, 0xde1, 0xdf4, 0xdf5, 0xe03, + 0xe3c, 0xe42, 0xe50, 0xe52, 0xe5b, 0xe83, 0xe84, 0xe86, 0xe86, 0xe89, + 0xe8a, 0xe8c, 0xe8c, 0xe8f, 0xe8f, 0xe96, 0xe99, 0xe9b, 0xea1, 0xea3, + 0xea5, 0xea7, 0xea7, 0xea9, 0xea9, 0xeac, 0xead, 0xeaf, 0xebb, 0xebd, + 0xebf, 0xec2, 0xec6, 0xec8, 0xec8, 0xeca, 0xecf, 0xed2, 0xedb, 0xede, + 0xee1, 0xf02, 0xf02, 0xf1a, 0xf1b, 0xf22, 0xf2b, 0xf37, 0xf37, 0xf39, + 0xf39, 0xf3b, 0xf3b, 0xf40, 0xf49, 0xf4b, 0xf6e, 0xf73, 0xf86, 0xf88, + 0xf99, 0xf9b, 0xfbe, 0xfc8, 0xfc8, 0x1002, 0x104b, 0x1052, 0x109f, 0x10a2, + 0x10c7, 0x10c9, 0x10c9, 0x10cf, 0x10cf, 0x10d2, 0x10fc, 0x10fe, 0x124a, + 0x124c, 0x124f, 0x1252, 0x1258, 0x125a, 0x125a, 0x125c, 0x125f, 0x1262, + 0x128a, 0x128c, 0x128f, 0x1292, 0x12b2, 0x12b4, 0x12b7, 0x12ba, 0x12c0, + 0x12c2, 0x12c2, 0x12c4, 0x12c7, 0x12ca, 0x12d8, 0x12da, 0x1312, 0x1314, + 0x1317, 0x131a, 0x135c, 0x135f, 0x1361, 0x136b, 0x1373, 0x1382, 0x1391, + 0x13a2, 0x13f6, 0x1403, 0x166e, 0x1671, 0x1681, 0x1683, 0x169c, 0x16a2, + 0x16ec, 0x16f0, 0x16f2, 0x1702, 0x170e, 0x1710, 0x1716, 0x1722, 0x1736, + 0x1742, 0x1755, 0x1762, 0x176e, 0x1770, 0x1772, 0x1774, 0x1775, 0x1782, + 0x17d5, 0x17d9, 0x17d9, 0x17de, 0x17df, 0x17e2, 0x17eb, 0x180d, 0x180f, + 0x1812, 0x181b, 0x1822, 0x1879, 0x1882, 0x18ac, 0x18b2, 0x18f7, 0x1902, + 0x191e, 0x1922, 0x192d, 0x1932, 0x193d, 0x1948, 0x196f, 0x1972, 0x1976, + 0x1982, 0x19ad, 0x19b2, 0x19cb, 0x19d2, 0x19dc, 0x1a02, 0x1a1d, 0x1a22, + 0x1a60, 0x1a62, 0x1a7e, 0x1a81, 0x1a8b, 0x1a92, 0x1a9b, 0x1aa9, 0x1aa9, + 0x1b02, 0x1b4d, 0x1b52, 0x1b5b, 0x1b6d, 0x1b75, 0x1b82, 0x1bf5, 0x1c02, + 0x1c39, 0x1c42, 0x1c4b, 0x1c4f, 0x1c7f, 0x1cd2, 0x1cd4, 0x1cd6, 0x1cf8, + 0x1d02, 0x1de8, 0x1dfe, 0x1f17, 0x1f1a, 0x1f1f, 0x1f22, 0x1f47, 0x1f4a, + 0x1f4f, 0x1f52, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f5f, + 0x1f61, 0x1f7f, 0x1f82, 0x1fb6, 0x1fb8, 0x1fbe, 0x1fc0, 0x1fc0, 0x1fc4, + 0x1fc6, 0x1fc8, 0x1fce, 0x1fd2, 0x1fd5, 0x1fd8, 0x1fdd, 0x1fe2, 0x1fee, + 0x1ff4, 0x1ff6, 0x1ff8, 0x1ffe, 0x2041, 0x2042, 0x2056, 0x2056, 0x2073, + 0x2073, 0x2081, 0x2081, 0x2092, 0x209e, 0x20d2, 0x20de, 0x20e3, 0x20e3, + 0x20e7, 0x20f2, 0x2104, 0x2104, 0x2109, 0x2109, 0x210c, 0x2115, 0x2117, + 0x2117, 0x211a, 0x211f, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x212a, + 0x212c, 0x213b, 0x213e, 0x2141, 0x2147, 0x214b, 0x2150, 0x2150, 0x2162, + 0x218a, 0x2c02, 0x2c30, 0x2c32, 0x2c60, 0x2c62, 0x2ce6, 0x2ced, 0x2cf5, + 0x2d02, 0x2d27, 0x2d29, 0x2d29, 0x2d2f, 0x2d2f, 0x2d32, 0x2d69, 0x2d71, + 0x2d71, 0x2d81, 0x2d98, 0x2da2, 0x2da8, 0x2daa, 0x2db0, 0x2db2, 0x2db8, + 0x2dba, 0x2dc0, 0x2dc2, 0x2dc8, 0x2dca, 0x2dd0, 0x2dd2, 0x2dd8, 0x2dda, + 0x2de0, 0x2de2, 0x2e01, 0x3007, 0x3009, 0x3023, 0x3031, 0x3033, 0x3037, + 0x303a, 0x303e, 0x3043, 0x3098, 0x309b, 0x30a1, 0x30a3, 0x30fc, 0x30fe, + 0x3101, 0x3107, 0x312f, 0x3133, 0x3190, 0x31a2, 0x31bc, 0x31f2, 0x3201, + 0x3402, 0x4db7, 0x4e02, 0x9fce, 0xa002, 0xa48e, 0xa4d2, 0xa4ff, 0xa502, + 0xa60e, 0xa612, 0xa62d, 0xa642, 0xa671, 0xa676, 0xa67f, 0xa681, 0xa699, + 0xa6a1, 0xa6f3, 0xa719, 0xa721, 0xa724, 0xa78a, 0xa78d, 0xa790, 0xa792, + 0xa795, 0xa7a2, 0xa7ac, 0xa7fa, 0xa829, 0xa842, 0xa875, 0xa882, 0xa8c6, + 0xa8d2, 0xa8db, 0xa8e2, 0xa8f9, 0xa8fd, 0xa8fd, 0xa902, 0xa92f, 0xa932, + 0xa955, 0xa962, 0xa97e, 0xa982, 0xa9c2, 0xa9d1, 0xa9db, 0xaa02, 0xaa38, + 0xaa42, 0xaa4f, 0xaa52, 0xaa5b, 0xaa62, 0xaa78, 0xaa7c, 0xaa7d, 0xaa82, + 0xaac4, 0xaadd, 0xaadf, 0xaae2, 0xaaf1, 0xaaf4, 0xaaf8, 0xab03, 0xab08, + 0xab0b, 0xab10, 0xab13, 0xab18, 0xab22, 0xab28, 0xab2a, 0xab30, 0xabc2, + 0xabec, 0xabee, 0xabef, 0xabf2, 0xabfb, 0xac02, 0xd7a5, 0xd7b2, 0xd7c8, + 0xd7cd, 0xd7fd, 0xf902, 0xfa6f, 0xfa72, 0xfadb, 0xfb02, 0xfb08, 0xfb15, + 0xfb19, 0xfb1f, 0xfb2a, 0xfb2c, 0xfb38, 0xfb3a, 0xfb3e, 0xfb40, 0xfb40, + 0xfb42, 0xfb43, 0xfb45, 0xfb46, 0xfb48, 0xfbb3, 0xfbd5, 0xfd3f, 0xfd52, + 0xfd91, 0xfd94, 0xfdc9, 0xfdf2, 0xfdfd, 0xfe02, 0xfe11, 0xfe22, 0xfe28, + 0xfe35, 0xfe36, 0xfe4f, 0xfe51, 0xfe72, 0xfe76, 0xfe78, 0xfefe, 0xff12, + 0xff1b, 0xff23, 0xff3c, 0xff41, 0xff41, 0xff43, 0xff5c, 0xff68, 0xffc0, + 0xffc4, 0xffc9, 0xffcc, 0xffd1, 0xffd4, 0xffd9, 0xffdc, 0xffde, 0x4, + 0x2, 0x2, 0x2b, 0x2d, 0x1, 0x5, 0x2, 0x2, 0x28, 0x2a, 0x5d, 0x5f, 0x1, + 0x5, 0x2, 0x2, 0xb, 0xd, 0xe, 0x10, 0x1, 0x4, 0x2, 0x2, 0x30, 0x32, + 0x1, 0x3, 0x2, 0x1f, 0x1f, 0x3, 0x2, 0x1e, 0x1e, 0x3, 0x2, 0xf, 0xf, + 0x13, 0x2, 0x26, 0x26, 0xa4, 0xa7, 0x591, 0x591, 0x60d, 0x60d, 0x9f4, + 0x9f5, 0x9fd, 0x9fd, 0xaf3, 0xaf3, 0xbfb, 0xbfb, 0xe41, 0xe41, 0x17dd, + 0x17dd, 0x20a2, 0x20bc, 0xa83a, 0xa83a, 0xfdfe, 0xfdfe, 0xfe6b, 0xfe6b, + 0xff06, 0xff06, 0xffe2, 0xffe3, 0xffe7, 0xffe8, 0x3, 0x2, 0x22, 0x22, + 0x3, 0x2, 0xb, 0xb, 0x5, 0x2, 0x2, 0x23, 0x25, 0x5d, 0x5f, 0x1, 0x3, + 0x2, 0xc, 0xc, 0x3, 0x2, 0xd, 0xd, 0x3, 0x2, 0x21, 0x21, 0x174, 0x2, + 0x43, 0x5c, 0x63, 0x7c, 0xac, 0xac, 0xb7, 0xb7, 0xbc, 0xbc, 0xc2, 0xd8, + 0xda, 0xf8, 0xfa, 0x2c3, 0x2c8, 0x2d3, 0x2e2, 0x2e6, 0x2ee, 0x2ee, 0x2f0, + 0x2f0, 0x372, 0x376, 0x378, 0x379, 0x37c, 0x37f, 0x388, 0x388, 0x38a, + 0x38c, 0x38e, 0x38e, 0x390, 0x3a3, 0x3a5, 0x3f7, 0x3f9, 0x483, 0x48c, + 0x529, 0x533, 0x558, 0x55b, 0x55b, 0x563, 0x589, 0x5d2, 0x5ec, 0x5f2, + 0x5f4, 0x622, 0x64c, 0x670, 0x671, 0x673, 0x6d5, 0x6d7, 0x6d7, 0x6e7, + 0x6e8, 0x6f0, 0x6f1, 0x6fc, 0x6fe, 0x701, 0x701, 0x712, 0x712, 0x714, + 0x731, 0x74f, 0x7a7, 0x7b3, 0x7b3, 0x7cc, 0x7ec, 0x7f6, 0x7f7, 0x7fc, + 0x7fc, 0x802, 0x817, 0x81c, 0x81c, 0x826, 0x826, 0x82a, 0x82a, 0x842, + 0x85a, 0x8a2, 0x8a2, 0x8a4, 0x8ae, 0x906, 0x93b, 0x93f, 0x93f, 0x952, + 0x952, 0x95a, 0x963, 0x973, 0x979, 0x97b, 0x981, 0x987, 0x98e, 0x991, + 0x992, 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e03, 0xe32, 0xe34, + 0xe35, 0xe42, 0xe48, 0xe83, 0xe84, 0xe86, 0xe86, 0xe89, 0xe8a, 0xe8c, + 0xe8c, 0xe8f, 0xe8f, 0xe96, 0xe99, 0xe9b, 0xea1, 0xea3, 0xea5, 0xea7, + 0xea7, 0xea9, 0xea9, 0xeac, 0xead, 0xeaf, 0xeb2, 0xeb4, 0xeb5, 0xebf, + 0xebf, 0xec2, 0xec6, 0xec8, 0xec8, 0xede, 0xee1, 0xf02, 0xf02, 0xf42, + 0xf49, 0xf4b, 0xf6e, 0xf8a, 0xf8e, 0x1002, 0x102c, 0x1041, 0x1041, 0x1052, + 0x1057, 0x105c, 0x105f, 0x1063, 0x1063, 0x1067, 0x1068, 0x1070, 0x1072, + 0x1077, 0x1083, 0x1090, 0x1090, 0x10a2, 0x10c7, 0x10c9, 0x10c9, 0x10cf, + 0x10cf, 0x10d2, 0x10fc, 0x10fe, 0x124a, 0x124c, 0x124f, 0x1252, 0x1258, + 0x125a, 0x125a, 0x125c, 0x125f, 0x1262, 0x128a, 0x128c, 0x128f, 0x1292, + 0x12b2, 0x12b4, 0x12b7, 0x12ba, 0x12c0, 0x12c2, 0x12c2, 0x12c4, 0x12c7, + 0x12ca, 0x12d8, 0x12da, 0x1312, 0x1314, 0x1317, 0x131a, 0x135c, 0x1382, + 0x1391, 0x13a2, 0x13f6, 0x1403, 0x166e, 0x1671, 0x1681, 0x1683, 0x169c, + 0x16a2, 0x16ec, 0x16f0, 0x16f2, 0x1702, 0x170e, 0x1710, 0x1713, 0x1722, + 0x1733, 0x1742, 0x1753, 0x1762, 0x176e, 0x1770, 0x1772, 0x1782, 0x17b5, + 0x17d9, 0x17d9, 0x17de, 0x17de, 0x1822, 0x1879, 0x1882, 0x18aa, 0x18ac, + 0x18ac, 0x18b2, 0x18f7, 0x1902, 0x191e, 0x1952, 0x196f, 0x1972, 0x1976, + 0x1982, 0x19ad, 0x19c3, 0x19c9, 0x1a02, 0x1a18, 0x1a22, 0x1a56, 0x1aa9, + 0x1aa9, 0x1b07, 0x1b35, 0x1b47, 0x1b4d, 0x1b85, 0x1ba2, 0x1bb0, 0x1bb1, + 0x1bbc, 0x1be7, 0x1c02, 0x1c25, 0x1c4f, 0x1c51, 0x1c5c, 0x1c7f, 0x1ceb, + 0x1cee, 0x1cf0, 0x1cf3, 0x1cf7, 0x1cf8, 0x1d02, 0x1dc1, 0x1e02, 0x1f17, + 0x1f1a, 0x1f1f, 0x1f22, 0x1f47, 0x1f4a, 0x1f4f, 0x1f52, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f5f, 0x1f61, 0x1f7f, 0x1f82, 0x1fb6, + 0x1fb8, 0x1fbe, 0x1fc0, 0x1fc0, 0x1fc4, 0x1fc6, 0x1fc8, 0x1fce, 0x1fd2, + 0x1fd5, 0x1fd8, 0x1fdd, 0x1fe2, 0x1fee, 0x1ff4, 0x1ff6, 0x1ff8, 0x1ffe, + 0x2073, 0x2073, 0x2081, 0x2081, 0x2092, 0x209e, 0x2104, 0x2104, 0x2109, + 0x2109, 0x210c, 0x2115, 0x2117, 0x2117, 0x211a, 0x211f, 0x2126, 0x2126, + 0x2128, 0x2128, 0x212a, 0x212a, 0x212c, 0x213b, 0x213e, 0x2141, 0x2147, + 0x214b, 0x2150, 0x2150, 0x2162, 0x218a, 0x2c02, 0x2c30, 0x2c32, 0x2c60, + 0x2c62, 0x2ce6, 0x2ced, 0x2cf0, 0x2cf4, 0x2cf5, 0x2d02, 0x2d27, 0x2d29, + 0x2d29, 0x2d2f, 0x2d2f, 0x2d32, 0x2d69, 0x2d71, 0x2d71, 0x2d82, 0x2d98, + 0x2da2, 0x2da8, 0x2daa, 0x2db0, 0x2db2, 0x2db8, 0x2dba, 0x2dc0, 0x2dc2, + 0x2dc8, 0x2dca, 0x2dd0, 0x2dd2, 0x2dd8, 0x2dda, 0x2de0, 0x3007, 0x3009, + 0x3023, 0x302b, 0x3033, 0x3037, 0x303a, 0x303e, 0x3043, 0x3098, 0x309d, + 0x30a1, 0x30a3, 0x30fc, 0x30fe, 0x3101, 0x3107, 0x312f, 0x3133, 0x3190, + 0x31a2, 0x31bc, 0x31f2, 0x3201, 0x3402, 0x4db7, 0x4e02, 0x9fce, 0xa002, + 0xa48e, 0xa4d2, 0xa4ff, 0xa502, 0xa60e, 0xa612, 0xa621, 0xa62c, 0xa62d, + 0xa642, 0xa670, 0xa681, 0xa699, 0xa6a2, 0xa6f1, 0xa719, 0xa721, 0xa724, + 0xa78a, 0xa78d, 0xa790, 0xa792, 0xa795, 0xa7a2, 0xa7ac, 0xa7fa, 0xa803, + 0xa805, 0xa807, 0xa809, 0xa80c, 0xa80e, 0xa824, 0xa842, 0xa875, 0xa884, + 0xa8b5, 0xa8f4, 0xa8f9, 0xa8fd, 0xa8fd, 0xa90c, 0xa927, 0xa932, 0xa948, + 0xa962, 0xa97e, 0xa986, 0xa9b4, 0xa9d1, 0xa9d1, 0xaa02, 0xaa2a, 0xaa42, + 0xaa44, 0xaa46, 0xaa4d, 0xaa62, 0xaa78, 0xaa7c, 0xaa7c, 0xaa82, 0xaab1, + 0xaab3, 0xaab3, 0xaab7, 0xaab8, 0xaabb, 0xaabf, 0xaac2, 0xaac2, 0xaac4, + 0xaac4, 0xaadd, 0xaadf, 0xaae2, 0xaaec, 0xaaf4, 0xaaf6, 0xab03, 0xab08, + 0xab0b, 0xab10, 0xab13, 0xab18, 0xab22, 0xab28, 0xab2a, 0xab30, 0xabc2, + 0xabe4, 0xac02, 0xd7a5, 0xd7b2, 0xd7c8, 0xd7cd, 0xd7fd, 0xf902, 0xfa6f, + 0xfa72, 0xfadb, 0xfb02, 0xfb08, 0xfb15, 0xfb19, 0xfb1f, 0xfb1f, 0xfb21, + 0xfb2a, 0xfb2c, 0xfb38, 0xfb3a, 0xfb3e, 0xfb40, 0xfb40, 0xfb42, 0xfb43, + 0xfb45, 0xfb46, 0xfb48, 0xfbb3, 0xfbd5, 0xfd3f, 0xfd52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x2, 0x2, + 0x2, 0x116, 0x117, 0x7, 0x2c, 0x2, 0x2, 0x117, 0xc, 0x3, 0x2, 0x2, 0x2, + 0x118, 0x119, 0x7, 0x2a, 0x2, 0x2, 0x119, 0xe, 0x3, 0x2, 0x2, 0x2, 0x11a, + 0x11b, 0x7, 0x2b, 0x2, 0x2, 0x11b, 0x10, 0x3, 0x2, 0x2, 0x2, 0x11c, + 0x11d, 0x7, 0x5d, 0x2, 0x2, 0x11d, 0x12, 0x3, 0x2, 0x2, 0x2, 0x11e, + 0x11f, 0x7, 0x41, 0x2, 0x2, 0x11f, 0x14, 0x3, 0x2, 0x2, 0x2, 0x120, + 0x121, 0x7, 0x5f, 0x2, 0x2, 0x121, 0x16, 0x3, 0x2, 0x2, 0x2, 0x122, + 0x123, 0x7, 0x3c, 0x2, 0x2, 0x123, 0x18, 0x3, 0x2, 0x2, 0x2, 0x124, + 0x125, 0x7, 0x7e, 0x2, 0x2, 0x125, 0x1a, 0x3, 0x2, 0x2, 0x2, 0x126, + 0x127, 0x7, 0x30, 0x2, 0x2, 0x127, 0x128, 0x7, 0x30, 0x2, 0x2, 0x128, + 0x1c, 0x3, 0x2, 0x2, 0x2, 0x129, 0x12a, 0x7, 0x2d, 0x2, 0x2, 0x12a, + 0x1e, 0x3, 0x2, 0x2, 0x2, 0x12b, 0x12c, 0x7, 0x2f, 0x2, 0x2, 0x12c, + 0x20, 0x3, 0x2, 0x2, 0x2, 0x12d, 0x12e, 0x7, 0x31, 0x2, 0x2, 0x12e, + 0x22, 0x3, 0x2, 0x2, 0x2, 0x12f, 0x130, 0x7, 0x27, 0x2, 0x2, 0x130, + 0x24, 0x3, 0x2, 0x2, 0x2, 0x131, 0x132, 0x7, 0x60, 0x2, 0x2, 0x132, + 0x26, 0x3, 0x2, 0x2, 0x2, 0x133, 0x134, 0x7, 0x3f, 0x2, 0x2, 0x134, + 0x135, 0x7, 0x80, 0x2, 0x2, 0x135, 0x28, 0x3, 0x2, 0x2, 0x2, 0x136, + 0x137, 0x7, 0x3e, 0x2, 0x2, 0x137, 0x138, 0x7, 0x40, 0x2, 0x2, 0x138, + 0x2a, 0x3, 0x2, 0x2, 0x2, 0x139, 0x13a, 0x7, 0x23, 0x2, 0x2, 0x13a, + 0x13b, 0x7, 0x3f, 0x2, 0x2, 0x13b, 0x2c, 0x3, 0x2, 0x2, 0x2, 0x13c, + 0x13d, 0x7, 0x3e, 0x2, 0x2, 0x13d, 0x2e, 0x3, 0x2, 0x2, 0x2, 0x13e, + 0x13f, 0x7, 0x40, 0x2, 0x2, 0x13f, 0x30, 0x3, 0x2, 0x2, 0x2, 0x140, + 0x141, 0x7, 0x3e, 0x2, 0x2, 0x141, 0x142, 0x7, 0x3f, 0x2, 0x2, 0x142, + 0x32, 0x3, 0x2, 0x2, 0x2, 0x143, 0x144, 0x7, 0x40, 0x2, 0x2, 0x144, + 0x145, 0x7, 0x3f, 0x2, 0x2, 0x145, 0x34, 0x3, 0x2, 0x2, 0x2, 0x146, + 0x147, 0x7, 0x30, 0x2, 0x2, 0x147, 0x36, 0x3, 0x2, 0x2, 0x2, 0x148, + 0x149, 0x7, 0x23, 0x2, 0x2, 0x149, 0x38, 0x3, 0x2, 0x2, 0x2, 0x14a, + 0x14b, 0x7, 0x7d, 0x2, 0x2, 0x14b, 0x3a, 0x3, 0x2, 0x2, 0x2, 0x14c, + 0x14d, 0x7, 0x7f, 0x2, 0x2, 0x14d, 0x3c, 0x3, 0x2, 0x2, 0x2, 0x14e, + 0x14f, 0x7, 0x26, 0x2, 0x2, 0x14f, 0x3e, 0x3, 0x2, 0x2, 0x2, 0x150, + 0x151, 0x7, 0x27ea, 0x2, 0x2, 0x151, 0x40, 0x3, 0x2, 0x2, 0x2, 0x152, + 0x153, 0x7, 0x300a, 0x2, 0x2, 0x153, 0x42, 0x3, 0x2, 0x2, 0x2, 0x154, + 0x155, 0x7, 0xfe66, 0x2, 0x2, 0x155, 0x44, 0x3, 0x2, 0x2, 0x2, 0x156, + 0x157, 0x7, 0xff1e, 0x2, 0x2, 0x157, 0x46, 0x3, 0x2, 0x2, 0x2, 0x158, + 0x159, 0x7, 0x27eb, 0x2, 0x2, 0x159, 0x48, 0x3, 0x2, 0x2, 0x2, 0x15a, + 0x15b, 0x7, 0x300b, 0x2, 0x2, 0x15b, 0x4a, 0x3, 0x2, 0x2, 0x2, 0x15c, + 0x15d, 0x7, 0xfe67, 0x2, 0x2, 0x15d, 0x4c, 0x3, 0x2, 0x2, 0x2, 0x15e, + 0x15f, 0x7, 0xff20, 0x2, 0x2, 0x15f, 0x4e, 0x3, 0x2, 0x2, 0x2, 0x160, + 0x161, 0x7, 0xaf, 0x2, 0x2, 0x161, 0x50, 0x3, 0x2, 0x2, 0x2, 0x162, + 0x163, 0x7, 0x2012, 0x2, 0x2, 0x163, 0x52, 0x3, 0x2, 0x2, 0x2, 0x164, + 0x165, 0x7, 0x2013, 0x2, 0x2, 0x165, 0x54, 0x3, 0x2, 0x2, 0x2, 0x166, + 0x167, 0x7, 0x2014, 0x2, 0x2, 0x167, 0x56, 0x3, 0x2, 0x2, 0x2, 0x168, + 0x169, 0x7, 0x2015, 0x2, 0x2, 0x169, 0x58, 0x3, 0x2, 0x2, 0x2, 0x16a, + 0x16b, 0x7, 0x2016, 0x2, 0x2, 0x16b, 0x5a, 0x3, 0x2, 0x2, 0x2, 0x16c, + 0x16d, 0x7, 0x2017, 0x2, 0x2, 0x16d, 0x5c, 0x3, 0x2, 0x2, 0x2, 0x16e, + 0x16f, 0x7, 0x2214, 0x2, 0x2, 0x16f, 0x5e, 0x3, 0x2, 0x2, 0x2, 0x170, + 0x171, 0x7, 0xfe5a, 0x2, 0x2, 0x171, 0x60, 0x3, 0x2, 0x2, 0x2, 0x172, + 0x173, 0x7, 0xfe65, 0x2, 0x2, 0x173, 0x62, 0x3, 0x2, 0x2, 0x2, 0x174, + 0x175, 0x7, 0xff0f, 0x2, 0x2, 0x175, 0x64, 0x3, 0x2, 0x2, 0x2, 0x176, + 0x17b, 0x7, 0x24, 0x2, 0x2, 0x177, 0x17a, 0x5, 0x103, 0x82, 0x2, 0x178, + 0x17a, 0x5, 0x67, 0x34, 0x2, 0x179, 0x177, 0x3, 0x2, 0x2, 0x2, 0x179, + 0x178, 0x3, 0x2, 0x2, 0x2, 0x17a, 0x17d, 0x3, 0x2, 0x2, 0x2, 0x17b, + 0x179, 0x3, 0x2, 0x2, 0x2, 0x17b, 0x17c, 0x3, 0x2, 0x2, 0x2, 0x17c, + 0x17e, 0x3, 0x2, 0x2, 0x2, 0x17d, 0x17b, 0x3, 0x2, 0x2, 0x2, 0x17e, + 0x189, 0x7, 0x24, 0x2, 0x2, 0x17f, 0x184, 0x7, 0x29, 0x2, 0x2, 0x180, + 0x183, 0x5, 0xf1, 0x79, 0x2, 0x181, 0x183, 0x5, 0x67, 0x34, 0x2, 0x182, + 0x180, 0x3, 0x2, 0x2, 0x2, 0x182, 0x181, 0x3, 0x2, 0x2, 0x2, 0x183, + 0x186, 0x3, 0x2, 0x2, 0x2, 0x184, 0x182, 0x3, 0x2, 0x2, 0x2, 0x184, + 0x185, 0x3, 0x2, 0x2, 0x2, 0x185, 0x187, 0x3, 0x2, 0x2, 0x2, 0x186, + 0x184, 0x3, 0x2, 0x2, 0x2, 0x187, 0x189, 0x7, 0x29, 0x2, 0x2, 0x188, + 0x176, 0x3, 0x2, 0x2, 0x2, 0x188, 0x17f, 0x3, 0x2, 0x2, 0x2, 0x189, + 0x66, 0x3, 0x2, 0x2, 0x2, 0x18a, 0x19c, 0x7, 0x5e, 0x2, 0x2, 0x18b, + 0x19d, 0x9, 0x2, 0x2, 0x2, 0x18c, 0x18d, 0x9, 0x3, 0x2, 0x2, 0x18d, + 0x18e, 0x5, 0x71, 0x39, 0x2, 0x18e, 0x18f, 0x5, 0x71, 0x39, 0x2, 0x18f, + 0x190, 0x5, 0x71, 0x39, 0x2, 0x190, 0x191, 0x5, 0x71, 0x39, 0x2, 0x191, + 0x19d, 0x3, 0x2, 0x2, 0x2, 0x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x9, 0x7, 0x2, 0x2, + 0x217, 0x218, 0x9, 0x6, 0x2, 0x2, 0x218, 0x219, 0x9, 0x11, 0x2, 0x2, + 0x219, 0x8a, 0x3, 0x2, 0x2, 0x2, 0x21a, 0x21b, 0x9, 0x9, 0x2, 0x2, 0x21b, + 0x21c, 0x9, 0x12, 0x2, 0x2, 0x21c, 0x8c, 0x3, 0x2, 0x2, 0x2, 0x21d, + 0x21e, 0x9, 0xd, 0x2, 0x2, 0x21e, 0x21f, 0x9, 0x5, 0x2, 0x2, 0x21f, + 0x220, 0x9, 0x13, 0x2, 0x2, 0x220, 0x221, 0x9, 0x14, 0x2, 0x2, 0x221, + 0x222, 0x9, 0x5, 0x2, 0x2, 0x222, 0x8e, 0x3, 0x2, 0x2, 0x2, 0x223, 0x224, + 0x9, 0x8, 0x2, 0x2, 0x224, 0x225, 0x9, 0x6, 0x2, 0x2, 0x225, 0x90, 0x3, + 0x2, 0x2, 0x2, 0x226, 0x227, 0x9, 0xe, 0x2, 0x2, 0x227, 0x228, 0x9, + 0x13, 0x2, 0x2, 0x228, 0x229, 0x9, 0x5, 0x2, 0x2, 0x229, 0x22a, 0x9, + 0x9, 0x2, 0x2, 0x22a, 0x22b, 0x9, 0xc, 0x2, 0x2, 0x22b, 0x22c, 0x9, + 0x5, 0x2, 0x2, 0x22c, 0x92, 0x3, 0x2, 0x2, 0x2, 0x22d, 0x22e, 0x9, 0x12, + 0x2, 0x2, 0x22e, 0x22f, 0x9, 0x5, 0x2, 0x2, 0x22f, 0x230, 0x9, 0xc, + 0x2, 0x2, 0x230, 0x94, 0x3, 0x2, 0x2, 0x2, 0x231, 0x232, 0x9, 0x11, + 0x2, 0x2, 0x232, 0x233, 0x9, 0x5, 0x2, 0x2, 0x233, 0x234, 0x9, 0xc, + 0x2, 0x2, 0x234, 0x235, 0x9, 0x9, 0x2, 0x2, 0x235, 0x236, 0x9, 0xe, + 0x2, 0x2, 0x236, 0x237, 0x9, 0xf, 0x2, 0x2, 0x237, 0x96, 0x3, 0x2, 0x2, + 0x2, 0x238, 0x239, 0x9, 0x11, 0x2, 0x2, 0x239, 0x23a, 0x9, 0x5, 0x2, + 0x2, 0x23a, 0x23b, 0x9, 0xa, 0x2, 0x2, 0x23b, 0x23c, 0x9, 0x5, 0x2, + 0x2, 0x23c, 0x23d, 0x9, 0xc, 0x2, 0x2, 0x23d, 0x23e, 0x9, 0x5, 0x2, + 0x2, 0x23e, 0x98, 0x3, 0x2, 0x2, 0x2, 0x23f, 0x240, 0x9, 0x13, 0x2, + 0x2, 0x240, 0x241, 0x9, 0x5, 0x2, 0x2, 0x241, 0x242, 0x9, 0xd, 0x2, + 0x2, 0x242, 0x243, 0x9, 0x8, 0x2, 0x2, 0x243, 0x244, 0x9, 0x15, 0x2, + 0x2, 0x244, 0x245, 0x9, 0x5, 0x2, 0x2, 0x245, 0x9a, 0x3, 0x2, 0x2, 0x2, + 0x246, 0x247, 0x9, 0x10, 0x2, 0x2, 0x247, 0x248, 0x9, 0x7, 0x2, 0x2, + 0x248, 0x249, 0x9, 0xc, 0x2, 0x2, 0x249, 0x24a, 0x9, 0xf, 0x2, 0x2, + 0x24a, 0x9c, 0x3, 0x2, 0x2, 0x2, 0x24b, 0x24c, 0x9, 0x11, 0x2, 0x2, + 0x24c, 0x24d, 0x9, 0x7, 0x2, 0x2, 0x24d, 0x24e, 0x9, 0x12, 0x2, 0x2, + 0x24e, 0x24f, 0x9, 0xc, 0x2, 0x2, 0x24f, 0x250, 0x9, 0x7, 0x2, 0x2, + 0x250, 0x251, 0x9, 0x6, 0x2, 0x2, 0x251, 0x252, 0x9, 0xe, 0x2, 0x2, + 0x252, 0x253, 0x9, 0xc, 0x2, 0x2, 0x253, 0x9e, 0x3, 0x2, 0x2, 0x2, 0x254, + 0x255, 0x9, 0x13, 0x2, 0x2, 0x255, 0x256, 0x9, 0x5, 0x2, 0x2, 0x256, + 0x257, 0x9, 0xc, 0x2, 0x2, 0x257, 0x258, 0x9, 0x3, 0x2, 0x2, 0x258, + 0x259, 0x9, 0x13, 0x2, 0x2, 0x259, 0x25a, 0x9, 0x6, 0x2, 0x2, 0x25a, + 0xa0, 0x3, 0x2, 0x2, 0x2, 0x25b, 0x25c, 0x9, 0x8, 0x2, 0x2, 0x25c, 0x25d, + 0x9, 0x13, 0x2, 0x2, 0x25d, 0x25e, 0x9, 0x11, 0x2, 0x2, 0x25e, 0x25f, + 0x9, 0x5, 0x2, 0x2, 0x25f, 0x260, 0x9, 0x13, 0x2, 0x2, 0x260, 0xa2, + 0x3, 0x2, 0x2, 0x2, 0x261, 0x262, 0x9, 0x16, 0x2, 0x2, 0x262, 0x263, + 0x9, 0x17, 0x2, 0x2, 0x263, 0xa4, 0x3, 0x2, 0x2, 0x2, 0x264, 0x265, + 0x9, 0x12, 0x2, 0x2, 0x265, 0x266, 0x9, 0x18, 0x2, 0x2, 0x266, 0x267, + 0x9, 0x7, 0x2, 0x2, 0x267, 0x268, 0x9, 0xb, 0x2, 0x2, 0x268, 0xa6, 0x3, + 0x2, 0x2, 0x2, 0x269, 0x26a, 0x9, 0xa, 0x2, 0x2, 0x26a, 0x26b, 0x9, + 0x7, 0x2, 0x2, 0x26b, 0x26c, 0x9, 0xd, 0x2, 0x2, 0x26c, 0x26d, 0x9, + 0x7, 0x2, 0x2, 0x26d, 0x26e, 0x9, 0xc, 0x2, 0x2, 0x26e, 0xa8, 0x3, 0x2, + 0x2, 0x2, 0x26f, 0x270, 0x9, 0x9, 0x2, 0x2, 0x270, 0x271, 0x9, 0x12, + 0x2, 0x2, 0x271, 0x272, 0x9, 0xe, 0x2, 0x2, 0x272, 0x273, 0x9, 0x5, + 0x2, 0x2, 0x273, 0x274, 0x9, 0x6, 0x2, 0x2, 0x274, 0x275, 0x9, 0x11, + 0x2, 0x2, 0x275, 0x276, 0x9, 0x7, 0x2, 0x2, 0x276, 0x277, 0x9, 0x6, + 0x2, 0x2, 0x277, 0x278, 0x9, 0x14, 0x2, 0x2, 0x278, 0xaa, 0x3, 0x2, + 0x2, 0x2, 0x279, 0x27a, 0x9, 0x9, 0x2, 0x2, 0x27a, 0x27b, 0x9, 0x12, + 0x2, 0x2, 0x27b, 0x27c, 0x9, 0xe, 0x2, 0x2, 0x27c, 0xac, 0x3, 0x2, 0x2, + 0x2, 0x27d, 0x27e, 0x9, 0x11, 0x2, 0x2, 0x27e, 0x27f, 0x9, 0x5, 0x2, + 0x2, 0x27f, 0x280, 0x9, 0x12, 0x2, 0x2, 0x280, 0x281, 0x9, 0xe, 0x2, + 0x2, 0x281, 0x282, 0x9, 0x5, 0x2, 0x2, 0x282, 0x283, 0x9, 0x6, 0x2, + 0x2, 0x283, 0x284, 0x9, 0x11, 0x2, 0x2, 0x284, 0x285, 0x9, 0x7, 0x2, + 0x2, 0x285, 0x286, 0x9, 0x6, 0x2, 0x2, 0x286, 0x287, 0x9, 0x14, 0x2, + 0x2, 0x287, 0xae, 0x3, 0x2, 0x2, 0x2, 0x288, 0x289, 0x9, 0x11, 0x2, + 0x2, 0x289, 0x28a, 0x9, 0x5, 0x2, 0x2, 0x28a, 0x28b, 0x9, 0x12, 0x2, + 0x2, 0x28b, 0x28c, 0x9, 0xe, 0x2, 0x2, 0x28c, 0xb0, 0x3, 0x2, 0x2, 0x2, + 0x28d, 0x28e, 0x9, 0x10, 0x2, 0x2, 0x28e, 0x28f, 0x9, 0xf, 0x2, 0x2, + 0x28f, 0x290, 0x9, 0x5, 0x2, 0x2, 0x290, 0x291, 0x9, 0x13, 0x2, 0x2, + 0x291, 0x292, 0x9, 0x5, 0x2, 0x2, 0x292, 0xb2, 0x3, 0x2, 0x2, 0x2, 0x293, + 0x294, 0x9, 0x8, 0x2, 0x2, 0x294, 0x295, 0x9, 0x13, 0x2, 0x2, 0x295, + 0xb4, 0x3, 0x2, 0x2, 0x2, 0x296, 0x297, 0x9, 0x19, 0x2, 0x2, 0x297, + 0x298, 0x9, 0x8, 0x2, 0x2, 0x298, 0x299, 0x9, 0x13, 0x2, 0x2, 0x299, + 0xb6,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x71, 0x2, 0x30e, + 0x30d, 0x3, 0x2, 0x2, 0x2, 0x30f, 0x310, 0x3, 0x2, 0x2, 0x2, 0x310, + 0x30e, 0x3, 0x2, 0x2, 0x2, 0x310, 0x311, 0x3, 0x2, 0x2, 0x2, 0x311, + 0xe0, 0x3, 0x2, 0x2, 0x2, 0x312, 0x31f, 0x5, 0xff, 0x80, 0x2, 0x313, + 0x31f, 0x5, 0x101, 0x81, 0x2, 0x314, 0x31f, 0x5, 0x105, 0x83, 0x2, 0x315, + 0x31f, 0x5, 0x107, 0x84, 0x2, 0x316, 0x31f, 0x5, 0xe7, 0x74, 0x2, 0x317, + 0x31f, 0x5, 0xfb, 0x7e, 0x2, 0x318, 0x31f, 0x5, 0xf9, 0x7d, 0x2, 0x319, + 0x31f, 0x5, 0xf7, 0x7c, 0x2, 0x31a, 0x31f, 0x5, 0xeb, 0x76, 0x2, 0x31b, + 0x31f, 0x5, 0x109, 0x85, 0x2, 0x31c, 0x31f, 0x9, 0x1c, 0x2, 0x2, 0x31d, + 0x31f, 0x5, 0xe3, 0x72, 0x2, 0x31e, 0x312, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x313, 0x3, 0x2, 0x2, 0x2, 0x31e, 0x314, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x315, 0x3, 0x2, 0x2, 0x2, 0x31e, 0x316, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x317, 0x3, 0x2, 0x2, 0x2, 0x31e, 0x318, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x319, 0x3, 0x2, 0x2, 0x2, 0x31e, 0x31a, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x31b, 0x3, 0x2, 0x2, 0x2, 0x31e, 0x31c, 0x3, 0x2, 0x2, 0x2, 0x31e, + 0x31d, 0x3, 0x2, 0x2, 0x2, 0x31f, 0xe2, 0x3, 0x2, 0x2, 0x2, 0x320, 0x321, + 0x7, 0x31, 0x2, 0x2, 0x321, 0x322, 0x7, 0x2c, 0x2, 0x2, 0x322, 0x328, + 0x3, 0x2, 0x2, 0x2, 0x323, 0x327, 0x5, 0xef, 0x78, 0x2, 0x324, 0x325, + 0x7, 0x2c, 0x2, 0x2, 0x325, 0x327, 0x5, 0xf5, 0x7b, 0x2, 0x326, 0x323, + 0x3, 0x2, 0x2, 0x2, 0x326, 0x324, 0x3, 0x2, 0x2, 0x2, 0x327, 0x32a, + 0x3, 0x2, 0x2, 0x2, 0x328, 0x326, 0x3, 0x2, 0x2, 0x2, 0x328, 0x329, + 0x3, 0x2, 0x2, 0x2, 0x329, 0x32b, 0x3, 0x2, 0x2, 0x2, 0x32a, 0x328, + 0x3, 0x2, 0x2, 0x2, 0x32b, 0x32c, 0x7, 0x2c, 0x2, 0x2, 0x32c, 0x339, + 0x7, 0x31, 0x2, 0x2, 0x32d, 0x32e, 0x7, 0x31, 0x2, 0x2, 0x32e, 0x32f, + 0x7, 0x31, 0x2, 0x2, 0x32f, 0x330, 0x3, 0x2, 0x2, 0x2, 0x330, 0x332, + 0x5, 0xf3, 0x7a, 0x2, 0x331, 0x333, 0x5, 0xfb, 0x7e, 0x2, 0x332, 0x331, + 0x3, 0x2, 0x2, 0x2, 0x332, 0x333, 0x3, 0x2, 0x2, 0x2, 0x333, 0x336, + 0x3, 0x2, 0x2, 0x2, 0x334, 0x337, 0x5, 0x105, 0x83, 0x2, 0x335, 0x337, + 0x7, 0x2, 0x2, 0x3, 0x336, 0x334, 0x3, 0x2, 0x2, 0x2, 0x336, 0x335, + 0x3, 0x2, 0x2, 0x2, 0x337, 0x339, 0x3, 0x2, 0x2, 0x2, 0x338, 0x320, + 0x3, 0x2, 0x2, 0x2, 0x338, 0x32d, 0x3, 0x2, 0x2, 0x2, 0x339, 0xe4, 0x3, + 0x2, 0x2, 0x2, 0x33a, 0x33b, 0x4, 0x32, 0x32, 0x2, 0x33b, 0x33c, 0x9, + 0x19, 0x2, 0x2, 0x33c, 0xe6, 0x3, 0x2, 0x2, 0x2, 0x33d, 0x33e, 0x9, + 0x1d, 0x2, 0x2, 0x33e, 0xe8, 0x3, 0x2, 0x2, 0x2, 0x33f, 0x340, 0x9, + 0x1e, 0x2, 0x2, 0x340, 0xea, 0x3, 0x2, 0x2, 0x2, 0x341, 0x342, 0x9, + 0x1f, 0x2, 0x2, 0x342, 0xec, 0x3, 0x2, 0x2, 0x2, 0x343, 0x344, 0x9, + 0x20, 0x2, 0x2, 0x344, 0xee, 0x3, 0x2, 0x2, 0x2, 0x345, 0x346, 0x9, + 0x21, 0x2, 0x2, 0x346, 0xf0, 0x3, 0x2, 0x2, 0x2, 0x347, 0x348, 0x9, + 0x22, 0x2, 0x2, 0x348, 0xf2, 0x3, 0x2, 0x2, 0x2, 0x349, 0x34a, 0x9, + 0x23, 0x2, 0x2, 0x34a, 0xf4, 0x3, 0x2, 0x2, 0x2, 0x34b, 0x34c, 0x9, + 0x24, 0x2, 0x2, 0x34c, 0xf6, 0x3, 0x2, 0x2, 0x2, 0x34d, 0x34e, 0x9, + 0x25, 0x2, 0x2, 0x34e, 0xf8, 0x3, 0x2, 0x2, 0x2, 0x34f, 0x350, 0x9, + 0x26, 0x2, 0x2, 0x350, 0xfa, 0x3, 0x2, 0x2, 0x2, 0x351, 0x352, 0x9, + 0x27, 0x2, 0x2, 0x352, 0xfc, 0x3, 0x2, 0x2, 0x2, 0x353, 0x354, 0x9, + 0x28, 0x2, 0x2, 0x354, 0xfe, 0x3, 0x2, 0x2, 0x2, 0x355, 0x356, 0x9, + 0x29, 0x2, 0x2, 0x356, 0x100, 0x3, 0x2, 0x2, 0x2, 0x357, 0x358, 0x9, + 0x2a, 0x2, 0x2, 0x358, 0x102, 0x3, 0x2, 0x2, 0x2, 0x359, 0x35a, 0x9, + 0x2b, 0x2, 0x2, 0x35a, 0x104, 0x3, 0x2, 0x2, 0x2, 0x35b, 0x35c, 0x9, + 0x2c, 0x2, 0x2, 0x35c, 0x106, 0x3, 0x2, 0x2, 0x2, 0x35d, 0x35e, 0x9, + 0x2d, 0x2, 0x2, 0x35e, 0x108, 0x3, 0x2, 0x2, 0x2, 0x35f, 0x360, 0x9, + 0x2e, 0x2, 0x2, 0x360, 0x10a, 0x3, 0x2, 0x2, 0x2, 0x361, 0x362, 0x9, + 0x2f, 0x2, 0x2, 0x362, 0x10c, 0x3, 0x2, 0x2, 0x2, 0x28, 0x2, 0x179, + 0x17b, 0x182, 0x184, 0x188, 0x19c, 0x1a2, 0x1a9, 0x1ac, 0x1b2, 0x1b5, + 0x1b9, 0x1bd, 0x1c1, 0x1c7, 0x1ce, 0x1d3, 0x1d9, 0x1df, 0x1e1, 0x1e4, + 0x1e7, 0x1ec, 0x1f1, 0x1f8, 0x2f6, 0x2fb, 0x2ff, 0x305, 0x30b, 0x310, + 0x31e, 0x326, 0x328, 0x332, 0x336, 0x338, 0x2, + }; + + atn::ATNDeserializer deserializer; + _atn = deserializer.deserialize(_serializedATN); + + size_t count = _atn.getNumberOfDecisions(); + _decisionToDFA.reserve(count); + for (size_t i = 0; i < count; i++) { + _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); + } +} + +CypherLexer::Initializer CypherLexer::_init; diff --git a/src/query/frontend/opencypher/generated/CypherLexer.h b/src/query/frontend/opencypher/generated/CypherLexer.h new file mode 100644 index 000000000..bcb3f4528 --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherLexer.h @@ -0,0 +1,76 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" + + +namespace antlrcpptest { + + +class CypherLexer : public antlr4::Lexer { +public: + enum { + T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7, + T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14, + T__14 = 15, T__15 = 16, T__16 = 17, T__17 = 18, T__18 = 19, T__19 = 20, + T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, T__24 = 25, T__25 = 26, + T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, T__31 = 32, + T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38, + T__38 = 39, T__39 = 40, T__40 = 41, T__41 = 42, T__42 = 43, T__43 = 44, + T__44 = 45, T__45 = 46, T__46 = 47, T__47 = 48, T__48 = 49, StringLiteral = 50, + EscapedChar = 51, HexInteger = 52, DecimalInteger = 53, OctalInteger = 54, + HexLetter = 55, HexDigit = 56, Digit = 57, NonZeroDigit = 58, NonZeroOctDigit = 59, + OctDigit = 60, ZeroDigit = 61, ExponentDecimalReal = 62, RegularDecimalReal = 63, + UNION = 64, ALL = 65, OPTIONAL = 66, MATCH = 67, UNWIND = 68, AS = 69, + MERGE = 70, ON = 71, CREATE = 72, SET = 73, DETACH = 74, DELETE = 75, + REMOVE = 76, WITH = 77, DISTINCT = 78, RETURN = 79, ORDER = 80, BY = 81, + L_SKIP = 82, LIMIT = 83, ASCENDING = 84, ASC = 85, DESCENDING = 86, + DESC = 87, WHERE = 88, OR = 89, XOR = 90, AND = 91, NOT = 92, IN = 93, + STARTS = 94, ENDS = 95, CONTAINS = 96, IS = 97, CYPHERNULL = 98, COUNT = 99, + FILTER = 100, EXTRACT = 101, ANY = 102, NONE = 103, SINGLE = 104, TRUE = 105, + FALSE = 106, UnescapedSymbolicName = 107, IdentifierStart = 108, IdentifierPart = 109, + EscapedSymbolicName = 110, SP = 111, WHITESPACE = 112, Comment = 113, + L_0X = 114 + }; + + CypherLexer(antlr4::CharStream *input); + ~CypherLexer(); + + virtual std::string getGrammarFileName() const override; + virtual const std::vector& getRuleNames() const override; + + virtual const std::vector& getModeNames() const override; + virtual const std::vector& getTokenNames() const override; // deprecated, use vocabulary instead + virtual antlr4::dfa::Vocabulary& getVocabulary() const override; + + virtual const std::vector getSerializedATN() const override; + virtual const antlr4::atn::ATN& getATN() const override; + +private: + static std::vector _decisionToDFA; + static antlr4::atn::PredictionContextCache _sharedContextCache; + static std::vector _ruleNames; + static std::vector _tokenNames; + static std::vector _modeNames; + + static std::vector _literalNames; + static std::vector _symbolicNames; + static antlr4::dfa::Vocabulary _vocabulary; + static antlr4::atn::ATN _atn; + static std::vector _serializedATN; + + + // Individual action functions triggered by action() above. + + // Individual semantic predicate functions triggered by sempred() above. + + struct Initializer { + Initializer(); + }; + static Initializer _init; +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/generated/CypherLexer.tokens b/src/query/frontend/opencypher/generated/CypherLexer.tokens new file mode 100644 index 000000000..befaa26c3 --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherLexer.tokens @@ -0,0 +1,164 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +T__28=29 +T__29=30 +T__30=31 +T__31=32 +T__32=33 +T__33=34 +T__34=35 +T__35=36 +T__36=37 +T__37=38 +T__38=39 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +T__44=45 +T__45=46 +T__46=47 +T__47=48 +T__48=49 +StringLiteral=50 +EscapedChar=51 +HexInteger=52 +DecimalInteger=53 +OctalInteger=54 +HexLetter=55 +HexDigit=56 +Digit=57 +NonZeroDigit=58 +NonZeroOctDigit=59 +OctDigit=60 +ZeroDigit=61 +ExponentDecimalReal=62 +RegularDecimalReal=63 +UNION=64 +ALL=65 +OPTIONAL=66 +MATCH=67 +UNWIND=68 +AS=69 +MERGE=70 +ON=71 +CREATE=72 +SET=73 +DETACH=74 +DELETE=75 +REMOVE=76 +WITH=77 +DISTINCT=78 +RETURN=79 +ORDER=80 +BY=81 +L_SKIP=82 +LIMIT=83 +ASCENDING=84 +ASC=85 +DESCENDING=86 +DESC=87 +WHERE=88 +OR=89 +XOR=90 +AND=91 +NOT=92 +IN=93 +STARTS=94 +ENDS=95 +CONTAINS=96 +IS=97 +CYPHERNULL=98 +COUNT=99 +FILTER=100 +EXTRACT=101 +ANY=102 +NONE=103 +SINGLE=104 +TRUE=105 +FALSE=106 +UnescapedSymbolicName=107 +IdentifierStart=108 +IdentifierPart=109 +EscapedSymbolicName=110 +SP=111 +WHITESPACE=112 +Comment=113 +L_0X=114 +';'=1 +','=2 +'='=3 +'+='=4 +'*'=5 +'('=6 +')'=7 +'['=8 +'?'=9 +']'=10 +':'=11 +'|'=12 +'..'=13 +'+'=14 +'-'=15 +'/'=16 +'%'=17 +'^'=18 +'=~'=19 +'<>'=20 +'!='=21 +'<'=22 +'>'=23 +'<='=24 +'>='=25 +'.'=26 +'!'=27 +'{'=28 +'}'=29 +'$'=30 +'⟨'=31 +'〈'=32 +'﹤'=33 +'<'=34 +'⟩'=35 +'〉'=36 +'﹥'=37 +'>'=38 +'­'=39 +'‐'=40 +'‑'=41 +'‒'=42 +'–'=43 +'—'=44 +'―'=45 +'−'=46 +'﹘'=47 +'﹣'=48 +'-'=49 +'0'=61 diff --git a/src/query/frontend/opencypher/generated/CypherListener.cpp b/src/query/frontend/opencypher/generated/CypherListener.cpp new file mode 100644 index 000000000..e6cb38e90 --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherListener.cpp @@ -0,0 +1,9 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherListener.h" + + +using namespace antlrcpptest; + diff --git a/src/query/frontend/opencypher/generated/CypherListener.h b/src/query/frontend/opencypher/generated/CypherListener.h new file mode 100644 index 000000000..d3279c77a --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherListener.h @@ -0,0 +1,259 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" +#include "CypherParser.h" + + +namespace antlrcpptest { + +/** + * This interface defines an abstract listener for a parse tree produced by CypherParser. + */ +class CypherListener : public antlr4::tree::ParseTreeListener { +public: + + virtual void enterCypher(CypherParser::CypherContext *ctx) = 0; + virtual void exitCypher(CypherParser::CypherContext *ctx) = 0; + + virtual void enterStatement(CypherParser::StatementContext *ctx) = 0; + virtual void exitStatement(CypherParser::StatementContext *ctx) = 0; + + virtual void enterQuery(CypherParser::QueryContext *ctx) = 0; + virtual void exitQuery(CypherParser::QueryContext *ctx) = 0; + + virtual void enterRegularQuery(CypherParser::RegularQueryContext *ctx) = 0; + virtual void exitRegularQuery(CypherParser::RegularQueryContext *ctx) = 0; + + virtual void enterSingleQuery(CypherParser::SingleQueryContext *ctx) = 0; + virtual void exitSingleQuery(CypherParser::SingleQueryContext *ctx) = 0; + + virtual void enterCypherUnion(CypherParser::CypherUnionContext *ctx) = 0; + virtual void exitCypherUnion(CypherParser::CypherUnionContext *ctx) = 0; + + virtual void enterClause(CypherParser::ClauseContext *ctx) = 0; + virtual void exitClause(CypherParser::ClauseContext *ctx) = 0; + + virtual void enterCypherMatch(CypherParser::CypherMatchContext *ctx) = 0; + virtual void exitCypherMatch(CypherParser::CypherMatchContext *ctx) = 0; + + virtual void enterUnwind(CypherParser::UnwindContext *ctx) = 0; + virtual void exitUnwind(CypherParser::UnwindContext *ctx) = 0; + + virtual void enterMerge(CypherParser::MergeContext *ctx) = 0; + virtual void exitMerge(CypherParser::MergeContext *ctx) = 0; + + virtual void enterMergeAction(CypherParser::MergeActionContext *ctx) = 0; + virtual void exitMergeAction(CypherParser::MergeActionContext *ctx) = 0; + + virtual void enterCreate(CypherParser::CreateContext *ctx) = 0; + virtual void exitCreate(CypherParser::CreateContext *ctx) = 0; + + virtual void enterSet(CypherParser::SetContext *ctx) = 0; + virtual void exitSet(CypherParser::SetContext *ctx) = 0; + + virtual void enterSetItem(CypherParser::SetItemContext *ctx) = 0; + virtual void exitSetItem(CypherParser::SetItemContext *ctx) = 0; + + virtual void enterCypherDelete(CypherParser::CypherDeleteContext *ctx) = 0; + virtual void exitCypherDelete(CypherParser::CypherDeleteContext *ctx) = 0; + + virtual void enterRemove(CypherParser::RemoveContext *ctx) = 0; + virtual void exitRemove(CypherParser::RemoveContext *ctx) = 0; + + virtual void enterRemoveItem(CypherParser::RemoveItemContext *ctx) = 0; + virtual void exitRemoveItem(CypherParser::RemoveItemContext *ctx) = 0; + + virtual void enterWith(CypherParser::WithContext *ctx) = 0; + virtual void exitWith(CypherParser::WithContext *ctx) = 0; + + virtual void enterCypherReturn(CypherParser::CypherReturnContext *ctx) = 0; + virtual void exitCypherReturn(CypherParser::CypherReturnContext *ctx) = 0; + + virtual void enterReturnBody(CypherParser::ReturnBodyContext *ctx) = 0; + virtual void exitReturnBody(CypherParser::ReturnBodyContext *ctx) = 0; + + virtual void enterReturnItems(CypherParser::ReturnItemsContext *ctx) = 0; + virtual void exitReturnItems(CypherParser::ReturnItemsContext *ctx) = 0; + + virtual void enterReturnItem(CypherParser::ReturnItemContext *ctx) = 0; + virtual void exitReturnItem(CypherParser::ReturnItemContext *ctx) = 0; + + virtual void enterOrder(CypherParser::OrderContext *ctx) = 0; + virtual void exitOrder(CypherParser::OrderContext *ctx) = 0; + + virtual void enterSkip(CypherParser::SkipContext *ctx) = 0; + virtual void exitSkip(CypherParser::SkipContext *ctx) = 0; + + virtual void enterLimit(CypherParser::LimitContext *ctx) = 0; + virtual void exitLimit(CypherParser::LimitContext *ctx) = 0; + + virtual void enterSortItem(CypherParser::SortItemContext *ctx) = 0; + virtual void exitSortItem(CypherParser::SortItemContext *ctx) = 0; + + virtual void enterWhere(CypherParser::WhereContext *ctx) = 0; + virtual void exitWhere(CypherParser::WhereContext *ctx) = 0; + + virtual void enterPattern(CypherParser::PatternContext *ctx) = 0; + virtual void exitPattern(CypherParser::PatternContext *ctx) = 0; + + virtual void enterPatternPart(CypherParser::PatternPartContext *ctx) = 0; + virtual void exitPatternPart(CypherParser::PatternPartContext *ctx) = 0; + + virtual void enterAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) = 0; + virtual void exitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) = 0; + + virtual void enterPatternElement(CypherParser::PatternElementContext *ctx) = 0; + virtual void exitPatternElement(CypherParser::PatternElementContext *ctx) = 0; + + virtual void enterNodePattern(CypherParser::NodePatternContext *ctx) = 0; + virtual void exitNodePattern(CypherParser::NodePatternContext *ctx) = 0; + + virtual void enterPatternElementChain(CypherParser::PatternElementChainContext *ctx) = 0; + virtual void exitPatternElementChain(CypherParser::PatternElementChainContext *ctx) = 0; + + virtual void enterRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) = 0; + virtual void exitRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) = 0; + + virtual void enterRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) = 0; + virtual void exitRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) = 0; + + virtual void enterProperties(CypherParser::PropertiesContext *ctx) = 0; + virtual void exitProperties(CypherParser::PropertiesContext *ctx) = 0; + + virtual void enterRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) = 0; + virtual void exitRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) = 0; + + virtual void enterNodeLabels(CypherParser::NodeLabelsContext *ctx) = 0; + virtual void exitNodeLabels(CypherParser::NodeLabelsContext *ctx) = 0; + + virtual void enterNodeLabel(CypherParser::NodeLabelContext *ctx) = 0; + virtual void exitNodeLabel(CypherParser::NodeLabelContext *ctx) = 0; + + virtual void enterRangeLiteral(CypherParser::RangeLiteralContext *ctx) = 0; + virtual void exitRangeLiteral(CypherParser::RangeLiteralContext *ctx) = 0; + + virtual void enterLabelName(CypherParser::LabelNameContext *ctx) = 0; + virtual void exitLabelName(CypherParser::LabelNameContext *ctx) = 0; + + virtual void enterRelTypeName(CypherParser::RelTypeNameContext *ctx) = 0; + virtual void exitRelTypeName(CypherParser::RelTypeNameContext *ctx) = 0; + + virtual void enterExpression(CypherParser::ExpressionContext *ctx) = 0; + virtual void exitExpression(CypherParser::ExpressionContext *ctx) = 0; + + virtual void enterExpression12(CypherParser::Expression12Context *ctx) = 0; + virtual void exitExpression12(CypherParser::Expression12Context *ctx) = 0; + + virtual void enterExpression11(CypherParser::Expression11Context *ctx) = 0; + virtual void exitExpression11(CypherParser::Expression11Context *ctx) = 0; + + virtual void enterExpression10(CypherParser::Expression10Context *ctx) = 0; + virtual void exitExpression10(CypherParser::Expression10Context *ctx) = 0; + + virtual void enterExpression9(CypherParser::Expression9Context *ctx) = 0; + virtual void exitExpression9(CypherParser::Expression9Context *ctx) = 0; + + virtual void enterExpression8(CypherParser::Expression8Context *ctx) = 0; + virtual void exitExpression8(CypherParser::Expression8Context *ctx) = 0; + + virtual void enterExpression7(CypherParser::Expression7Context *ctx) = 0; + virtual void exitExpression7(CypherParser::Expression7Context *ctx) = 0; + + virtual void enterExpression6(CypherParser::Expression6Context *ctx) = 0; + virtual void exitExpression6(CypherParser::Expression6Context *ctx) = 0; + + virtual void enterExpression5(CypherParser::Expression5Context *ctx) = 0; + virtual void exitExpression5(CypherParser::Expression5Context *ctx) = 0; + + virtual void enterExpression4(CypherParser::Expression4Context *ctx) = 0; + virtual void exitExpression4(CypherParser::Expression4Context *ctx) = 0; + + virtual void enterExpression3(CypherParser::Expression3Context *ctx) = 0; + virtual void exitExpression3(CypherParser::Expression3Context *ctx) = 0; + + virtual void enterExpression2(CypherParser::Expression2Context *ctx) = 0; + virtual void exitExpression2(CypherParser::Expression2Context *ctx) = 0; + + virtual void enterAtom(CypherParser::AtomContext *ctx) = 0; + virtual void exitAtom(CypherParser::AtomContext *ctx) = 0; + + virtual void enterLiteral(CypherParser::LiteralContext *ctx) = 0; + virtual void exitLiteral(CypherParser::LiteralContext *ctx) = 0; + + virtual void enterBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) = 0; + virtual void exitBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) = 0; + + virtual void enterListLiteral(CypherParser::ListLiteralContext *ctx) = 0; + virtual void exitListLiteral(CypherParser::ListLiteralContext *ctx) = 0; + + virtual void enterPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) = 0; + virtual void exitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) = 0; + + virtual void enterParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) = 0; + virtual void exitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) = 0; + + virtual void enterRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) = 0; + virtual void exitRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) = 0; + + virtual void enterFilterExpression(CypherParser::FilterExpressionContext *ctx) = 0; + virtual void exitFilterExpression(CypherParser::FilterExpressionContext *ctx) = 0; + + virtual void enterIdInColl(CypherParser::IdInCollContext *ctx) = 0; + virtual void exitIdInColl(CypherParser::IdInCollContext *ctx) = 0; + + virtual void enterFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) = 0; + virtual void exitFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) = 0; + + virtual void enterFunctionName(CypherParser::FunctionNameContext *ctx) = 0; + virtual void exitFunctionName(CypherParser::FunctionNameContext *ctx) = 0; + + virtual void enterListComprehension(CypherParser::ListComprehensionContext *ctx) = 0; + virtual void exitListComprehension(CypherParser::ListComprehensionContext *ctx) = 0; + + virtual void enterPropertyLookup(CypherParser::PropertyLookupContext *ctx) = 0; + virtual void exitPropertyLookup(CypherParser::PropertyLookupContext *ctx) = 0; + + virtual void enterVariable(CypherParser::VariableContext *ctx) = 0; + virtual void exitVariable(CypherParser::VariableContext *ctx) = 0; + + virtual void enterNumberLiteral(CypherParser::NumberLiteralContext *ctx) = 0; + virtual void exitNumberLiteral(CypherParser::NumberLiteralContext *ctx) = 0; + + virtual void enterMapLiteral(CypherParser::MapLiteralContext *ctx) = 0; + virtual void exitMapLiteral(CypherParser::MapLiteralContext *ctx) = 0; + + virtual void enterParameter(CypherParser::ParameterContext *ctx) = 0; + virtual void exitParameter(CypherParser::ParameterContext *ctx) = 0; + + virtual void enterPropertyExpression(CypherParser::PropertyExpressionContext *ctx) = 0; + virtual void exitPropertyExpression(CypherParser::PropertyExpressionContext *ctx) = 0; + + virtual void enterPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) = 0; + virtual void exitPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) = 0; + + virtual void enterIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) = 0; + virtual void exitIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) = 0; + + virtual void enterDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) = 0; + virtual void exitDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) = 0; + + virtual void enterSymbolicName(CypherParser::SymbolicNameContext *ctx) = 0; + virtual void exitSymbolicName(CypherParser::SymbolicNameContext *ctx) = 0; + + virtual void enterLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) = 0; + virtual void exitLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) = 0; + + virtual void enterRightArrowHead(CypherParser::RightArrowHeadContext *ctx) = 0; + virtual void exitRightArrowHead(CypherParser::RightArrowHeadContext *ctx) = 0; + + virtual void enterDash(CypherParser::DashContext *ctx) = 0; + virtual void exitDash(CypherParser::DashContext *ctx) = 0; + + +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/generated/CypherParser.cpp b/src/query/frontend/opencypher/generated/CypherParser.cpp new file mode 100644 index 000000000..6a54e58cb --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherParser.cpp @@ -0,0 +1,10218 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherListener.h" +#include "CypherVisitor.h" + +#include "CypherParser.h" + + +using namespace antlrcpp; +using namespace antlrcpptest; +using namespace antlr4; + +CypherParser::CypherParser(TokenStream *input) : Parser(input) { + _interpreter = new atn::ParserATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); +} + +CypherParser::~CypherParser() { + delete _interpreter; +} + +std::string CypherParser::getGrammarFileName() const { + return "Cypher.g4"; +} + +const std::vector& CypherParser::getRuleNames() const { + return _ruleNames; +} + +dfa::Vocabulary& CypherParser::getVocabulary() const { + return _vocabulary; +} + + +//----------------- CypherContext ------------------------------------------------------------------ + +CypherParser::CypherContext::CypherContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::StatementContext* CypherParser::CypherContext::statement() { + return getRuleContext(0); +} + +std::vector CypherParser::CypherContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::CypherContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::CypherContext::getRuleIndex() const { + return CypherParser::RuleCypher; +} + +void CypherParser::CypherContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCypher(this); +} + +void CypherParser::CypherContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCypher(this); +} + + +antlrcpp::Any CypherParser::CypherContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCypher(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CypherContext* CypherParser::cypher() { + CypherContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 0, CypherParser::RuleCypher); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(159); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(158); + match(CypherParser::SP); + } + setState(161); + statement(); + setState(166); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 2, _ctx)) { + case 1: { + setState(163); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(162); + match(CypherParser::SP); + } + setState(165); + match(CypherParser::T__0); + break; + } + + } + setState(169); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(168); + match(CypherParser::SP); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- StatementContext ------------------------------------------------------------------ + +CypherParser::StatementContext::StatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::QueryContext* CypherParser::StatementContext::query() { + return getRuleContext(0); +} + + +size_t CypherParser::StatementContext::getRuleIndex() const { + return CypherParser::RuleStatement; +} + +void CypherParser::StatementContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterStatement(this); +} + +void CypherParser::StatementContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitStatement(this); +} + + +antlrcpp::Any CypherParser::StatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitStatement(this); + else + return visitor->visitChildren(this); +} + +CypherParser::StatementContext* CypherParser::statement() { + StatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 2, CypherParser::RuleStatement); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(171); + query(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- QueryContext ------------------------------------------------------------------ + +CypherParser::QueryContext::QueryContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::RegularQueryContext* CypherParser::QueryContext::regularQuery() { + return getRuleContext(0); +} + + +size_t CypherParser::QueryContext::getRuleIndex() const { + return CypherParser::RuleQuery; +} + +void CypherParser::QueryContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterQuery(this); +} + +void CypherParser::QueryContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitQuery(this); +} + + +antlrcpp::Any CypherParser::QueryContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitQuery(this); + else + return visitor->visitChildren(this); +} + +CypherParser::QueryContext* CypherParser::query() { + QueryContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 4, CypherParser::RuleQuery); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(173); + regularQuery(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RegularQueryContext ------------------------------------------------------------------ + +CypherParser::RegularQueryContext::RegularQueryContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SingleQueryContext* CypherParser::RegularQueryContext::singleQuery() { + return getRuleContext(0); +} + +std::vector CypherParser::RegularQueryContext::cypherUnion() { + return getRuleContexts(); +} + +CypherParser::CypherUnionContext* CypherParser::RegularQueryContext::cypherUnion(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::RegularQueryContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RegularQueryContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::RegularQueryContext::getRuleIndex() const { + return CypherParser::RuleRegularQuery; +} + +void CypherParser::RegularQueryContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRegularQuery(this); +} + +void CypherParser::RegularQueryContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRegularQuery(this); +} + + +antlrcpp::Any CypherParser::RegularQueryContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRegularQuery(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RegularQueryContext* CypherParser::regularQuery() { + RegularQueryContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 6, CypherParser::RuleRegularQuery); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(175); + singleQuery(); + setState(182); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 5, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(177); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(176); + match(CypherParser::SP); + } + setState(179); + cypherUnion(); + } + setState(184); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 5, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SingleQueryContext ------------------------------------------------------------------ + +CypherParser::SingleQueryContext::SingleQueryContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::SingleQueryContext::clause() { + return getRuleContexts(); +} + +CypherParser::ClauseContext* CypherParser::SingleQueryContext::clause(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::SingleQueryContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::SingleQueryContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::SingleQueryContext::getRuleIndex() const { + return CypherParser::RuleSingleQuery; +} + +void CypherParser::SingleQueryContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSingleQuery(this); +} + +void CypherParser::SingleQueryContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSingleQuery(this); +} + + +antlrcpp::Any CypherParser::SingleQueryContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSingleQuery(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SingleQueryContext* CypherParser::singleQuery() { + SingleQueryContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 8, CypherParser::RuleSingleQuery); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(185); + clause(); + setState(192); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 7, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(187); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(186); + match(CypherParser::SP); + } + setState(189); + clause(); + } + setState(194); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 7, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CypherUnionContext ------------------------------------------------------------------ + +CypherParser::CypherUnionContext::CypherUnionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::CypherUnionContext::UNION() { + return getToken(CypherParser::UNION, 0); +} + +std::vector CypherParser::CypherUnionContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::CypherUnionContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::CypherUnionContext::ALL() { + return getToken(CypherParser::ALL, 0); +} + +CypherParser::SingleQueryContext* CypherParser::CypherUnionContext::singleQuery() { + return getRuleContext(0); +} + + +size_t CypherParser::CypherUnionContext::getRuleIndex() const { + return CypherParser::RuleCypherUnion; +} + +void CypherParser::CypherUnionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCypherUnion(this); +} + +void CypherParser::CypherUnionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCypherUnion(this); +} + + +antlrcpp::Any CypherParser::CypherUnionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCypherUnion(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CypherUnionContext* CypherParser::cypherUnion() { + CypherUnionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 10, CypherParser::RuleCypherUnion); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(207); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 10, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(195); + match(CypherParser::UNION); + setState(196); + match(CypherParser::SP); + setState(197); + match(CypherParser::ALL); + setState(199); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(198); + match(CypherParser::SP); + } + setState(201); + singleQuery(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(202); + match(CypherParser::UNION); + setState(204); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(203); + match(CypherParser::SP); + } + setState(206); + singleQuery(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ClauseContext ------------------------------------------------------------------ + +CypherParser::ClauseContext::ClauseContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::CypherMatchContext* CypherParser::ClauseContext::cypherMatch() { + return getRuleContext(0); +} + +CypherParser::UnwindContext* CypherParser::ClauseContext::unwind() { + return getRuleContext(0); +} + +CypherParser::MergeContext* CypherParser::ClauseContext::merge() { + return getRuleContext(0); +} + +CypherParser::CreateContext* CypherParser::ClauseContext::create() { + return getRuleContext(0); +} + +CypherParser::SetContext* CypherParser::ClauseContext::set() { + return getRuleContext(0); +} + +CypherParser::CypherDeleteContext* CypherParser::ClauseContext::cypherDelete() { + return getRuleContext(0); +} + +CypherParser::RemoveContext* CypherParser::ClauseContext::remove() { + return getRuleContext(0); +} + +CypherParser::WithContext* CypherParser::ClauseContext::with() { + return getRuleContext(0); +} + +CypherParser::CypherReturnContext* CypherParser::ClauseContext::cypherReturn() { + return getRuleContext(0); +} + + +size_t CypherParser::ClauseContext::getRuleIndex() const { + return CypherParser::RuleClause; +} + +void CypherParser::ClauseContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterClause(this); +} + +void CypherParser::ClauseContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitClause(this); +} + + +antlrcpp::Any CypherParser::ClauseContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitClause(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ClauseContext* CypherParser::clause() { + ClauseContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 12, CypherParser::RuleClause); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(218); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::OPTIONAL: + case CypherParser::MATCH: { + enterOuterAlt(_localctx, 1); + setState(209); + cypherMatch(); + break; + } + + case CypherParser::UNWIND: { + enterOuterAlt(_localctx, 2); + setState(210); + unwind(); + break; + } + + case CypherParser::MERGE: { + enterOuterAlt(_localctx, 3); + setState(211); + merge(); + break; + } + + case CypherParser::CREATE: { + enterOuterAlt(_localctx, 4); + setState(212); + create(); + break; + } + + case CypherParser::SET: { + enterOuterAlt(_localctx, 5); + setState(213); + set(); + break; + } + + case CypherParser::DETACH: + case CypherParser::DELETE: { + enterOuterAlt(_localctx, 6); + setState(214); + cypherDelete(); + break; + } + + case CypherParser::REMOVE: { + enterOuterAlt(_localctx, 7); + setState(215); + remove(); + break; + } + + case CypherParser::WITH: { + enterOuterAlt(_localctx, 8); + setState(216); + with(); + break; + } + + case CypherParser::RETURN: { + enterOuterAlt(_localctx, 9); + setState(217); + cypherReturn(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CypherMatchContext ------------------------------------------------------------------ + +CypherParser::CypherMatchContext::CypherMatchContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::CypherMatchContext::MATCH() { + return getToken(CypherParser::MATCH, 0); +} + +CypherParser::PatternContext* CypherParser::CypherMatchContext::pattern() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::CypherMatchContext::OPTIONAL() { + return getToken(CypherParser::OPTIONAL, 0); +} + +std::vector CypherParser::CypherMatchContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::CypherMatchContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::WhereContext* CypherParser::CypherMatchContext::where() { + return getRuleContext(0); +} + + +size_t CypherParser::CypherMatchContext::getRuleIndex() const { + return CypherParser::RuleCypherMatch; +} + +void CypherParser::CypherMatchContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCypherMatch(this); +} + +void CypherParser::CypherMatchContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCypherMatch(this); +} + + +antlrcpp::Any CypherParser::CypherMatchContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCypherMatch(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CypherMatchContext* CypherParser::cypherMatch() { + CypherMatchContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 14, CypherParser::RuleCypherMatch); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(222); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::OPTIONAL) { + setState(220); + match(CypherParser::OPTIONAL); + setState(221); + match(CypherParser::SP); + } + setState(224); + match(CypherParser::MATCH); + setState(226); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(225); + match(CypherParser::SP); + } + setState(228); + pattern(); + setState(233); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 15, _ctx)) { + case 1: { + setState(230); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(229); + match(CypherParser::SP); + } + setState(232); + where(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- UnwindContext ------------------------------------------------------------------ + +CypherParser::UnwindContext::UnwindContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::UnwindContext::UNWIND() { + return getToken(CypherParser::UNWIND, 0); +} + +CypherParser::ExpressionContext* CypherParser::UnwindContext::expression() { + return getRuleContext(0); +} + +std::vector CypherParser::UnwindContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::UnwindContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::UnwindContext::AS() { + return getToken(CypherParser::AS, 0); +} + +CypherParser::VariableContext* CypherParser::UnwindContext::variable() { + return getRuleContext(0); +} + + +size_t CypherParser::UnwindContext::getRuleIndex() const { + return CypherParser::RuleUnwind; +} + +void CypherParser::UnwindContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterUnwind(this); +} + +void CypherParser::UnwindContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitUnwind(this); +} + + +antlrcpp::Any CypherParser::UnwindContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitUnwind(this); + else + return visitor->visitChildren(this); +} + +CypherParser::UnwindContext* CypherParser::unwind() { + UnwindContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 16, CypherParser::RuleUnwind); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(235); + match(CypherParser::UNWIND); + setState(237); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(236); + match(CypherParser::SP); + } + setState(239); + expression(); + setState(240); + match(CypherParser::SP); + setState(241); + match(CypherParser::AS); + setState(242); + match(CypherParser::SP); + setState(243); + variable(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- MergeContext ------------------------------------------------------------------ + +CypherParser::MergeContext::MergeContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::MergeContext::MERGE() { + return getToken(CypherParser::MERGE, 0); +} + +CypherParser::PatternPartContext* CypherParser::MergeContext::patternPart() { + return getRuleContext(0); +} + +std::vector CypherParser::MergeContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::MergeContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::MergeContext::mergeAction() { + return getRuleContexts(); +} + +CypherParser::MergeActionContext* CypherParser::MergeContext::mergeAction(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::MergeContext::getRuleIndex() const { + return CypherParser::RuleMerge; +} + +void CypherParser::MergeContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterMerge(this); +} + +void CypherParser::MergeContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitMerge(this); +} + + +antlrcpp::Any CypherParser::MergeContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitMerge(this); + else + return visitor->visitChildren(this); +} + +CypherParser::MergeContext* CypherParser::merge() { + MergeContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 18, CypherParser::RuleMerge); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(245); + match(CypherParser::MERGE); + setState(247); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(246); + match(CypherParser::SP); + } + setState(249); + patternPart(); + setState(254); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 18, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(250); + match(CypherParser::SP); + setState(251); + mergeAction(); + } + setState(256); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 18, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- MergeActionContext ------------------------------------------------------------------ + +CypherParser::MergeActionContext::MergeActionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::MergeActionContext::ON() { + return getToken(CypherParser::ON, 0); +} + +std::vector CypherParser::MergeActionContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::MergeActionContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::MergeActionContext::MATCH() { + return getToken(CypherParser::MATCH, 0); +} + +CypherParser::SetContext* CypherParser::MergeActionContext::set() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::MergeActionContext::CREATE() { + return getToken(CypherParser::CREATE, 0); +} + + +size_t CypherParser::MergeActionContext::getRuleIndex() const { + return CypherParser::RuleMergeAction; +} + +void CypherParser::MergeActionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterMergeAction(this); +} + +void CypherParser::MergeActionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitMergeAction(this); +} + + +antlrcpp::Any CypherParser::MergeActionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitMergeAction(this); + else + return visitor->visitChildren(this); +} + +CypherParser::MergeActionContext* CypherParser::mergeAction() { + MergeActionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 20, CypherParser::RuleMergeAction); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(267); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 19, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(257); + match(CypherParser::ON); + setState(258); + match(CypherParser::SP); + setState(259); + match(CypherParser::MATCH); + setState(260); + match(CypherParser::SP); + setState(261); + set(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(262); + match(CypherParser::ON); + setState(263); + match(CypherParser::SP); + setState(264); + match(CypherParser::CREATE); + setState(265); + match(CypherParser::SP); + setState(266); + set(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CreateContext ------------------------------------------------------------------ + +CypherParser::CreateContext::CreateContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::CreateContext::CREATE() { + return getToken(CypherParser::CREATE, 0); +} + +CypherParser::PatternContext* CypherParser::CreateContext::pattern() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::CreateContext::SP() { + return getToken(CypherParser::SP, 0); +} + + +size_t CypherParser::CreateContext::getRuleIndex() const { + return CypherParser::RuleCreate; +} + +void CypherParser::CreateContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCreate(this); +} + +void CypherParser::CreateContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCreate(this); +} + + +antlrcpp::Any CypherParser::CreateContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCreate(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CreateContext* CypherParser::create() { + CreateContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 22, CypherParser::RuleCreate); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(269); + match(CypherParser::CREATE); + setState(271); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(270); + match(CypherParser::SP); + } + setState(273); + pattern(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SetContext ------------------------------------------------------------------ + +CypherParser::SetContext::SetContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::SetContext::SET() { + return getToken(CypherParser::SET, 0); +} + +std::vector CypherParser::SetContext::setItem() { + return getRuleContexts(); +} + +CypherParser::SetItemContext* CypherParser::SetContext::setItem(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::SetContext::getRuleIndex() const { + return CypherParser::RuleSet; +} + +void CypherParser::SetContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSet(this); +} + +void CypherParser::SetContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSet(this); +} + + +antlrcpp::Any CypherParser::SetContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSet(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SetContext* CypherParser::set() { + SetContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 24, CypherParser::RuleSet); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(275); + match(CypherParser::SET); + setState(276); + setItem(); + setState(281); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__1) { + setState(277); + match(CypherParser::T__1); + setState(278); + setItem(); + setState(283); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SetItemContext ------------------------------------------------------------------ + +CypherParser::SetItemContext::SetItemContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::PropertyExpressionContext* CypherParser::SetItemContext::propertyExpression() { + return getRuleContext(0); +} + +CypherParser::ExpressionContext* CypherParser::SetItemContext::expression() { + return getRuleContext(0); +} + +CypherParser::VariableContext* CypherParser::SetItemContext::variable() { + return getRuleContext(0); +} + +CypherParser::NodeLabelsContext* CypherParser::SetItemContext::nodeLabels() { + return getRuleContext(0); +} + + +size_t CypherParser::SetItemContext::getRuleIndex() const { + return CypherParser::RuleSetItem; +} + +void CypherParser::SetItemContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSetItem(this); +} + +void CypherParser::SetItemContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSetItem(this); +} + + +antlrcpp::Any CypherParser::SetItemContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSetItem(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SetItemContext* CypherParser::setItem() { + SetItemContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 26, CypherParser::RuleSetItem); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(299); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 22, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(284); + propertyExpression(); + setState(285); + match(CypherParser::T__2); + setState(286); + expression(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(288); + variable(); + setState(289); + match(CypherParser::T__2); + setState(290); + expression(); + break; + } + + case 3: { + enterOuterAlt(_localctx, 3); + setState(292); + variable(); + setState(293); + match(CypherParser::T__3); + setState(294); + expression(); + break; + } + + case 4: { + enterOuterAlt(_localctx, 4); + setState(296); + variable(); + setState(297); + nodeLabels(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CypherDeleteContext ------------------------------------------------------------------ + +CypherParser::CypherDeleteContext::CypherDeleteContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::CypherDeleteContext::DELETE() { + return getToken(CypherParser::DELETE, 0); +} + +std::vector CypherParser::CypherDeleteContext::expression() { + return getRuleContexts(); +} + +CypherParser::ExpressionContext* CypherParser::CypherDeleteContext::expression(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* CypherParser::CypherDeleteContext::DETACH() { + return getToken(CypherParser::DETACH, 0); +} + +std::vector CypherParser::CypherDeleteContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::CypherDeleteContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::CypherDeleteContext::getRuleIndex() const { + return CypherParser::RuleCypherDelete; +} + +void CypherParser::CypherDeleteContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCypherDelete(this); +} + +void CypherParser::CypherDeleteContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCypherDelete(this); +} + + +antlrcpp::Any CypherParser::CypherDeleteContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCypherDelete(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CypherDeleteContext* CypherParser::cypherDelete() { + CypherDeleteContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 28, CypherParser::RuleCypherDelete); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(303); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::DETACH) { + setState(301); + match(CypherParser::DETACH); + setState(302); + match(CypherParser::SP); + } + setState(305); + match(CypherParser::DELETE); + setState(307); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(306); + match(CypherParser::SP); + } + setState(309); + expression(); + setState(320); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 27, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(311); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(310); + match(CypherParser::SP); + } + setState(313); + match(CypherParser::T__1); + setState(315); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(314); + match(CypherParser::SP); + } + setState(317); + expression(); + } + setState(322); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 27, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RemoveContext ------------------------------------------------------------------ + +CypherParser::RemoveContext::RemoveContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::RemoveContext::REMOVE() { + return getToken(CypherParser::REMOVE, 0); +} + +std::vector CypherParser::RemoveContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RemoveContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::RemoveContext::removeItem() { + return getRuleContexts(); +} + +CypherParser::RemoveItemContext* CypherParser::RemoveContext::removeItem(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::RemoveContext::getRuleIndex() const { + return CypherParser::RuleRemove; +} + +void CypherParser::RemoveContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRemove(this); +} + +void CypherParser::RemoveContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRemove(this); +} + + +antlrcpp::Any CypherParser::RemoveContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRemove(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RemoveContext* CypherParser::remove() { + RemoveContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 30, CypherParser::RuleRemove); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(323); + match(CypherParser::REMOVE); + setState(324); + match(CypherParser::SP); + setState(325); + removeItem(); + setState(336); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 30, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(327); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(326); + match(CypherParser::SP); + } + setState(329); + match(CypherParser::T__1); + setState(331); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(330); + match(CypherParser::SP); + } + setState(333); + removeItem(); + } + setState(338); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 30, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RemoveItemContext ------------------------------------------------------------------ + +CypherParser::RemoveItemContext::RemoveItemContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::VariableContext* CypherParser::RemoveItemContext::variable() { + return getRuleContext(0); +} + +CypherParser::NodeLabelsContext* CypherParser::RemoveItemContext::nodeLabels() { + return getRuleContext(0); +} + +CypherParser::PropertyExpressionContext* CypherParser::RemoveItemContext::propertyExpression() { + return getRuleContext(0); +} + + +size_t CypherParser::RemoveItemContext::getRuleIndex() const { + return CypherParser::RuleRemoveItem; +} + +void CypherParser::RemoveItemContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRemoveItem(this); +} + +void CypherParser::RemoveItemContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRemoveItem(this); +} + + +antlrcpp::Any CypherParser::RemoveItemContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRemoveItem(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RemoveItemContext* CypherParser::removeItem() { + RemoveItemContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 32, CypherParser::RuleRemoveItem); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(343); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 31, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(339); + variable(); + setState(340); + nodeLabels(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(342); + propertyExpression(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- WithContext ------------------------------------------------------------------ + +CypherParser::WithContext::WithContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::WithContext::WITH() { + return getToken(CypherParser::WITH, 0); +} + +std::vector CypherParser::WithContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::WithContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::ReturnBodyContext* CypherParser::WithContext::returnBody() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::WithContext::DISTINCT() { + return getToken(CypherParser::DISTINCT, 0); +} + +CypherParser::WhereContext* CypherParser::WithContext::where() { + return getRuleContext(0); +} + + +size_t CypherParser::WithContext::getRuleIndex() const { + return CypherParser::RuleWith; +} + +void CypherParser::WithContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterWith(this); +} + +void CypherParser::WithContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitWith(this); +} + + +antlrcpp::Any CypherParser::WithContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitWith(this); + else + return visitor->visitChildren(this); +} + +CypherParser::WithContext* CypherParser::with() { + WithContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 34, CypherParser::RuleWith); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(345); + match(CypherParser::WITH); + setState(350); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 33, _ctx)) { + case 1: { + setState(347); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(346); + match(CypherParser::SP); + } + setState(349); + match(CypherParser::DISTINCT); + break; + } + + } + setState(352); + match(CypherParser::SP); + setState(353); + returnBody(); + setState(358); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 35, _ctx)) { + case 1: { + setState(355); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(354); + match(CypherParser::SP); + } + setState(357); + where(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CypherReturnContext ------------------------------------------------------------------ + +CypherParser::CypherReturnContext::CypherReturnContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::CypherReturnContext::RETURN() { + return getToken(CypherParser::RETURN, 0); +} + +std::vector CypherParser::CypherReturnContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::CypherReturnContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::ReturnBodyContext* CypherParser::CypherReturnContext::returnBody() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::CypherReturnContext::DISTINCT() { + return getToken(CypherParser::DISTINCT, 0); +} + + +size_t CypherParser::CypherReturnContext::getRuleIndex() const { + return CypherParser::RuleCypherReturn; +} + +void CypherParser::CypherReturnContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterCypherReturn(this); +} + +void CypherParser::CypherReturnContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitCypherReturn(this); +} + + +antlrcpp::Any CypherParser::CypherReturnContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCypherReturn(this); + else + return visitor->visitChildren(this); +} + +CypherParser::CypherReturnContext* CypherParser::cypherReturn() { + CypherReturnContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 36, CypherParser::RuleCypherReturn); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(360); + match(CypherParser::RETURN); + setState(365); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 37, _ctx)) { + case 1: { + setState(362); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(361); + match(CypherParser::SP); + } + setState(364); + match(CypherParser::DISTINCT); + break; + } + + } + setState(367); + match(CypherParser::SP); + setState(368); + returnBody(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ReturnBodyContext ------------------------------------------------------------------ + +CypherParser::ReturnBodyContext::ReturnBodyContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::ReturnItemsContext* CypherParser::ReturnBodyContext::returnItems() { + return getRuleContext(0); +} + +std::vector CypherParser::ReturnBodyContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ReturnBodyContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::OrderContext* CypherParser::ReturnBodyContext::order() { + return getRuleContext(0); +} + +CypherParser::SkipContext* CypherParser::ReturnBodyContext::skip() { + return getRuleContext(0); +} + +CypherParser::LimitContext* CypherParser::ReturnBodyContext::limit() { + return getRuleContext(0); +} + + +size_t CypherParser::ReturnBodyContext::getRuleIndex() const { + return CypherParser::RuleReturnBody; +} + +void CypherParser::ReturnBodyContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterReturnBody(this); +} + +void CypherParser::ReturnBodyContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitReturnBody(this); +} + + +antlrcpp::Any CypherParser::ReturnBodyContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitReturnBody(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ReturnBodyContext* CypherParser::returnBody() { + ReturnBodyContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 38, CypherParser::RuleReturnBody); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(370); + returnItems(); + setState(373); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 38, _ctx)) { + case 1: { + setState(371); + match(CypherParser::SP); + setState(372); + order(); + break; + } + + } + setState(377); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 39, _ctx)) { + case 1: { + setState(375); + match(CypherParser::SP); + setState(376); + skip(); + break; + } + + } + setState(381); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 40, _ctx)) { + case 1: { + setState(379); + match(CypherParser::SP); + setState(380); + limit(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ReturnItemsContext ------------------------------------------------------------------ + +CypherParser::ReturnItemsContext::ReturnItemsContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::ReturnItemsContext::returnItem() { + return getRuleContexts(); +} + +CypherParser::ReturnItemContext* CypherParser::ReturnItemsContext::returnItem(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::ReturnItemsContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ReturnItemsContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::ReturnItemsContext::getRuleIndex() const { + return CypherParser::RuleReturnItems; +} + +void CypherParser::ReturnItemsContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterReturnItems(this); +} + +void CypherParser::ReturnItemsContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitReturnItems(this); +} + + +antlrcpp::Any CypherParser::ReturnItemsContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitReturnItems(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ReturnItemsContext* CypherParser::returnItems() { + ReturnItemsContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 40, CypherParser::RuleReturnItems); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + setState(411); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::T__4: { + enterOuterAlt(_localctx, 1); + setState(383); + match(CypherParser::T__4); + setState(394); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 43, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(385); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(384); + match(CypherParser::SP); + } + setState(387); + match(CypherParser::T__1); + setState(389); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(388); + match(CypherParser::SP); + } + setState(391); + returnItem(); + } + setState(396); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 43, _ctx); + } + break; + } + + case CypherParser::T__5: + case CypherParser::T__7: + case CypherParser::T__13: + case CypherParser::T__14: + case CypherParser::T__27: + case CypherParser::T__29: + case CypherParser::StringLiteral: + case CypherParser::HexInteger: + case CypherParser::DecimalInteger: + case CypherParser::OctalInteger: + case CypherParser::HexLetter: + case CypherParser::ExponentDecimalReal: + case CypherParser::RegularDecimalReal: + case CypherParser::UNION: + case CypherParser::ALL: + case CypherParser::OPTIONAL: + case CypherParser::MATCH: + case CypherParser::UNWIND: + case CypherParser::AS: + case CypherParser::MERGE: + case CypherParser::ON: + case CypherParser::CREATE: + case CypherParser::SET: + case CypherParser::DETACH: + case CypherParser::DELETE: + case CypherParser::REMOVE: + case CypherParser::WITH: + case CypherParser::DISTINCT: + case CypherParser::RETURN: + case CypherParser::ORDER: + case CypherParser::BY: + case CypherParser::L_SKIP: + case CypherParser::LIMIT: + case CypherParser::ASCENDING: + case CypherParser::ASC: + case CypherParser::DESCENDING: + case CypherParser::DESC: + case CypherParser::WHERE: + case CypherParser::OR: + case CypherParser::XOR: + case CypherParser::AND: + case CypherParser::NOT: + case CypherParser::IN: + case CypherParser::STARTS: + case CypherParser::ENDS: + case CypherParser::CONTAINS: + case CypherParser::IS: + case CypherParser::CYPHERNULL: + case CypherParser::COUNT: + case CypherParser::FILTER: + case CypherParser::EXTRACT: + case CypherParser::ANY: + case CypherParser::NONE: + case CypherParser::SINGLE: + case CypherParser::TRUE: + case CypherParser::FALSE: + case CypherParser::UnescapedSymbolicName: + case CypherParser::EscapedSymbolicName: { + enterOuterAlt(_localctx, 2); + setState(397); + returnItem(); + setState(408); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 46, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(399); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(398); + match(CypherParser::SP); + } + setState(401); + match(CypherParser::T__1); + setState(403); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(402); + match(CypherParser::SP); + } + setState(405); + returnItem(); + } + setState(410); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 46, _ctx); + } + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ReturnItemContext ------------------------------------------------------------------ + +CypherParser::ReturnItemContext::ReturnItemContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::ExpressionContext* CypherParser::ReturnItemContext::expression() { + return getRuleContext(0); +} + +std::vector CypherParser::ReturnItemContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ReturnItemContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::ReturnItemContext::AS() { + return getToken(CypherParser::AS, 0); +} + +CypherParser::VariableContext* CypherParser::ReturnItemContext::variable() { + return getRuleContext(0); +} + + +size_t CypherParser::ReturnItemContext::getRuleIndex() const { + return CypherParser::RuleReturnItem; +} + +void CypherParser::ReturnItemContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterReturnItem(this); +} + +void CypherParser::ReturnItemContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitReturnItem(this); +} + + +antlrcpp::Any CypherParser::ReturnItemContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitReturnItem(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ReturnItemContext* CypherParser::returnItem() { + ReturnItemContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 42, CypherParser::RuleReturnItem); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(420); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 48, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(413); + expression(); + setState(414); + match(CypherParser::SP); + setState(415); + match(CypherParser::AS); + setState(416); + match(CypherParser::SP); + setState(417); + variable(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(419); + expression(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- OrderContext ------------------------------------------------------------------ + +CypherParser::OrderContext::OrderContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::OrderContext::ORDER() { + return getToken(CypherParser::ORDER, 0); +} + +std::vector CypherParser::OrderContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::OrderContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::OrderContext::BY() { + return getToken(CypherParser::BY, 0); +} + +std::vector CypherParser::OrderContext::sortItem() { + return getRuleContexts(); +} + +CypherParser::SortItemContext* CypherParser::OrderContext::sortItem(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::OrderContext::getRuleIndex() const { + return CypherParser::RuleOrder; +} + +void CypherParser::OrderContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterOrder(this); +} + +void CypherParser::OrderContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitOrder(this); +} + + +antlrcpp::Any CypherParser::OrderContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitOrder(this); + else + return visitor->visitChildren(this); +} + +CypherParser::OrderContext* CypherParser::order() { + OrderContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 44, CypherParser::RuleOrder); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(422); + match(CypherParser::ORDER); + setState(423); + match(CypherParser::SP); + setState(424); + match(CypherParser::BY); + setState(425); + match(CypherParser::SP); + setState(426); + sortItem(); + setState(434); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__1) { + setState(427); + match(CypherParser::T__1); + setState(429); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(428); + match(CypherParser::SP); + } + setState(431); + sortItem(); + setState(436); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SkipContext ------------------------------------------------------------------ + +CypherParser::SkipContext::SkipContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::SkipContext::L_SKIP() { + return getToken(CypherParser::L_SKIP, 0); +} + +tree::TerminalNode* CypherParser::SkipContext::SP() { + return getToken(CypherParser::SP, 0); +} + +CypherParser::ExpressionContext* CypherParser::SkipContext::expression() { + return getRuleContext(0); +} + + +size_t CypherParser::SkipContext::getRuleIndex() const { + return CypherParser::RuleSkip; +} + +void CypherParser::SkipContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSkip(this); +} + +void CypherParser::SkipContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSkip(this); +} + + +antlrcpp::Any CypherParser::SkipContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSkip(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SkipContext* CypherParser::skip() { + SkipContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 46, CypherParser::RuleSkip); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(437); + match(CypherParser::L_SKIP); + setState(438); + match(CypherParser::SP); + setState(439); + expression(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LimitContext ------------------------------------------------------------------ + +CypherParser::LimitContext::LimitContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::LimitContext::LIMIT() { + return getToken(CypherParser::LIMIT, 0); +} + +tree::TerminalNode* CypherParser::LimitContext::SP() { + return getToken(CypherParser::SP, 0); +} + +CypherParser::ExpressionContext* CypherParser::LimitContext::expression() { + return getRuleContext(0); +} + + +size_t CypherParser::LimitContext::getRuleIndex() const { + return CypherParser::RuleLimit; +} + +void CypherParser::LimitContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterLimit(this); +} + +void CypherParser::LimitContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitLimit(this); +} + + +antlrcpp::Any CypherParser::LimitContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLimit(this); + else + return visitor->visitChildren(this); +} + +CypherParser::LimitContext* CypherParser::limit() { + LimitContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 48, CypherParser::RuleLimit); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(441); + match(CypherParser::LIMIT); + setState(442); + match(CypherParser::SP); + setState(443); + expression(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SortItemContext ------------------------------------------------------------------ + +CypherParser::SortItemContext::SortItemContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::ExpressionContext* CypherParser::SortItemContext::expression() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::SortItemContext::ASCENDING() { + return getToken(CypherParser::ASCENDING, 0); +} + +tree::TerminalNode* CypherParser::SortItemContext::ASC() { + return getToken(CypherParser::ASC, 0); +} + +tree::TerminalNode* CypherParser::SortItemContext::DESCENDING() { + return getToken(CypherParser::DESCENDING, 0); +} + +tree::TerminalNode* CypherParser::SortItemContext::DESC() { + return getToken(CypherParser::DESC, 0); +} + +tree::TerminalNode* CypherParser::SortItemContext::SP() { + return getToken(CypherParser::SP, 0); +} + + +size_t CypherParser::SortItemContext::getRuleIndex() const { + return CypherParser::RuleSortItem; +} + +void CypherParser::SortItemContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSortItem(this); +} + +void CypherParser::SortItemContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSortItem(this); +} + + +antlrcpp::Any CypherParser::SortItemContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSortItem(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SortItemContext* CypherParser::sortItem() { + SortItemContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 50, CypherParser::RuleSortItem); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(445); + expression(); + setState(450); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 52, _ctx)) { + case 1: { + setState(447); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(446); + match(CypherParser::SP); + } + setState(449); + _la = _input->LA(1); + if (!(((((_la - 84) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 84)) & ((1ULL << (CypherParser::ASCENDING - 84)) + | (1ULL << (CypherParser::ASC - 84)) + | (1ULL << (CypherParser::DESCENDING - 84)) + | (1ULL << (CypherParser::DESC - 84)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- WhereContext ------------------------------------------------------------------ + +CypherParser::WhereContext::WhereContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::WhereContext::WHERE() { + return getToken(CypherParser::WHERE, 0); +} + +tree::TerminalNode* CypherParser::WhereContext::SP() { + return getToken(CypherParser::SP, 0); +} + +CypherParser::ExpressionContext* CypherParser::WhereContext::expression() { + return getRuleContext(0); +} + + +size_t CypherParser::WhereContext::getRuleIndex() const { + return CypherParser::RuleWhere; +} + +void CypherParser::WhereContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterWhere(this); +} + +void CypherParser::WhereContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitWhere(this); +} + + +antlrcpp::Any CypherParser::WhereContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitWhere(this); + else + return visitor->visitChildren(this); +} + +CypherParser::WhereContext* CypherParser::where() { + WhereContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 52, CypherParser::RuleWhere); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(452); + match(CypherParser::WHERE); + setState(453); + match(CypherParser::SP); + setState(454); + expression(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternContext ------------------------------------------------------------------ + +CypherParser::PatternContext::PatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::PatternContext::patternPart() { + return getRuleContexts(); +} + +CypherParser::PatternPartContext* CypherParser::PatternContext::patternPart(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::PatternContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::PatternContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::PatternContext::getRuleIndex() const { + return CypherParser::RulePattern; +} + +void CypherParser::PatternContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPattern(this); +} + +void CypherParser::PatternContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPattern(this); +} + + +antlrcpp::Any CypherParser::PatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPattern(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PatternContext* CypherParser::pattern() { + PatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 54, CypherParser::RulePattern); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(456); + patternPart(); + setState(467); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 55, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(458); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(457); + match(CypherParser::SP); + } + setState(460); + match(CypherParser::T__1); + setState(462); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(461); + match(CypherParser::SP); + } + setState(464); + patternPart(); + } + setState(469); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 55, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternPartContext ------------------------------------------------------------------ + +CypherParser::PatternPartContext::PatternPartContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::VariableContext* CypherParser::PatternPartContext::variable() { + return getRuleContext(0); +} + +CypherParser::AnonymousPatternPartContext* CypherParser::PatternPartContext::anonymousPatternPart() { + return getRuleContext(0); +} + +std::vector CypherParser::PatternPartContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::PatternPartContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::PatternPartContext::getRuleIndex() const { + return CypherParser::RulePatternPart; +} + +void CypherParser::PatternPartContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPatternPart(this); +} + +void CypherParser::PatternPartContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPatternPart(this); +} + + +antlrcpp::Any CypherParser::PatternPartContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPatternPart(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PatternPartContext* CypherParser::patternPart() { + PatternPartContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 56, CypherParser::RulePatternPart); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(481); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::HexLetter: + case CypherParser::UNION: + case CypherParser::ALL: + case CypherParser::OPTIONAL: + case CypherParser::MATCH: + case CypherParser::UNWIND: + case CypherParser::AS: + case CypherParser::MERGE: + case CypherParser::ON: + case CypherParser::CREATE: + case CypherParser::SET: + case CypherParser::DETACH: + case CypherParser::DELETE: + case CypherParser::REMOVE: + case CypherParser::WITH: + case CypherParser::DISTINCT: + case CypherParser::RETURN: + case CypherParser::ORDER: + case CypherParser::BY: + case CypherParser::L_SKIP: + case CypherParser::LIMIT: + case CypherParser::ASCENDING: + case CypherParser::ASC: + case CypherParser::DESCENDING: + case CypherParser::DESC: + case CypherParser::WHERE: + case CypherParser::OR: + case CypherParser::XOR: + case CypherParser::AND: + case CypherParser::NOT: + case CypherParser::IN: + case CypherParser::STARTS: + case CypherParser::ENDS: + case CypherParser::CONTAINS: + case CypherParser::IS: + case CypherParser::CYPHERNULL: + case CypherParser::COUNT: + case CypherParser::FILTER: + case CypherParser::EXTRACT: + case CypherParser::ANY: + case CypherParser::NONE: + case CypherParser::SINGLE: + case CypherParser::TRUE: + case CypherParser::FALSE: + case CypherParser::UnescapedSymbolicName: + case CypherParser::EscapedSymbolicName: { + enterOuterAlt(_localctx, 1); + setState(470); + variable(); + setState(472); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(471); + match(CypherParser::SP); + } + setState(474); + match(CypherParser::T__2); + setState(476); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(475); + match(CypherParser::SP); + } + setState(478); + anonymousPatternPart(); + break; + } + + case CypherParser::T__5: { + enterOuterAlt(_localctx, 2); + setState(480); + anonymousPatternPart(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AnonymousPatternPartContext ------------------------------------------------------------------ + +CypherParser::AnonymousPatternPartContext::AnonymousPatternPartContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::PatternElementContext* CypherParser::AnonymousPatternPartContext::patternElement() { + return getRuleContext(0); +} + + +size_t CypherParser::AnonymousPatternPartContext::getRuleIndex() const { + return CypherParser::RuleAnonymousPatternPart; +} + +void CypherParser::AnonymousPatternPartContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterAnonymousPatternPart(this); +} + +void CypherParser::AnonymousPatternPartContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitAnonymousPatternPart(this); +} + + +antlrcpp::Any CypherParser::AnonymousPatternPartContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAnonymousPatternPart(this); + else + return visitor->visitChildren(this); +} + +CypherParser::AnonymousPatternPartContext* CypherParser::anonymousPatternPart() { + AnonymousPatternPartContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 58, CypherParser::RuleAnonymousPatternPart); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(483); + patternElement(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternElementContext ------------------------------------------------------------------ + +CypherParser::PatternElementContext::PatternElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::NodePatternContext* CypherParser::PatternElementContext::nodePattern() { + return getRuleContext(0); +} + +std::vector CypherParser::PatternElementContext::patternElementChain() { + return getRuleContexts(); +} + +CypherParser::PatternElementChainContext* CypherParser::PatternElementContext::patternElementChain(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::PatternElementContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::PatternElementContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::PatternElementContext* CypherParser::PatternElementContext::patternElement() { + return getRuleContext(0); +} + + +size_t CypherParser::PatternElementContext::getRuleIndex() const { + return CypherParser::RulePatternElement; +} + +void CypherParser::PatternElementContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPatternElement(this); +} + +void CypherParser::PatternElementContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPatternElement(this); +} + + +antlrcpp::Any CypherParser::PatternElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPatternElement(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PatternElementContext* CypherParser::patternElement() { + PatternElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 60, CypherParser::RulePatternElement); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + setState(499); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 61, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(485); + nodePattern(); + setState(492); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 60, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(487); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(486); + match(CypherParser::SP); + } + setState(489); + patternElementChain(); + } + setState(494); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 60, _ctx); + } + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(495); + match(CypherParser::T__5); + setState(496); + patternElement(); + setState(497); + match(CypherParser::T__6); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NodePatternContext ------------------------------------------------------------------ + +CypherParser::NodePatternContext::NodePatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::NodePatternContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::NodePatternContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::VariableContext* CypherParser::NodePatternContext::variable() { + return getRuleContext(0); +} + +CypherParser::NodeLabelsContext* CypherParser::NodePatternContext::nodeLabels() { + return getRuleContext(0); +} + +CypherParser::PropertiesContext* CypherParser::NodePatternContext::properties() { + return getRuleContext(0); +} + + +size_t CypherParser::NodePatternContext::getRuleIndex() const { + return CypherParser::RuleNodePattern; +} + +void CypherParser::NodePatternContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterNodePattern(this); +} + +void CypherParser::NodePatternContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitNodePattern(this); +} + + +antlrcpp::Any CypherParser::NodePatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNodePattern(this); + else + return visitor->visitChildren(this); +} + +CypherParser::NodePatternContext* CypherParser::nodePattern() { + NodePatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 62, CypherParser::RuleNodePattern); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(501); + match(CypherParser::T__5); + setState(503); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(502); + match(CypherParser::SP); + } + setState(509); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 55) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 55)) & ((1ULL << (CypherParser::HexLetter - 55)) + | (1ULL << (CypherParser::UNION - 55)) + | (1ULL << (CypherParser::ALL - 55)) + | (1ULL << (CypherParser::OPTIONAL - 55)) + | (1ULL << (CypherParser::MATCH - 55)) + | (1ULL << (CypherParser::UNWIND - 55)) + | (1ULL << (CypherParser::AS - 55)) + | (1ULL << (CypherParser::MERGE - 55)) + | (1ULL << (CypherParser::ON - 55)) + | (1ULL << (CypherParser::CREATE - 55)) + | (1ULL << (CypherParser::SET - 55)) + | (1ULL << (CypherParser::DETACH - 55)) + | (1ULL << (CypherParser::DELETE - 55)) + | (1ULL << (CypherParser::REMOVE - 55)) + | (1ULL << (CypherParser::WITH - 55)) + | (1ULL << (CypherParser::DISTINCT - 55)) + | (1ULL << (CypherParser::RETURN - 55)) + | (1ULL << (CypherParser::ORDER - 55)) + | (1ULL << (CypherParser::BY - 55)) + | (1ULL << (CypherParser::L_SKIP - 55)) + | (1ULL << (CypherParser::LIMIT - 55)) + | (1ULL << (CypherParser::ASCENDING - 55)) + | (1ULL << (CypherParser::ASC - 55)) + | (1ULL << (CypherParser::DESCENDING - 55)) + | (1ULL << (CypherParser::DESC - 55)) + | (1ULL << (CypherParser::WHERE - 55)) + | (1ULL << (CypherParser::OR - 55)) + | (1ULL << (CypherParser::XOR - 55)) + | (1ULL << (CypherParser::AND - 55)) + | (1ULL << (CypherParser::NOT - 55)) + | (1ULL << (CypherParser::IN - 55)) + | (1ULL << (CypherParser::STARTS - 55)) + | (1ULL << (CypherParser::ENDS - 55)) + | (1ULL << (CypherParser::CONTAINS - 55)) + | (1ULL << (CypherParser::IS - 55)) + | (1ULL << (CypherParser::CYPHERNULL - 55)) + | (1ULL << (CypherParser::COUNT - 55)) + | (1ULL << (CypherParser::FILTER - 55)) + | (1ULL << (CypherParser::EXTRACT - 55)) + | (1ULL << (CypherParser::ANY - 55)) + | (1ULL << (CypherParser::NONE - 55)) + | (1ULL << (CypherParser::SINGLE - 55)) + | (1ULL << (CypherParser::TRUE - 55)) + | (1ULL << (CypherParser::FALSE - 55)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 55)) + | (1ULL << (CypherParser::EscapedSymbolicName - 55)))) != 0)) { + setState(505); + variable(); + setState(507); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(506); + match(CypherParser::SP); + } + } + setState(515); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__10) { + setState(511); + nodeLabels(); + setState(513); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(512); + match(CypherParser::SP); + } + } + setState(521); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__27 + + || _la == CypherParser::T__29) { + setState(517); + properties(); + setState(519); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(518); + match(CypherParser::SP); + } + } + setState(523); + match(CypherParser::T__6); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternElementChainContext ------------------------------------------------------------------ + +CypherParser::PatternElementChainContext::PatternElementChainContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::RelationshipPatternContext* CypherParser::PatternElementChainContext::relationshipPattern() { + return getRuleContext(0); +} + +CypherParser::NodePatternContext* CypherParser::PatternElementChainContext::nodePattern() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::PatternElementChainContext::SP() { + return getToken(CypherParser::SP, 0); +} + + +size_t CypherParser::PatternElementChainContext::getRuleIndex() const { + return CypherParser::RulePatternElementChain; +} + +void CypherParser::PatternElementChainContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPatternElementChain(this); +} + +void CypherParser::PatternElementChainContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPatternElementChain(this); +} + + +antlrcpp::Any CypherParser::PatternElementChainContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPatternElementChain(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PatternElementChainContext* CypherParser::patternElementChain() { + PatternElementChainContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 64, CypherParser::RulePatternElementChain); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(525); + relationshipPattern(); + setState(527); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(526); + match(CypherParser::SP); + } + setState(529); + nodePattern(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RelationshipPatternContext ------------------------------------------------------------------ + +CypherParser::RelationshipPatternContext::RelationshipPatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::LeftArrowHeadContext* CypherParser::RelationshipPatternContext::leftArrowHead() { + return getRuleContext(0); +} + +std::vector CypherParser::RelationshipPatternContext::dash() { + return getRuleContexts(); +} + +CypherParser::DashContext* CypherParser::RelationshipPatternContext::dash(size_t i) { + return getRuleContext(i); +} + +CypherParser::RightArrowHeadContext* CypherParser::RelationshipPatternContext::rightArrowHead() { + return getRuleContext(0); +} + +std::vector CypherParser::RelationshipPatternContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RelationshipPatternContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::RelationshipDetailContext* CypherParser::RelationshipPatternContext::relationshipDetail() { + return getRuleContext(0); +} + + +size_t CypherParser::RelationshipPatternContext::getRuleIndex() const { + return CypherParser::RuleRelationshipPattern; +} + +void CypherParser::RelationshipPatternContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRelationshipPattern(this); +} + +void CypherParser::RelationshipPatternContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRelationshipPattern(this); +} + + +antlrcpp::Any CypherParser::RelationshipPatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRelationshipPattern(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RelationshipPatternContext* CypherParser::relationshipPattern() { + RelationshipPatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 66, CypherParser::RuleRelationshipPattern); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(595); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 86, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(531); + leftArrowHead(); + setState(533); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(532); + match(CypherParser::SP); + } + setState(535); + dash(); + setState(537); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 71, _ctx)) { + case 1: { + setState(536); + match(CypherParser::SP); + break; + } + + } + setState(540); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__7) { + setState(539); + relationshipDetail(); + } + setState(543); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(542); + match(CypherParser::SP); + } + setState(545); + dash(); + setState(547); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(546); + match(CypherParser::SP); + } + setState(549); + rightArrowHead(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(551); + leftArrowHead(); + setState(553); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(552); + match(CypherParser::SP); + } + setState(555); + dash(); + setState(557); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 76, _ctx)) { + case 1: { + setState(556); + match(CypherParser::SP); + break; + } + + } + setState(560); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__7) { + setState(559); + relationshipDetail(); + } + setState(563); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(562); + match(CypherParser::SP); + } + setState(565); + dash(); + break; + } + + case 3: { + enterOuterAlt(_localctx, 3); + setState(567); + dash(); + setState(569); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 79, _ctx)) { + case 1: { + setState(568); + match(CypherParser::SP); + break; + } + + } + setState(572); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__7) { + setState(571); + relationshipDetail(); + } + setState(575); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(574); + match(CypherParser::SP); + } + setState(577); + dash(); + setState(579); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(578); + match(CypherParser::SP); + } + setState(581); + rightArrowHead(); + break; + } + + case 4: { + enterOuterAlt(_localctx, 4); + setState(583); + dash(); + setState(585); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 83, _ctx)) { + case 1: { + setState(584); + match(CypherParser::SP); + break; + } + + } + setState(588); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__7) { + setState(587); + relationshipDetail(); + } + setState(591); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(590); + match(CypherParser::SP); + } + setState(593); + dash(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RelationshipDetailContext ------------------------------------------------------------------ + +CypherParser::RelationshipDetailContext::RelationshipDetailContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::VariableContext* CypherParser::RelationshipDetailContext::variable() { + return getRuleContext(0); +} + +CypherParser::RelationshipTypesContext* CypherParser::RelationshipDetailContext::relationshipTypes() { + return getRuleContext(0); +} + +CypherParser::RangeLiteralContext* CypherParser::RelationshipDetailContext::rangeLiteral() { + return getRuleContext(0); +} + +CypherParser::PropertiesContext* CypherParser::RelationshipDetailContext::properties() { + return getRuleContext(0); +} + + +size_t CypherParser::RelationshipDetailContext::getRuleIndex() const { + return CypherParser::RuleRelationshipDetail; +} + +void CypherParser::RelationshipDetailContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRelationshipDetail(this); +} + +void CypherParser::RelationshipDetailContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRelationshipDetail(this); +} + + +antlrcpp::Any CypherParser::RelationshipDetailContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRelationshipDetail(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RelationshipDetailContext* CypherParser::relationshipDetail() { + RelationshipDetailContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 68, CypherParser::RuleRelationshipDetail); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(597); + match(CypherParser::T__7); + setState(599); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 55) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 55)) & ((1ULL << (CypherParser::HexLetter - 55)) + | (1ULL << (CypherParser::UNION - 55)) + | (1ULL << (CypherParser::ALL - 55)) + | (1ULL << (CypherParser::OPTIONAL - 55)) + | (1ULL << (CypherParser::MATCH - 55)) + | (1ULL << (CypherParser::UNWIND - 55)) + | (1ULL << (CypherParser::AS - 55)) + | (1ULL << (CypherParser::MERGE - 55)) + | (1ULL << (CypherParser::ON - 55)) + | (1ULL << (CypherParser::CREATE - 55)) + | (1ULL << (CypherParser::SET - 55)) + | (1ULL << (CypherParser::DETACH - 55)) + | (1ULL << (CypherParser::DELETE - 55)) + | (1ULL << (CypherParser::REMOVE - 55)) + | (1ULL << (CypherParser::WITH - 55)) + | (1ULL << (CypherParser::DISTINCT - 55)) + | (1ULL << (CypherParser::RETURN - 55)) + | (1ULL << (CypherParser::ORDER - 55)) + | (1ULL << (CypherParser::BY - 55)) + | (1ULL << (CypherParser::L_SKIP - 55)) + | (1ULL << (CypherParser::LIMIT - 55)) + | (1ULL << (CypherParser::ASCENDING - 55)) + | (1ULL << (CypherParser::ASC - 55)) + | (1ULL << (CypherParser::DESCENDING - 55)) + | (1ULL << (CypherParser::DESC - 55)) + | (1ULL << (CypherParser::WHERE - 55)) + | (1ULL << (CypherParser::OR - 55)) + | (1ULL << (CypherParser::XOR - 55)) + | (1ULL << (CypherParser::AND - 55)) + | (1ULL << (CypherParser::NOT - 55)) + | (1ULL << (CypherParser::IN - 55)) + | (1ULL << (CypherParser::STARTS - 55)) + | (1ULL << (CypherParser::ENDS - 55)) + | (1ULL << (CypherParser::CONTAINS - 55)) + | (1ULL << (CypherParser::IS - 55)) + | (1ULL << (CypherParser::CYPHERNULL - 55)) + | (1ULL << (CypherParser::COUNT - 55)) + | (1ULL << (CypherParser::FILTER - 55)) + | (1ULL << (CypherParser::EXTRACT - 55)) + | (1ULL << (CypherParser::ANY - 55)) + | (1ULL << (CypherParser::NONE - 55)) + | (1ULL << (CypherParser::SINGLE - 55)) + | (1ULL << (CypherParser::TRUE - 55)) + | (1ULL << (CypherParser::FALSE - 55)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 55)) + | (1ULL << (CypherParser::EscapedSymbolicName - 55)))) != 0)) { + setState(598); + variable(); + } + setState(602); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__8) { + setState(601); + match(CypherParser::T__8); + } + setState(605); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__10) { + setState(604); + relationshipTypes(); + } + setState(608); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__4) { + setState(607); + rangeLiteral(); + } + setState(611); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__27 + + || _la == CypherParser::T__29) { + setState(610); + properties(); + } + setState(613); + match(CypherParser::T__9); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PropertiesContext ------------------------------------------------------------------ + +CypherParser::PropertiesContext::PropertiesContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::MapLiteralContext* CypherParser::PropertiesContext::mapLiteral() { + return getRuleContext(0); +} + +CypherParser::ParameterContext* CypherParser::PropertiesContext::parameter() { + return getRuleContext(0); +} + + +size_t CypherParser::PropertiesContext::getRuleIndex() const { + return CypherParser::RuleProperties; +} + +void CypherParser::PropertiesContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterProperties(this); +} + +void CypherParser::PropertiesContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitProperties(this); +} + + +antlrcpp::Any CypherParser::PropertiesContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitProperties(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PropertiesContext* CypherParser::properties() { + PropertiesContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 70, CypherParser::RuleProperties); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(617); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::T__27: { + enterOuterAlt(_localctx, 1); + setState(615); + mapLiteral(); + break; + } + + case CypherParser::T__29: { + enterOuterAlt(_localctx, 2); + setState(616); + parameter(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RelationshipTypesContext ------------------------------------------------------------------ + +CypherParser::RelationshipTypesContext::RelationshipTypesContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::RelationshipTypesContext::relTypeName() { + return getRuleContexts(); +} + +CypherParser::RelTypeNameContext* CypherParser::RelationshipTypesContext::relTypeName(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::RelationshipTypesContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RelationshipTypesContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::RelationshipTypesContext::getRuleIndex() const { + return CypherParser::RuleRelationshipTypes; +} + +void CypherParser::RelationshipTypesContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRelationshipTypes(this); +} + +void CypherParser::RelationshipTypesContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRelationshipTypes(this); +} + + +antlrcpp::Any CypherParser::RelationshipTypesContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRelationshipTypes(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RelationshipTypesContext* CypherParser::relationshipTypes() { + RelationshipTypesContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 72, CypherParser::RuleRelationshipTypes); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(619); + match(CypherParser::T__10); + setState(620); + relTypeName(); + setState(634); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__11 || _la == CypherParser::SP) { + setState(622); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(621); + match(CypherParser::SP); + } + setState(624); + match(CypherParser::T__11); + setState(626); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__10) { + setState(625); + match(CypherParser::T__10); + } + setState(629); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(628); + match(CypherParser::SP); + } + setState(631); + relTypeName(); + setState(636); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NodeLabelsContext ------------------------------------------------------------------ + +CypherParser::NodeLabelsContext::NodeLabelsContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::NodeLabelsContext::nodeLabel() { + return getRuleContexts(); +} + +CypherParser::NodeLabelContext* CypherParser::NodeLabelsContext::nodeLabel(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::NodeLabelsContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::NodeLabelsContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::NodeLabelsContext::getRuleIndex() const { + return CypherParser::RuleNodeLabels; +} + +void CypherParser::NodeLabelsContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterNodeLabels(this); +} + +void CypherParser::NodeLabelsContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitNodeLabels(this); +} + + +antlrcpp::Any CypherParser::NodeLabelsContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNodeLabels(this); + else + return visitor->visitChildren(this); +} + +CypherParser::NodeLabelsContext* CypherParser::nodeLabels() { + NodeLabelsContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 74, CypherParser::RuleNodeLabels); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(637); + nodeLabel(); + setState(644); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 98, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(639); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(638); + match(CypherParser::SP); + } + setState(641); + nodeLabel(); + } + setState(646); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 98, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NodeLabelContext ------------------------------------------------------------------ + +CypherParser::NodeLabelContext::NodeLabelContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::LabelNameContext* CypherParser::NodeLabelContext::labelName() { + return getRuleContext(0); +} + + +size_t CypherParser::NodeLabelContext::getRuleIndex() const { + return CypherParser::RuleNodeLabel; +} + +void CypherParser::NodeLabelContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterNodeLabel(this); +} + +void CypherParser::NodeLabelContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitNodeLabel(this); +} + + +antlrcpp::Any CypherParser::NodeLabelContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNodeLabel(this); + else + return visitor->visitChildren(this); +} + +CypherParser::NodeLabelContext* CypherParser::nodeLabel() { + NodeLabelContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 76, CypherParser::RuleNodeLabel); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(647); + match(CypherParser::T__10); + setState(648); + labelName(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RangeLiteralContext ------------------------------------------------------------------ + +CypherParser::RangeLiteralContext::RangeLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::RangeLiteralContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RangeLiteralContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::RangeLiteralContext::integerLiteral() { + return getRuleContexts(); +} + +CypherParser::IntegerLiteralContext* CypherParser::RangeLiteralContext::integerLiteral(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::RangeLiteralContext::getRuleIndex() const { + return CypherParser::RuleRangeLiteral; +} + +void CypherParser::RangeLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRangeLiteral(this); +} + +void CypherParser::RangeLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRangeLiteral(this); +} + + +antlrcpp::Any CypherParser::RangeLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRangeLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RangeLiteralContext* CypherParser::rangeLiteral() { + RangeLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 78, CypherParser::RuleRangeLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(650); + match(CypherParser::T__4); + setState(652); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(651); + match(CypherParser::SP); + } + setState(658); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger))) != 0)) { + setState(654); + integerLiteral(); + setState(656); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(655); + match(CypherParser::SP); + } + } + setState(670); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__12) { + setState(660); + match(CypherParser::T__12); + setState(662); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(661); + match(CypherParser::SP); + } + setState(668); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger))) != 0)) { + setState(664); + integerLiteral(); + setState(666); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(665); + match(CypherParser::SP); + } + } + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LabelNameContext ------------------------------------------------------------------ + +CypherParser::LabelNameContext::LabelNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SymbolicNameContext* CypherParser::LabelNameContext::symbolicName() { + return getRuleContext(0); +} + + +size_t CypherParser::LabelNameContext::getRuleIndex() const { + return CypherParser::RuleLabelName; +} + +void CypherParser::LabelNameContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterLabelName(this); +} + +void CypherParser::LabelNameContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitLabelName(this); +} + + +antlrcpp::Any CypherParser::LabelNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLabelName(this); + else + return visitor->visitChildren(this); +} + +CypherParser::LabelNameContext* CypherParser::labelName() { + LabelNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 80, CypherParser::RuleLabelName); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(672); + symbolicName(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RelTypeNameContext ------------------------------------------------------------------ + +CypherParser::RelTypeNameContext::RelTypeNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SymbolicNameContext* CypherParser::RelTypeNameContext::symbolicName() { + return getRuleContext(0); +} + + +size_t CypherParser::RelTypeNameContext::getRuleIndex() const { + return CypherParser::RuleRelTypeName; +} + +void CypherParser::RelTypeNameContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRelTypeName(this); +} + +void CypherParser::RelTypeNameContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRelTypeName(this); +} + + +antlrcpp::Any CypherParser::RelTypeNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRelTypeName(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RelTypeNameContext* CypherParser::relTypeName() { + RelTypeNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 82, CypherParser::RuleRelTypeName); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(674); + symbolicName(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ExpressionContext ------------------------------------------------------------------ + +CypherParser::ExpressionContext::ExpressionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::Expression12Context* CypherParser::ExpressionContext::expression12() { + return getRuleContext(0); +} + + +size_t CypherParser::ExpressionContext::getRuleIndex() const { + return CypherParser::RuleExpression; +} + +void CypherParser::ExpressionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression(this); +} + +void CypherParser::ExpressionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression(this); +} + + +antlrcpp::Any CypherParser::ExpressionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ExpressionContext* CypherParser::expression() { + ExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 84, CypherParser::RuleExpression); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(676); + expression12(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression12Context ------------------------------------------------------------------ + +CypherParser::Expression12Context::Expression12Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression12Context::expression11() { + return getRuleContexts(); +} + +CypherParser::Expression11Context* CypherParser::Expression12Context::expression11(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression12Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression12Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::Expression12Context::OR() { + return getTokens(CypherParser::OR); +} + +tree::TerminalNode* CypherParser::Expression12Context::OR(size_t i) { + return getToken(CypherParser::OR, i); +} + + +size_t CypherParser::Expression12Context::getRuleIndex() const { + return CypherParser::RuleExpression12; +} + +void CypherParser::Expression12Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression12(this); +} + +void CypherParser::Expression12Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression12(this); +} + + +antlrcpp::Any CypherParser::Expression12Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression12(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression12Context* CypherParser::expression12() { + Expression12Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 86, CypherParser::RuleExpression12); + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(678); + expression11(); + setState(685); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 106, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(679); + match(CypherParser::SP); + setState(680); + match(CypherParser::OR); + setState(681); + match(CypherParser::SP); + setState(682); + expression11(); + } + setState(687); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 106, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression11Context ------------------------------------------------------------------ + +CypherParser::Expression11Context::Expression11Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression11Context::expression10() { + return getRuleContexts(); +} + +CypherParser::Expression10Context* CypherParser::Expression11Context::expression10(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression11Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression11Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::Expression11Context::XOR() { + return getTokens(CypherParser::XOR); +} + +tree::TerminalNode* CypherParser::Expression11Context::XOR(size_t i) { + return getToken(CypherParser::XOR, i); +} + + +size_t CypherParser::Expression11Context::getRuleIndex() const { + return CypherParser::RuleExpression11; +} + +void CypherParser::Expression11Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression11(this); +} + +void CypherParser::Expression11Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression11(this); +} + + +antlrcpp::Any CypherParser::Expression11Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression11(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression11Context* CypherParser::expression11() { + Expression11Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 88, CypherParser::RuleExpression11); + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(688); + expression10(); + setState(695); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 107, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(689); + match(CypherParser::SP); + setState(690); + match(CypherParser::XOR); + setState(691); + match(CypherParser::SP); + setState(692); + expression10(); + } + setState(697); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 107, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression10Context ------------------------------------------------------------------ + +CypherParser::Expression10Context::Expression10Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression10Context::expression9() { + return getRuleContexts(); +} + +CypherParser::Expression9Context* CypherParser::Expression10Context::expression9(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression10Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression10Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::Expression10Context::AND() { + return getTokens(CypherParser::AND); +} + +tree::TerminalNode* CypherParser::Expression10Context::AND(size_t i) { + return getToken(CypherParser::AND, i); +} + + +size_t CypherParser::Expression10Context::getRuleIndex() const { + return CypherParser::RuleExpression10; +} + +void CypherParser::Expression10Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression10(this); +} + +void CypherParser::Expression10Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression10(this); +} + + +antlrcpp::Any CypherParser::Expression10Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression10(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression10Context* CypherParser::expression10() { + Expression10Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 90, CypherParser::RuleExpression10); + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(698); + expression9(); + setState(705); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 108, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(699); + match(CypherParser::SP); + setState(700); + match(CypherParser::AND); + setState(701); + match(CypherParser::SP); + setState(702); + expression9(); + } + setState(707); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 108, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression9Context ------------------------------------------------------------------ + +CypherParser::Expression9Context::Expression9Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::Expression8Context* CypherParser::Expression9Context::expression8() { + return getRuleContext(0); +} + +std::vector CypherParser::Expression9Context::NOT() { + return getTokens(CypherParser::NOT); +} + +tree::TerminalNode* CypherParser::Expression9Context::NOT(size_t i) { + return getToken(CypherParser::NOT, i); +} + +std::vector CypherParser::Expression9Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression9Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression9Context::getRuleIndex() const { + return CypherParser::RuleExpression9; +} + +void CypherParser::Expression9Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression9(this); +} + +void CypherParser::Expression9Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression9(this); +} + + +antlrcpp::Any CypherParser::Expression9Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression9(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression9Context* CypherParser::expression9() { + Expression9Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 92, CypherParser::RuleExpression9); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(714); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 110, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(708); + match(CypherParser::NOT); + setState(710); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(709); + match(CypherParser::SP); + } + } + setState(716); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 110, _ctx); + } + setState(717); + expression8(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression8Context ------------------------------------------------------------------ + +CypherParser::Expression8Context::Expression8Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::Expression7Context* CypherParser::Expression8Context::expression7() { + return getRuleContext(0); +} + +std::vector CypherParser::Expression8Context::partialComparisonExpression() { + return getRuleContexts(); +} + +CypherParser::PartialComparisonExpressionContext* CypherParser::Expression8Context::partialComparisonExpression(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression8Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression8Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression8Context::getRuleIndex() const { + return CypherParser::RuleExpression8; +} + +void CypherParser::Expression8Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression8(this); +} + +void CypherParser::Expression8Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression8(this); +} + + +antlrcpp::Any CypherParser::Expression8Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression8(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression8Context* CypherParser::expression8() { + Expression8Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 94, CypherParser::RuleExpression8); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(719); + expression7(); + setState(726); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 112, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(721); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(720); + match(CypherParser::SP); + } + setState(723); + partialComparisonExpression(); + } + setState(728); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 112, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression7Context ------------------------------------------------------------------ + +CypherParser::Expression7Context::Expression7Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression7Context::expression6() { + return getRuleContexts(); +} + +CypherParser::Expression6Context* CypherParser::Expression7Context::expression6(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression7Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression7Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression7Context::getRuleIndex() const { + return CypherParser::RuleExpression7; +} + +void CypherParser::Expression7Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression7(this); +} + +void CypherParser::Expression7Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression7(this); +} + + +antlrcpp::Any CypherParser::Expression7Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression7(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression7Context* CypherParser::expression7() { + Expression7Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 96, CypherParser::RuleExpression7); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(729); + expression6(); + setState(748); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 118, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(746); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 117, _ctx)) { + case 1: { + setState(731); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(730); + match(CypherParser::SP); + } + setState(733); + match(CypherParser::T__13); + setState(735); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(734); + match(CypherParser::SP); + } + setState(737); + expression6(); + break; + } + + case 2: { + setState(739); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(738); + match(CypherParser::SP); + } + setState(741); + match(CypherParser::T__14); + setState(743); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(742); + match(CypherParser::SP); + } + setState(745); + expression6(); + break; + } + + } + } + setState(750); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 118, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression6Context ------------------------------------------------------------------ + +CypherParser::Expression6Context::Expression6Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression6Context::expression5() { + return getRuleContexts(); +} + +CypherParser::Expression5Context* CypherParser::Expression6Context::expression5(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression6Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression6Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression6Context::getRuleIndex() const { + return CypherParser::RuleExpression6; +} + +void CypherParser::Expression6Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression6(this); +} + +void CypherParser::Expression6Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression6(this); +} + + +antlrcpp::Any CypherParser::Expression6Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression6(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression6Context* CypherParser::expression6() { + Expression6Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 98, CypherParser::RuleExpression6); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(751); + expression5(); + setState(778); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 126, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(776); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 125, _ctx)) { + case 1: { + setState(753); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(752); + match(CypherParser::SP); + } + setState(755); + match(CypherParser::T__4); + setState(757); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(756); + match(CypherParser::SP); + } + setState(759); + expression5(); + break; + } + + case 2: { + setState(761); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(760); + match(CypherParser::SP); + } + setState(763); + match(CypherParser::T__15); + setState(765); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(764); + match(CypherParser::SP); + } + setState(767); + expression5(); + break; + } + + case 3: { + setState(769); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(768); + match(CypherParser::SP); + } + setState(771); + match(CypherParser::T__16); + setState(773); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(772); + match(CypherParser::SP); + } + setState(775); + expression5(); + break; + } + + } + } + setState(780); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 126, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression5Context ------------------------------------------------------------------ + +CypherParser::Expression5Context::Expression5Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression5Context::expression4() { + return getRuleContexts(); +} + +CypherParser::Expression4Context* CypherParser::Expression5Context::expression4(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression5Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression5Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression5Context::getRuleIndex() const { + return CypherParser::RuleExpression5; +} + +void CypherParser::Expression5Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression5(this); +} + +void CypherParser::Expression5Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression5(this); +} + + +antlrcpp::Any CypherParser::Expression5Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression5(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression5Context* CypherParser::expression5() { + Expression5Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 100, CypherParser::RuleExpression5); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(781); + expression4(); + setState(792); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 129, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(783); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(782); + match(CypherParser::SP); + } + setState(785); + match(CypherParser::T__17); + setState(787); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(786); + match(CypherParser::SP); + } + setState(789); + expression4(); + } + setState(794); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 129, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression4Context ------------------------------------------------------------------ + +CypherParser::Expression4Context::Expression4Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::Expression3Context* CypherParser::Expression4Context::expression3() { + return getRuleContext(0); +} + +std::vector CypherParser::Expression4Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression4Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::Expression4Context::getRuleIndex() const { + return CypherParser::RuleExpression4; +} + +void CypherParser::Expression4Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression4(this); +} + +void CypherParser::Expression4Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression4(this); +} + + +antlrcpp::Any CypherParser::Expression4Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression4(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression4Context* CypherParser::expression4() { + Expression4Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 102, CypherParser::RuleExpression4); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(801); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__13 + + || _la == CypherParser::T__14) { + setState(795); + _la = _input->LA(1); + if (!(_la == CypherParser::T__13 + + || _la == CypherParser::T__14)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(797); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(796); + match(CypherParser::SP); + } + setState(803); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(804); + expression3(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression3Context ------------------------------------------------------------------ + +CypherParser::Expression3Context::Expression3Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::Expression3Context::expression2() { + return getRuleContexts(); +} + +CypherParser::Expression2Context* CypherParser::Expression3Context::expression2(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression3Context::expression() { + return getRuleContexts(); +} + +CypherParser::ExpressionContext* CypherParser::Expression3Context::expression(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression3Context::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::Expression3Context::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::Expression3Context::IS() { + return getTokens(CypherParser::IS); +} + +tree::TerminalNode* CypherParser::Expression3Context::IS(size_t i) { + return getToken(CypherParser::IS, i); +} + +std::vector CypherParser::Expression3Context::CYPHERNULL() { + return getTokens(CypherParser::CYPHERNULL); +} + +tree::TerminalNode* CypherParser::Expression3Context::CYPHERNULL(size_t i) { + return getToken(CypherParser::CYPHERNULL, i); +} + +std::vector CypherParser::Expression3Context::NOT() { + return getTokens(CypherParser::NOT); +} + +tree::TerminalNode* CypherParser::Expression3Context::NOT(size_t i) { + return getToken(CypherParser::NOT, i); +} + +std::vector CypherParser::Expression3Context::IN() { + return getTokens(CypherParser::IN); +} + +tree::TerminalNode* CypherParser::Expression3Context::IN(size_t i) { + return getToken(CypherParser::IN, i); +} + +std::vector CypherParser::Expression3Context::STARTS() { + return getTokens(CypherParser::STARTS); +} + +tree::TerminalNode* CypherParser::Expression3Context::STARTS(size_t i) { + return getToken(CypherParser::STARTS, i); +} + +std::vector CypherParser::Expression3Context::WITH() { + return getTokens(CypherParser::WITH); +} + +tree::TerminalNode* CypherParser::Expression3Context::WITH(size_t i) { + return getToken(CypherParser::WITH, i); +} + +std::vector CypherParser::Expression3Context::ENDS() { + return getTokens(CypherParser::ENDS); +} + +tree::TerminalNode* CypherParser::Expression3Context::ENDS(size_t i) { + return getToken(CypherParser::ENDS, i); +} + +std::vector CypherParser::Expression3Context::CONTAINS() { + return getTokens(CypherParser::CONTAINS); +} + +tree::TerminalNode* CypherParser::Expression3Context::CONTAINS(size_t i) { + return getToken(CypherParser::CONTAINS, i); +} + + +size_t CypherParser::Expression3Context::getRuleIndex() const { + return CypherParser::RuleExpression3; +} + +void CypherParser::Expression3Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression3(this); +} + +void CypherParser::Expression3Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression3(this); +} + + +antlrcpp::Any CypherParser::Expression3Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression3(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression3Context* CypherParser::expression3() { + Expression3Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 104, CypherParser::RuleExpression3); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(806); + expression2(); + setState(860); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 140, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(858); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 139, _ctx)) { + case 1: { + setState(808); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(807); + match(CypherParser::SP); + } + setState(810); + match(CypherParser::T__7); + setState(811); + expression(); + setState(812); + match(CypherParser::T__9); + break; + } + + case 2: { + setState(815); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(814); + match(CypherParser::SP); + } + setState(817); + match(CypherParser::T__7); + setState(819); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__5) + | (1ULL << CypherParser::T__7) + | (1ULL << CypherParser::T__13) + | (1ULL << CypherParser::T__14) + | (1ULL << CypherParser::T__27) + | (1ULL << CypherParser::T__29) + | (1ULL << CypherParser::StringLiteral) + | (1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger) + | (1ULL << CypherParser::HexLetter) + | (1ULL << CypherParser::ExponentDecimalReal) + | (1ULL << CypherParser::RegularDecimalReal))) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 64)) & ((1ULL << (CypherParser::UNION - 64)) + | (1ULL << (CypherParser::ALL - 64)) + | (1ULL << (CypherParser::OPTIONAL - 64)) + | (1ULL << (CypherParser::MATCH - 64)) + | (1ULL << (CypherParser::UNWIND - 64)) + | (1ULL << (CypherParser::AS - 64)) + | (1ULL << (CypherParser::MERGE - 64)) + | (1ULL << (CypherParser::ON - 64)) + | (1ULL << (CypherParser::CREATE - 64)) + | (1ULL << (CypherParser::SET - 64)) + | (1ULL << (CypherParser::DETACH - 64)) + | (1ULL << (CypherParser::DELETE - 64)) + | (1ULL << (CypherParser::REMOVE - 64)) + | (1ULL << (CypherParser::WITH - 64)) + | (1ULL << (CypherParser::DISTINCT - 64)) + | (1ULL << (CypherParser::RETURN - 64)) + | (1ULL << (CypherParser::ORDER - 64)) + | (1ULL << (CypherParser::BY - 64)) + | (1ULL << (CypherParser::L_SKIP - 64)) + | (1ULL << (CypherParser::LIMIT - 64)) + | (1ULL << (CypherParser::ASCENDING - 64)) + | (1ULL << (CypherParser::ASC - 64)) + | (1ULL << (CypherParser::DESCENDING - 64)) + | (1ULL << (CypherParser::DESC - 64)) + | (1ULL << (CypherParser::WHERE - 64)) + | (1ULL << (CypherParser::OR - 64)) + | (1ULL << (CypherParser::XOR - 64)) + | (1ULL << (CypherParser::AND - 64)) + | (1ULL << (CypherParser::NOT - 64)) + | (1ULL << (CypherParser::IN - 64)) + | (1ULL << (CypherParser::STARTS - 64)) + | (1ULL << (CypherParser::ENDS - 64)) + | (1ULL << (CypherParser::CONTAINS - 64)) + | (1ULL << (CypherParser::IS - 64)) + | (1ULL << (CypherParser::CYPHERNULL - 64)) + | (1ULL << (CypherParser::COUNT - 64)) + | (1ULL << (CypherParser::FILTER - 64)) + | (1ULL << (CypherParser::EXTRACT - 64)) + | (1ULL << (CypherParser::ANY - 64)) + | (1ULL << (CypherParser::NONE - 64)) + | (1ULL << (CypherParser::SINGLE - 64)) + | (1ULL << (CypherParser::TRUE - 64)) + | (1ULL << (CypherParser::FALSE - 64)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 64)) + | (1ULL << (CypherParser::EscapedSymbolicName - 64)))) != 0)) { + setState(818); + expression(); + } + setState(821); + match(CypherParser::T__12); + setState(823); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__5) + | (1ULL << CypherParser::T__7) + | (1ULL << CypherParser::T__13) + | (1ULL << CypherParser::T__14) + | (1ULL << CypherParser::T__27) + | (1ULL << CypherParser::T__29) + | (1ULL << CypherParser::StringLiteral) + | (1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger) + | (1ULL << CypherParser::HexLetter) + | (1ULL << CypherParser::ExponentDecimalReal) + | (1ULL << CypherParser::RegularDecimalReal))) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 64)) & ((1ULL << (CypherParser::UNION - 64)) + | (1ULL << (CypherParser::ALL - 64)) + | (1ULL << (CypherParser::OPTIONAL - 64)) + | (1ULL << (CypherParser::MATCH - 64)) + | (1ULL << (CypherParser::UNWIND - 64)) + | (1ULL << (CypherParser::AS - 64)) + | (1ULL << (CypherParser::MERGE - 64)) + | (1ULL << (CypherParser::ON - 64)) + | (1ULL << (CypherParser::CREATE - 64)) + | (1ULL << (CypherParser::SET - 64)) + | (1ULL << (CypherParser::DETACH - 64)) + | (1ULL << (CypherParser::DELETE - 64)) + | (1ULL << (CypherParser::REMOVE - 64)) + | (1ULL << (CypherParser::WITH - 64)) + | (1ULL << (CypherParser::DISTINCT - 64)) + | (1ULL << (CypherParser::RETURN - 64)) + | (1ULL << (CypherParser::ORDER - 64)) + | (1ULL << (CypherParser::BY - 64)) + | (1ULL << (CypherParser::L_SKIP - 64)) + | (1ULL << (CypherParser::LIMIT - 64)) + | (1ULL << (CypherParser::ASCENDING - 64)) + | (1ULL << (CypherParser::ASC - 64)) + | (1ULL << (CypherParser::DESCENDING - 64)) + | (1ULL << (CypherParser::DESC - 64)) + | (1ULL << (CypherParser::WHERE - 64)) + | (1ULL << (CypherParser::OR - 64)) + | (1ULL << (CypherParser::XOR - 64)) + | (1ULL << (CypherParser::AND - 64)) + | (1ULL << (CypherParser::NOT - 64)) + | (1ULL << (CypherParser::IN - 64)) + | (1ULL << (CypherParser::STARTS - 64)) + | (1ULL << (CypherParser::ENDS - 64)) + | (1ULL << (CypherParser::CONTAINS - 64)) + | (1ULL << (CypherParser::IS - 64)) + | (1ULL << (CypherParser::CYPHERNULL - 64)) + | (1ULL << (CypherParser::COUNT - 64)) + | (1ULL << (CypherParser::FILTER - 64)) + | (1ULL << (CypherParser::EXTRACT - 64)) + | (1ULL << (CypherParser::ANY - 64)) + | (1ULL << (CypherParser::NONE - 64)) + | (1ULL << (CypherParser::SINGLE - 64)) + | (1ULL << (CypherParser::TRUE - 64)) + | (1ULL << (CypherParser::FALSE - 64)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 64)) + | (1ULL << (CypherParser::EscapedSymbolicName - 64)))) != 0)) { + setState(822); + expression(); + } + setState(825); + match(CypherParser::T__9); + break; + } + + case 3: { + setState(842); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 137, _ctx)) { + case 1: { + setState(827); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(826); + match(CypherParser::SP); + } + setState(829); + match(CypherParser::T__18); + break; + } + + case 2: { + setState(830); + match(CypherParser::SP); + setState(831); + match(CypherParser::IN); + break; + } + + case 3: { + setState(832); + match(CypherParser::SP); + setState(833); + match(CypherParser::STARTS); + setState(834); + match(CypherParser::SP); + setState(835); + match(CypherParser::WITH); + break; + } + + case 4: { + setState(836); + match(CypherParser::SP); + setState(837); + match(CypherParser::ENDS); + setState(838); + match(CypherParser::SP); + setState(839); + match(CypherParser::WITH); + break; + } + + case 5: { + setState(840); + match(CypherParser::SP); + setState(841); + match(CypherParser::CONTAINS); + break; + } + + } + setState(845); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(844); + match(CypherParser::SP); + } + setState(847); + expression2(); + break; + } + + case 4: { + setState(848); + match(CypherParser::SP); + setState(849); + match(CypherParser::IS); + setState(850); + match(CypherParser::SP); + setState(851); + match(CypherParser::CYPHERNULL); + break; + } + + case 5: { + setState(852); + match(CypherParser::SP); + setState(853); + match(CypherParser::IS); + setState(854); + match(CypherParser::SP); + setState(855); + match(CypherParser::NOT); + setState(856); + match(CypherParser::SP); + setState(857); + match(CypherParser::CYPHERNULL); + break; + } + + } + } + setState(862); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 140, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Expression2Context ------------------------------------------------------------------ + +CypherParser::Expression2Context::Expression2Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::AtomContext* CypherParser::Expression2Context::atom() { + return getRuleContext(0); +} + +std::vector CypherParser::Expression2Context::propertyLookup() { + return getRuleContexts(); +} + +CypherParser::PropertyLookupContext* CypherParser::Expression2Context::propertyLookup(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::Expression2Context::nodeLabels() { + return getRuleContexts(); +} + +CypherParser::NodeLabelsContext* CypherParser::Expression2Context::nodeLabels(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::Expression2Context::getRuleIndex() const { + return CypherParser::RuleExpression2; +} + +void CypherParser::Expression2Context::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterExpression2(this); +} + +void CypherParser::Expression2Context::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitExpression2(this); +} + + +antlrcpp::Any CypherParser::Expression2Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitExpression2(this); + else + return visitor->visitChildren(this); +} + +CypherParser::Expression2Context* CypherParser::expression2() { + Expression2Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 106, CypherParser::RuleExpression2); + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(863); + atom(); + setState(868); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 142, _ctx); + while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { + if (alt == 1) { + setState(866); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::T__25: + case CypherParser::SP: { + setState(864); + propertyLookup(); + break; + } + + case CypherParser::T__10: { + setState(865); + nodeLabels(); + break; + } + + default: + throw NoViableAltException(this); + } + } + setState(870); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 142, _ctx); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AtomContext ------------------------------------------------------------------ + +CypherParser::AtomContext::AtomContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::LiteralContext* CypherParser::AtomContext::literal() { + return getRuleContext(0); +} + +CypherParser::ParameterContext* CypherParser::AtomContext::parameter() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::AtomContext::COUNT() { + return getToken(CypherParser::COUNT, 0); +} + +std::vector CypherParser::AtomContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::AtomContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::ListComprehensionContext* CypherParser::AtomContext::listComprehension() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::AtomContext::FILTER() { + return getToken(CypherParser::FILTER, 0); +} + +CypherParser::FilterExpressionContext* CypherParser::AtomContext::filterExpression() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::AtomContext::EXTRACT() { + return getToken(CypherParser::EXTRACT, 0); +} + +CypherParser::ExpressionContext* CypherParser::AtomContext::expression() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::AtomContext::ALL() { + return getToken(CypherParser::ALL, 0); +} + +tree::TerminalNode* CypherParser::AtomContext::ANY() { + return getToken(CypherParser::ANY, 0); +} + +tree::TerminalNode* CypherParser::AtomContext::NONE() { + return getToken(CypherParser::NONE, 0); +} + +tree::TerminalNode* CypherParser::AtomContext::SINGLE() { + return getToken(CypherParser::SINGLE, 0); +} + +CypherParser::RelationshipsPatternContext* CypherParser::AtomContext::relationshipsPattern() { + return getRuleContext(0); +} + +CypherParser::ParenthesizedExpressionContext* CypherParser::AtomContext::parenthesizedExpression() { + return getRuleContext(0); +} + +CypherParser::FunctionInvocationContext* CypherParser::AtomContext::functionInvocation() { + return getRuleContext(0); +} + +CypherParser::VariableContext* CypherParser::AtomContext::variable() { + return getRuleContext(0); +} + + +size_t CypherParser::AtomContext::getRuleIndex() const { + return CypherParser::RuleAtom; +} + +void CypherParser::AtomContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterAtom(this); +} + +void CypherParser::AtomContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitAtom(this); +} + + +antlrcpp::Any CypherParser::AtomContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAtom(this); + else + return visitor->visitChildren(this); +} + +CypherParser::AtomContext* CypherParser::atom() { + AtomContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 108, CypherParser::RuleAtom); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(982); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 166, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(871); + literal(); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(872); + parameter(); + break; + } + + case 3: { + enterOuterAlt(_localctx, 3); + setState(873); + match(CypherParser::COUNT); + setState(875); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(874); + match(CypherParser::SP); + } + setState(877); + match(CypherParser::T__5); + setState(879); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(878); + match(CypherParser::SP); + } + setState(881); + match(CypherParser::T__4); + setState(883); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(882); + match(CypherParser::SP); + } + setState(885); + match(CypherParser::T__6); + break; + } + + case 4: { + enterOuterAlt(_localctx, 4); + setState(886); + listComprehension(); + break; + } + + case 5: { + enterOuterAlt(_localctx, 5); + setState(887); + match(CypherParser::FILTER); + setState(889); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(888); + match(CypherParser::SP); + } + setState(891); + match(CypherParser::T__5); + setState(893); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(892); + match(CypherParser::SP); + } + setState(895); + filterExpression(); + setState(897); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(896); + match(CypherParser::SP); + } + setState(899); + match(CypherParser::T__6); + break; + } + + case 6: { + enterOuterAlt(_localctx, 6); + setState(901); + match(CypherParser::EXTRACT); + setState(903); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(902); + match(CypherParser::SP); + } + setState(905); + match(CypherParser::T__5); + setState(907); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(906); + match(CypherParser::SP); + } + setState(909); + filterExpression(); + setState(911); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 151, _ctx)) { + case 1: { + setState(910); + match(CypherParser::SP); + break; + } + + } + setState(918); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::T__11 || _la == CypherParser::SP) { + setState(914); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(913); + match(CypherParser::SP); + } + setState(916); + match(CypherParser::T__11); + setState(917); + expression(); + } + setState(920); + match(CypherParser::T__6); + break; + } + + case 7: { + enterOuterAlt(_localctx, 7); + setState(922); + match(CypherParser::ALL); + setState(924); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(923); + match(CypherParser::SP); + } + setState(926); + match(CypherParser::T__5); + setState(928); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(927); + match(CypherParser::SP); + } + setState(930); + filterExpression(); + setState(932); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(931); + match(CypherParser::SP); + } + setState(934); + match(CypherParser::T__6); + break; + } + + case 8: { + enterOuterAlt(_localctx, 8); + setState(936); + match(CypherParser::ANY); + setState(938); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(937); + match(CypherParser::SP); + } + setState(940); + match(CypherParser::T__5); + setState(942); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(941); + match(CypherParser::SP); + } + setState(944); + filterExpression(); + setState(946); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(945); + match(CypherParser::SP); + } + setState(948); + match(CypherParser::T__6); + break; + } + + case 9: { + enterOuterAlt(_localctx, 9); + setState(950); + match(CypherParser::NONE); + setState(952); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(951); + match(CypherParser::SP); + } + setState(954); + match(CypherParser::T__5); + setState(956); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(955); + match(CypherParser::SP); + } + setState(958); + filterExpression(); + setState(960); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(959); + match(CypherParser::SP); + } + setState(962); + match(CypherParser::T__6); + break; + } + + case 10: { + enterOuterAlt(_localctx, 10); + setState(964); + match(CypherParser::SINGLE); + setState(966); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(965); + match(CypherParser::SP); + } + setState(968); + match(CypherParser::T__5); + setState(970); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(969); + match(CypherParser::SP); + } + setState(972); + filterExpression(); + setState(974); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(973); + match(CypherParser::SP); + } + setState(976); + match(CypherParser::T__6); + break; + } + + case 11: { + enterOuterAlt(_localctx, 11); + setState(978); + relationshipsPattern(); + break; + } + + case 12: { + enterOuterAlt(_localctx, 12); + setState(979); + parenthesizedExpression(); + break; + } + + case 13: { + enterOuterAlt(_localctx, 13); + setState(980); + functionInvocation(); + break; + } + + case 14: { + enterOuterAlt(_localctx, 14); + setState(981); + variable(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LiteralContext ------------------------------------------------------------------ + +CypherParser::LiteralContext::LiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::NumberLiteralContext* CypherParser::LiteralContext::numberLiteral() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::LiteralContext::StringLiteral() { + return getToken(CypherParser::StringLiteral, 0); +} + +CypherParser::BooleanLiteralContext* CypherParser::LiteralContext::booleanLiteral() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::LiteralContext::CYPHERNULL() { + return getToken(CypherParser::CYPHERNULL, 0); +} + +CypherParser::MapLiteralContext* CypherParser::LiteralContext::mapLiteral() { + return getRuleContext(0); +} + +CypherParser::ListLiteralContext* CypherParser::LiteralContext::listLiteral() { + return getRuleContext(0); +} + + +size_t CypherParser::LiteralContext::getRuleIndex() const { + return CypherParser::RuleLiteral; +} + +void CypherParser::LiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterLiteral(this); +} + +void CypherParser::LiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitLiteral(this); +} + + +antlrcpp::Any CypherParser::LiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::LiteralContext* CypherParser::literal() { + LiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 110, CypherParser::RuleLiteral); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(990); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::HexInteger: + case CypherParser::DecimalInteger: + case CypherParser::OctalInteger: + case CypherParser::ExponentDecimalReal: + case CypherParser::RegularDecimalReal: { + enterOuterAlt(_localctx, 1); + setState(984); + numberLiteral(); + break; + } + + case CypherParser::StringLiteral: { + enterOuterAlt(_localctx, 2); + setState(985); + match(CypherParser::StringLiteral); + break; + } + + case CypherParser::TRUE: + case CypherParser::FALSE: { + enterOuterAlt(_localctx, 3); + setState(986); + booleanLiteral(); + break; + } + + case CypherParser::CYPHERNULL: { + enterOuterAlt(_localctx, 4); + setState(987); + match(CypherParser::CYPHERNULL); + break; + } + + case CypherParser::T__27: { + enterOuterAlt(_localctx, 5); + setState(988); + mapLiteral(); + break; + } + + case CypherParser::T__7: { + enterOuterAlt(_localctx, 6); + setState(989); + listLiteral(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- BooleanLiteralContext ------------------------------------------------------------------ + +CypherParser::BooleanLiteralContext::BooleanLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::BooleanLiteralContext::TRUE() { + return getToken(CypherParser::TRUE, 0); +} + +tree::TerminalNode* CypherParser::BooleanLiteralContext::FALSE() { + return getToken(CypherParser::FALSE, 0); +} + + +size_t CypherParser::BooleanLiteralContext::getRuleIndex() const { + return CypherParser::RuleBooleanLiteral; +} + +void CypherParser::BooleanLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterBooleanLiteral(this); +} + +void CypherParser::BooleanLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitBooleanLiteral(this); +} + + +antlrcpp::Any CypherParser::BooleanLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitBooleanLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::BooleanLiteralContext* CypherParser::booleanLiteral() { + BooleanLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 112, CypherParser::RuleBooleanLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(992); + _la = _input->LA(1); + if (!(_la == CypherParser::TRUE + + || _la == CypherParser::FALSE)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ListLiteralContext ------------------------------------------------------------------ + +CypherParser::ListLiteralContext::ListLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::ListLiteralContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ListLiteralContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::ListLiteralContext::expression() { + return getRuleContexts(); +} + +CypherParser::ExpressionContext* CypherParser::ListLiteralContext::expression(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::ListLiteralContext::getRuleIndex() const { + return CypherParser::RuleListLiteral; +} + +void CypherParser::ListLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterListLiteral(this); +} + +void CypherParser::ListLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitListLiteral(this); +} + + +antlrcpp::Any CypherParser::ListLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitListLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ListLiteralContext* CypherParser::listLiteral() { + ListLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 114, CypherParser::RuleListLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(994); + match(CypherParser::T__7); + setState(996); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(995); + match(CypherParser::SP); + } + setState(1015); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__5) + | (1ULL << CypherParser::T__7) + | (1ULL << CypherParser::T__13) + | (1ULL << CypherParser::T__14) + | (1ULL << CypherParser::T__27) + | (1ULL << CypherParser::T__29) + | (1ULL << CypherParser::StringLiteral) + | (1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger) + | (1ULL << CypherParser::HexLetter) + | (1ULL << CypherParser::ExponentDecimalReal) + | (1ULL << CypherParser::RegularDecimalReal))) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 64)) & ((1ULL << (CypherParser::UNION - 64)) + | (1ULL << (CypherParser::ALL - 64)) + | (1ULL << (CypherParser::OPTIONAL - 64)) + | (1ULL << (CypherParser::MATCH - 64)) + | (1ULL << (CypherParser::UNWIND - 64)) + | (1ULL << (CypherParser::AS - 64)) + | (1ULL << (CypherParser::MERGE - 64)) + | (1ULL << (CypherParser::ON - 64)) + | (1ULL << (CypherParser::CREATE - 64)) + | (1ULL << (CypherParser::SET - 64)) + | (1ULL << (CypherParser::DETACH - 64)) + | (1ULL << (CypherParser::DELETE - 64)) + | (1ULL << (CypherParser::REMOVE - 64)) + | (1ULL << (CypherParser::WITH - 64)) + | (1ULL << (CypherParser::DISTINCT - 64)) + | (1ULL << (CypherParser::RETURN - 64)) + | (1ULL << (CypherParser::ORDER - 64)) + | (1ULL << (CypherParser::BY - 64)) + | (1ULL << (CypherParser::L_SKIP - 64)) + | (1ULL << (CypherParser::LIMIT - 64)) + | (1ULL << (CypherParser::ASCENDING - 64)) + | (1ULL << (CypherParser::ASC - 64)) + | (1ULL << (CypherParser::DESCENDING - 64)) + | (1ULL << (CypherParser::DESC - 64)) + | (1ULL << (CypherParser::WHERE - 64)) + | (1ULL << (CypherParser::OR - 64)) + | (1ULL << (CypherParser::XOR - 64)) + | (1ULL << (CypherParser::AND - 64)) + | (1ULL << (CypherParser::NOT - 64)) + | (1ULL << (CypherParser::IN - 64)) + | (1ULL << (CypherParser::STARTS - 64)) + | (1ULL << (CypherParser::ENDS - 64)) + | (1ULL << (CypherParser::CONTAINS - 64)) + | (1ULL << (CypherParser::IS - 64)) + | (1ULL << (CypherParser::CYPHERNULL - 64)) + | (1ULL << (CypherParser::COUNT - 64)) + | (1ULL << (CypherParser::FILTER - 64)) + | (1ULL << (CypherParser::EXTRACT - 64)) + | (1ULL << (CypherParser::ANY - 64)) + | (1ULL << (CypherParser::NONE - 64)) + | (1ULL << (CypherParser::SINGLE - 64)) + | (1ULL << (CypherParser::TRUE - 64)) + | (1ULL << (CypherParser::FALSE - 64)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 64)) + | (1ULL << (CypherParser::EscapedSymbolicName - 64)))) != 0)) { + setState(998); + expression(); + setState(1000); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(999); + match(CypherParser::SP); + } + setState(1012); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__1) { + setState(1002); + match(CypherParser::T__1); + setState(1004); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1003); + match(CypherParser::SP); + } + setState(1006); + expression(); + setState(1008); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1007); + match(CypherParser::SP); + } + setState(1014); + _errHandler->sync(this); + _la = _input->LA(1); + } + } + setState(1017); + match(CypherParser::T__9); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PartialComparisonExpressionContext ------------------------------------------------------------------ + +CypherParser::PartialComparisonExpressionContext::PartialComparisonExpressionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::Expression7Context* CypherParser::PartialComparisonExpressionContext::expression7() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::PartialComparisonExpressionContext::SP() { + return getToken(CypherParser::SP, 0); +} + + +size_t CypherParser::PartialComparisonExpressionContext::getRuleIndex() const { + return CypherParser::RulePartialComparisonExpression; +} + +void CypherParser::PartialComparisonExpressionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPartialComparisonExpression(this); +} + +void CypherParser::PartialComparisonExpressionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPartialComparisonExpression(this); +} + + +antlrcpp::Any CypherParser::PartialComparisonExpressionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPartialComparisonExpression(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PartialComparisonExpressionContext* CypherParser::partialComparisonExpression() { + PartialComparisonExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 116, CypherParser::RulePartialComparisonExpression); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(1054); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::T__2: { + enterOuterAlt(_localctx, 1); + setState(1019); + match(CypherParser::T__2); + setState(1021); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1020); + match(CypherParser::SP); + } + setState(1023); + expression7(); + break; + } + + case CypherParser::T__19: { + enterOuterAlt(_localctx, 2); + setState(1024); + match(CypherParser::T__19); + setState(1026); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1025); + match(CypherParser::SP); + } + setState(1028); + expression7(); + break; + } + + case CypherParser::T__20: { + enterOuterAlt(_localctx, 3); + setState(1029); + match(CypherParser::T__20); + setState(1031); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1030); + match(CypherParser::SP); + } + setState(1033); + expression7(); + break; + } + + case CypherParser::T__21: { + enterOuterAlt(_localctx, 4); + setState(1034); + match(CypherParser::T__21); + setState(1036); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1035); + match(CypherParser::SP); + } + setState(1038); + expression7(); + break; + } + + case CypherParser::T__22: { + enterOuterAlt(_localctx, 5); + setState(1039); + match(CypherParser::T__22); + setState(1041); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1040); + match(CypherParser::SP); + } + setState(1043); + expression7(); + break; + } + + case CypherParser::T__23: { + enterOuterAlt(_localctx, 6); + setState(1044); + match(CypherParser::T__23); + setState(1046); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1045); + match(CypherParser::SP); + } + setState(1048); + expression7(); + break; + } + + case CypherParser::T__24: { + enterOuterAlt(_localctx, 7); + setState(1049); + match(CypherParser::T__24); + setState(1051); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1050); + match(CypherParser::SP); + } + setState(1053); + expression7(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ParenthesizedExpressionContext ------------------------------------------------------------------ + +CypherParser::ParenthesizedExpressionContext::ParenthesizedExpressionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::ExpressionContext* CypherParser::ParenthesizedExpressionContext::expression() { + return getRuleContext(0); +} + +std::vector CypherParser::ParenthesizedExpressionContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ParenthesizedExpressionContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::ParenthesizedExpressionContext::getRuleIndex() const { + return CypherParser::RuleParenthesizedExpression; +} + +void CypherParser::ParenthesizedExpressionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterParenthesizedExpression(this); +} + +void CypherParser::ParenthesizedExpressionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitParenthesizedExpression(this); +} + + +antlrcpp::Any CypherParser::ParenthesizedExpressionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitParenthesizedExpression(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ParenthesizedExpressionContext* CypherParser::parenthesizedExpression() { + ParenthesizedExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 118, CypherParser::RuleParenthesizedExpression); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1056); + match(CypherParser::T__5); + setState(1058); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1057); + match(CypherParser::SP); + } + setState(1060); + expression(); + setState(1062); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1061); + match(CypherParser::SP); + } + setState(1064); + match(CypherParser::T__6); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RelationshipsPatternContext ------------------------------------------------------------------ + +CypherParser::RelationshipsPatternContext::RelationshipsPatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::NodePatternContext* CypherParser::RelationshipsPatternContext::nodePattern() { + return getRuleContext(0); +} + +std::vector CypherParser::RelationshipsPatternContext::patternElementChain() { + return getRuleContexts(); +} + +CypherParser::PatternElementChainContext* CypherParser::RelationshipsPatternContext::patternElementChain(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::RelationshipsPatternContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::RelationshipsPatternContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::RelationshipsPatternContext::getRuleIndex() const { + return CypherParser::RuleRelationshipsPattern; +} + +void CypherParser::RelationshipsPatternContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRelationshipsPattern(this); +} + +void CypherParser::RelationshipsPatternContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRelationshipsPattern(this); +} + + +antlrcpp::Any CypherParser::RelationshipsPatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRelationshipsPattern(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RelationshipsPatternContext* CypherParser::relationshipsPattern() { + RelationshipsPatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 120, CypherParser::RuleRelationshipsPattern); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(1066); + nodePattern(); + setState(1071); + _errHandler->sync(this); + alt = 1; + do { + switch (alt) { + case 1: { + setState(1068); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1067); + match(CypherParser::SP); + } + setState(1070); + patternElementChain(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(1073); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 185, _ctx); + } while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FilterExpressionContext ------------------------------------------------------------------ + +CypherParser::FilterExpressionContext::FilterExpressionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::IdInCollContext* CypherParser::FilterExpressionContext::idInColl() { + return getRuleContext(0); +} + +CypherParser::WhereContext* CypherParser::FilterExpressionContext::where() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::FilterExpressionContext::SP() { + return getToken(CypherParser::SP, 0); +} + + +size_t CypherParser::FilterExpressionContext::getRuleIndex() const { + return CypherParser::RuleFilterExpression; +} + +void CypherParser::FilterExpressionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterFilterExpression(this); +} + +void CypherParser::FilterExpressionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitFilterExpression(this); +} + + +antlrcpp::Any CypherParser::FilterExpressionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFilterExpression(this); + else + return visitor->visitChildren(this); +} + +CypherParser::FilterExpressionContext* CypherParser::filterExpression() { + FilterExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 122, CypherParser::RuleFilterExpression); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1075); + idInColl(); + setState(1080); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 187, _ctx)) { + case 1: { + setState(1077); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1076); + match(CypherParser::SP); + } + setState(1079); + where(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- IdInCollContext ------------------------------------------------------------------ + +CypherParser::IdInCollContext::IdInCollContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::VariableContext* CypherParser::IdInCollContext::variable() { + return getRuleContext(0); +} + +std::vector CypherParser::IdInCollContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::IdInCollContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::IdInCollContext::IN() { + return getToken(CypherParser::IN, 0); +} + +CypherParser::ExpressionContext* CypherParser::IdInCollContext::expression() { + return getRuleContext(0); +} + + +size_t CypherParser::IdInCollContext::getRuleIndex() const { + return CypherParser::RuleIdInColl; +} + +void CypherParser::IdInCollContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterIdInColl(this); +} + +void CypherParser::IdInCollContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitIdInColl(this); +} + + +antlrcpp::Any CypherParser::IdInCollContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitIdInColl(this); + else + return visitor->visitChildren(this); +} + +CypherParser::IdInCollContext* CypherParser::idInColl() { + IdInCollContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 124, CypherParser::RuleIdInColl); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1082); + variable(); + setState(1083); + match(CypherParser::SP); + setState(1084); + match(CypherParser::IN); + setState(1085); + match(CypherParser::SP); + setState(1086); + expression(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FunctionInvocationContext ------------------------------------------------------------------ + +CypherParser::FunctionInvocationContext::FunctionInvocationContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::FunctionNameContext* CypherParser::FunctionInvocationContext::functionName() { + return getRuleContext(0); +} + +std::vector CypherParser::FunctionInvocationContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::FunctionInvocationContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +tree::TerminalNode* CypherParser::FunctionInvocationContext::DISTINCT() { + return getToken(CypherParser::DISTINCT, 0); +} + +std::vector CypherParser::FunctionInvocationContext::expression() { + return getRuleContexts(); +} + +CypherParser::ExpressionContext* CypherParser::FunctionInvocationContext::expression(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::FunctionInvocationContext::getRuleIndex() const { + return CypherParser::RuleFunctionInvocation; +} + +void CypherParser::FunctionInvocationContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterFunctionInvocation(this); +} + +void CypherParser::FunctionInvocationContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitFunctionInvocation(this); +} + + +antlrcpp::Any CypherParser::FunctionInvocationContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFunctionInvocation(this); + else + return visitor->visitChildren(this); +} + +CypherParser::FunctionInvocationContext* CypherParser::functionInvocation() { + FunctionInvocationContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 126, CypherParser::RuleFunctionInvocation); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1088); + functionName(); + setState(1090); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1089); + match(CypherParser::SP); + } + setState(1092); + match(CypherParser::T__5); + setState(1094); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1093); + match(CypherParser::SP); + } + setState(1100); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 191, _ctx)) { + case 1: { + setState(1096); + match(CypherParser::DISTINCT); + setState(1098); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1097); + match(CypherParser::SP); + } + break; + } + + } + setState(1119); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__5) + | (1ULL << CypherParser::T__7) + | (1ULL << CypherParser::T__13) + | (1ULL << CypherParser::T__14) + | (1ULL << CypherParser::T__27) + | (1ULL << CypherParser::T__29) + | (1ULL << CypherParser::StringLiteral) + | (1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger) + | (1ULL << CypherParser::HexLetter) + | (1ULL << CypherParser::ExponentDecimalReal) + | (1ULL << CypherParser::RegularDecimalReal))) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 64)) & ((1ULL << (CypherParser::UNION - 64)) + | (1ULL << (CypherParser::ALL - 64)) + | (1ULL << (CypherParser::OPTIONAL - 64)) + | (1ULL << (CypherParser::MATCH - 64)) + | (1ULL << (CypherParser::UNWIND - 64)) + | (1ULL << (CypherParser::AS - 64)) + | (1ULL << (CypherParser::MERGE - 64)) + | (1ULL << (CypherParser::ON - 64)) + | (1ULL << (CypherParser::CREATE - 64)) + | (1ULL << (CypherParser::SET - 64)) + | (1ULL << (CypherParser::DETACH - 64)) + | (1ULL << (CypherParser::DELETE - 64)) + | (1ULL << (CypherParser::REMOVE - 64)) + | (1ULL << (CypherParser::WITH - 64)) + | (1ULL << (CypherParser::DISTINCT - 64)) + | (1ULL << (CypherParser::RETURN - 64)) + | (1ULL << (CypherParser::ORDER - 64)) + | (1ULL << (CypherParser::BY - 64)) + | (1ULL << (CypherParser::L_SKIP - 64)) + | (1ULL << (CypherParser::LIMIT - 64)) + | (1ULL << (CypherParser::ASCENDING - 64)) + | (1ULL << (CypherParser::ASC - 64)) + | (1ULL << (CypherParser::DESCENDING - 64)) + | (1ULL << (CypherParser::DESC - 64)) + | (1ULL << (CypherParser::WHERE - 64)) + | (1ULL << (CypherParser::OR - 64)) + | (1ULL << (CypherParser::XOR - 64)) + | (1ULL << (CypherParser::AND - 64)) + | (1ULL << (CypherParser::NOT - 64)) + | (1ULL << (CypherParser::IN - 64)) + | (1ULL << (CypherParser::STARTS - 64)) + | (1ULL << (CypherParser::ENDS - 64)) + | (1ULL << (CypherParser::CONTAINS - 64)) + | (1ULL << (CypherParser::IS - 64)) + | (1ULL << (CypherParser::CYPHERNULL - 64)) + | (1ULL << (CypherParser::COUNT - 64)) + | (1ULL << (CypherParser::FILTER - 64)) + | (1ULL << (CypherParser::EXTRACT - 64)) + | (1ULL << (CypherParser::ANY - 64)) + | (1ULL << (CypherParser::NONE - 64)) + | (1ULL << (CypherParser::SINGLE - 64)) + | (1ULL << (CypherParser::TRUE - 64)) + | (1ULL << (CypherParser::FALSE - 64)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 64)) + | (1ULL << (CypherParser::EscapedSymbolicName - 64)))) != 0)) { + setState(1102); + expression(); + setState(1104); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1103); + match(CypherParser::SP); + } + setState(1116); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__1) { + setState(1106); + match(CypherParser::T__1); + setState(1108); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1107); + match(CypherParser::SP); + } + setState(1110); + expression(); + setState(1112); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1111); + match(CypherParser::SP); + } + setState(1118); + _errHandler->sync(this); + _la = _input->LA(1); + } + } + setState(1121); + match(CypherParser::T__6); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FunctionNameContext ------------------------------------------------------------------ + +CypherParser::FunctionNameContext::FunctionNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::FunctionNameContext::UnescapedSymbolicName() { + return getToken(CypherParser::UnescapedSymbolicName, 0); +} + +tree::TerminalNode* CypherParser::FunctionNameContext::EscapedSymbolicName() { + return getToken(CypherParser::EscapedSymbolicName, 0); +} + +tree::TerminalNode* CypherParser::FunctionNameContext::COUNT() { + return getToken(CypherParser::COUNT, 0); +} + + +size_t CypherParser::FunctionNameContext::getRuleIndex() const { + return CypherParser::RuleFunctionName; +} + +void CypherParser::FunctionNameContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterFunctionName(this); +} + +void CypherParser::FunctionNameContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitFunctionName(this); +} + + +antlrcpp::Any CypherParser::FunctionNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFunctionName(this); + else + return visitor->visitChildren(this); +} + +CypherParser::FunctionNameContext* CypherParser::functionName() { + FunctionNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 128, CypherParser::RuleFunctionName); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1123); + _la = _input->LA(1); + if (!(((((_la - 99) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 99)) & ((1ULL << (CypherParser::COUNT - 99)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 99)) + | (1ULL << (CypherParser::EscapedSymbolicName - 99)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ListComprehensionContext ------------------------------------------------------------------ + +CypherParser::ListComprehensionContext::ListComprehensionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::FilterExpressionContext* CypherParser::ListComprehensionContext::filterExpression() { + return getRuleContext(0); +} + +std::vector CypherParser::ListComprehensionContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::ListComprehensionContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +CypherParser::ExpressionContext* CypherParser::ListComprehensionContext::expression() { + return getRuleContext(0); +} + + +size_t CypherParser::ListComprehensionContext::getRuleIndex() const { + return CypherParser::RuleListComprehension; +} + +void CypherParser::ListComprehensionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterListComprehension(this); +} + +void CypherParser::ListComprehensionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitListComprehension(this); +} + + +antlrcpp::Any CypherParser::ListComprehensionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitListComprehension(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ListComprehensionContext* CypherParser::listComprehension() { + ListComprehensionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 130, CypherParser::RuleListComprehension); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1125); + match(CypherParser::T__7); + setState(1127); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1126); + match(CypherParser::SP); + } + setState(1129); + filterExpression(); + setState(1138); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 200, _ctx)) { + case 1: { + setState(1131); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1130); + match(CypherParser::SP); + } + setState(1133); + match(CypherParser::T__11); + setState(1135); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1134); + match(CypherParser::SP); + } + setState(1137); + expression(); + break; + } + + } + setState(1141); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1140); + match(CypherParser::SP); + } + setState(1143); + match(CypherParser::T__9); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PropertyLookupContext ------------------------------------------------------------------ + +CypherParser::PropertyLookupContext::PropertyLookupContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::PropertyKeyNameContext* CypherParser::PropertyLookupContext::propertyKeyName() { + return getRuleContext(0); +} + +std::vector CypherParser::PropertyLookupContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::PropertyLookupContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::PropertyLookupContext::getRuleIndex() const { + return CypherParser::RulePropertyLookup; +} + +void CypherParser::PropertyLookupContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPropertyLookup(this); +} + +void CypherParser::PropertyLookupContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPropertyLookup(this); +} + + +antlrcpp::Any CypherParser::PropertyLookupContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPropertyLookup(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PropertyLookupContext* CypherParser::propertyLookup() { + PropertyLookupContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 132, CypherParser::RulePropertyLookup); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1146); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1145); + match(CypherParser::SP); + } + setState(1148); + match(CypherParser::T__25); + setState(1150); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1149); + match(CypherParser::SP); + } + setState(1156); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 204, _ctx)) { + case 1: { + setState(1152); + propertyKeyName(); + setState(1153); + _la = _input->LA(1); + if (!(_la == CypherParser::T__8 + + || _la == CypherParser::T__26)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + break; + } + + case 2: { + setState(1155); + propertyKeyName(); + break; + } + + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VariableContext ------------------------------------------------------------------ + +CypherParser::VariableContext::VariableContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SymbolicNameContext* CypherParser::VariableContext::symbolicName() { + return getRuleContext(0); +} + + +size_t CypherParser::VariableContext::getRuleIndex() const { + return CypherParser::RuleVariable; +} + +void CypherParser::VariableContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterVariable(this); +} + +void CypherParser::VariableContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitVariable(this); +} + + +antlrcpp::Any CypherParser::VariableContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVariable(this); + else + return visitor->visitChildren(this); +} + +CypherParser::VariableContext* CypherParser::variable() { + VariableContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 134, CypherParser::RuleVariable); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1158); + symbolicName(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NumberLiteralContext ------------------------------------------------------------------ + +CypherParser::NumberLiteralContext::NumberLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::DoubleLiteralContext* CypherParser::NumberLiteralContext::doubleLiteral() { + return getRuleContext(0); +} + +CypherParser::IntegerLiteralContext* CypherParser::NumberLiteralContext::integerLiteral() { + return getRuleContext(0); +} + + +size_t CypherParser::NumberLiteralContext::getRuleIndex() const { + return CypherParser::RuleNumberLiteral; +} + +void CypherParser::NumberLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterNumberLiteral(this); +} + +void CypherParser::NumberLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitNumberLiteral(this); +} + + +antlrcpp::Any CypherParser::NumberLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNumberLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::NumberLiteralContext* CypherParser::numberLiteral() { + NumberLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 136, CypherParser::RuleNumberLiteral); + + auto onExit = finally([=] { + exitRule(); + }); + try { + setState(1162); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::ExponentDecimalReal: + case CypherParser::RegularDecimalReal: { + enterOuterAlt(_localctx, 1); + setState(1160); + doubleLiteral(); + break; + } + + case CypherParser::HexInteger: + case CypherParser::DecimalInteger: + case CypherParser::OctalInteger: { + enterOuterAlt(_localctx, 2); + setState(1161); + integerLiteral(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- MapLiteralContext ------------------------------------------------------------------ + +CypherParser::MapLiteralContext::MapLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector CypherParser::MapLiteralContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::MapLiteralContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + +std::vector CypherParser::MapLiteralContext::propertyKeyName() { + return getRuleContexts(); +} + +CypherParser::PropertyKeyNameContext* CypherParser::MapLiteralContext::propertyKeyName(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::MapLiteralContext::expression() { + return getRuleContexts(); +} + +CypherParser::ExpressionContext* CypherParser::MapLiteralContext::expression(size_t i) { + return getRuleContext(i); +} + + +size_t CypherParser::MapLiteralContext::getRuleIndex() const { + return CypherParser::RuleMapLiteral; +} + +void CypherParser::MapLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterMapLiteral(this); +} + +void CypherParser::MapLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitMapLiteral(this); +} + + +antlrcpp::Any CypherParser::MapLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitMapLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::MapLiteralContext* CypherParser::mapLiteral() { + MapLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 138, CypherParser::RuleMapLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1164); + match(CypherParser::T__27); + setState(1166); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1165); + match(CypherParser::SP); + } + setState(1201); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 55) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 55)) & ((1ULL << (CypherParser::HexLetter - 55)) + | (1ULL << (CypherParser::UNION - 55)) + | (1ULL << (CypherParser::ALL - 55)) + | (1ULL << (CypherParser::OPTIONAL - 55)) + | (1ULL << (CypherParser::MATCH - 55)) + | (1ULL << (CypherParser::UNWIND - 55)) + | (1ULL << (CypherParser::AS - 55)) + | (1ULL << (CypherParser::MERGE - 55)) + | (1ULL << (CypherParser::ON - 55)) + | (1ULL << (CypherParser::CREATE - 55)) + | (1ULL << (CypherParser::SET - 55)) + | (1ULL << (CypherParser::DETACH - 55)) + | (1ULL << (CypherParser::DELETE - 55)) + | (1ULL << (CypherParser::REMOVE - 55)) + | (1ULL << (CypherParser::WITH - 55)) + | (1ULL << (CypherParser::DISTINCT - 55)) + | (1ULL << (CypherParser::RETURN - 55)) + | (1ULL << (CypherParser::ORDER - 55)) + | (1ULL << (CypherParser::BY - 55)) + | (1ULL << (CypherParser::L_SKIP - 55)) + | (1ULL << (CypherParser::LIMIT - 55)) + | (1ULL << (CypherParser::ASCENDING - 55)) + | (1ULL << (CypherParser::ASC - 55)) + | (1ULL << (CypherParser::DESCENDING - 55)) + | (1ULL << (CypherParser::DESC - 55)) + | (1ULL << (CypherParser::WHERE - 55)) + | (1ULL << (CypherParser::OR - 55)) + | (1ULL << (CypherParser::XOR - 55)) + | (1ULL << (CypherParser::AND - 55)) + | (1ULL << (CypherParser::NOT - 55)) + | (1ULL << (CypherParser::IN - 55)) + | (1ULL << (CypherParser::STARTS - 55)) + | (1ULL << (CypherParser::ENDS - 55)) + | (1ULL << (CypherParser::CONTAINS - 55)) + | (1ULL << (CypherParser::IS - 55)) + | (1ULL << (CypherParser::CYPHERNULL - 55)) + | (1ULL << (CypherParser::COUNT - 55)) + | (1ULL << (CypherParser::FILTER - 55)) + | (1ULL << (CypherParser::EXTRACT - 55)) + | (1ULL << (CypherParser::ANY - 55)) + | (1ULL << (CypherParser::NONE - 55)) + | (1ULL << (CypherParser::SINGLE - 55)) + | (1ULL << (CypherParser::TRUE - 55)) + | (1ULL << (CypherParser::FALSE - 55)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 55)) + | (1ULL << (CypherParser::EscapedSymbolicName - 55)))) != 0)) { + setState(1168); + propertyKeyName(); + setState(1170); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1169); + match(CypherParser::SP); + } + setState(1172); + match(CypherParser::T__10); + setState(1174); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1173); + match(CypherParser::SP); + } + setState(1176); + expression(); + setState(1178); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1177); + match(CypherParser::SP); + } + setState(1198); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == CypherParser::T__1) { + setState(1180); + match(CypherParser::T__1); + setState(1182); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1181); + match(CypherParser::SP); + } + setState(1184); + propertyKeyName(); + setState(1186); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1185); + match(CypherParser::SP); + } + setState(1188); + match(CypherParser::T__10); + setState(1190); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1189); + match(CypherParser::SP); + } + setState(1192); + expression(); + setState(1194); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == CypherParser::SP) { + setState(1193); + match(CypherParser::SP); + } + setState(1200); + _errHandler->sync(this); + _la = _input->LA(1); + } + } + setState(1203); + match(CypherParser::T__28); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ParameterContext ------------------------------------------------------------------ + +CypherParser::ParameterContext::ParameterContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SymbolicNameContext* CypherParser::ParameterContext::symbolicName() { + return getRuleContext(0); +} + +tree::TerminalNode* CypherParser::ParameterContext::DecimalInteger() { + return getToken(CypherParser::DecimalInteger, 0); +} + + +size_t CypherParser::ParameterContext::getRuleIndex() const { + return CypherParser::RuleParameter; +} + +void CypherParser::ParameterContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterParameter(this); +} + +void CypherParser::ParameterContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitParameter(this); +} + + +antlrcpp::Any CypherParser::ParameterContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitParameter(this); + else + return visitor->visitChildren(this); +} + +CypherParser::ParameterContext* CypherParser::parameter() { + ParameterContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 140, CypherParser::RuleParameter); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1205); + match(CypherParser::T__29); + setState(1208); + _errHandler->sync(this); + switch (_input->LA(1)) { + case CypherParser::HexLetter: + case CypherParser::UNION: + case CypherParser::ALL: + case CypherParser::OPTIONAL: + case CypherParser::MATCH: + case CypherParser::UNWIND: + case CypherParser::AS: + case CypherParser::MERGE: + case CypherParser::ON: + case CypherParser::CREATE: + case CypherParser::SET: + case CypherParser::DETACH: + case CypherParser::DELETE: + case CypherParser::REMOVE: + case CypherParser::WITH: + case CypherParser::DISTINCT: + case CypherParser::RETURN: + case CypherParser::ORDER: + case CypherParser::BY: + case CypherParser::L_SKIP: + case CypherParser::LIMIT: + case CypherParser::ASCENDING: + case CypherParser::ASC: + case CypherParser::DESCENDING: + case CypherParser::DESC: + case CypherParser::WHERE: + case CypherParser::OR: + case CypherParser::XOR: + case CypherParser::AND: + case CypherParser::NOT: + case CypherParser::IN: + case CypherParser::STARTS: + case CypherParser::ENDS: + case CypherParser::CONTAINS: + case CypherParser::IS: + case CypherParser::CYPHERNULL: + case CypherParser::COUNT: + case CypherParser::FILTER: + case CypherParser::EXTRACT: + case CypherParser::ANY: + case CypherParser::NONE: + case CypherParser::SINGLE: + case CypherParser::TRUE: + case CypherParser::FALSE: + case CypherParser::UnescapedSymbolicName: + case CypherParser::EscapedSymbolicName: { + setState(1206); + symbolicName(); + break; + } + + case CypherParser::DecimalInteger: { + setState(1207); + match(CypherParser::DecimalInteger); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PropertyExpressionContext ------------------------------------------------------------------ + +CypherParser::PropertyExpressionContext::PropertyExpressionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::AtomContext* CypherParser::PropertyExpressionContext::atom() { + return getRuleContext(0); +} + +std::vector CypherParser::PropertyExpressionContext::propertyLookup() { + return getRuleContexts(); +} + +CypherParser::PropertyLookupContext* CypherParser::PropertyExpressionContext::propertyLookup(size_t i) { + return getRuleContext(i); +} + +std::vector CypherParser::PropertyExpressionContext::SP() { + return getTokens(CypherParser::SP); +} + +tree::TerminalNode* CypherParser::PropertyExpressionContext::SP(size_t i) { + return getToken(CypherParser::SP, i); +} + + +size_t CypherParser::PropertyExpressionContext::getRuleIndex() const { + return CypherParser::RulePropertyExpression; +} + +void CypherParser::PropertyExpressionContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPropertyExpression(this); +} + +void CypherParser::PropertyExpressionContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPropertyExpression(this); +} + + +antlrcpp::Any CypherParser::PropertyExpressionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPropertyExpression(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PropertyExpressionContext* CypherParser::propertyExpression() { + PropertyExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 142, CypherParser::RulePropertyExpression); + + auto onExit = finally([=] { + exitRule(); + }); + try { + size_t alt; + enterOuterAlt(_localctx, 1); + setState(1210); + atom(); + setState(1215); + _errHandler->sync(this); + alt = 1; + do { + switch (alt) { + case 1: { + setState(1212); + _errHandler->sync(this); + + switch (getInterpreter()->adaptivePredict(_input, 217, _ctx)) { + case 1: { + setState(1211); + match(CypherParser::SP); + break; + } + + } + setState(1214); + propertyLookup(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(1217); + _errHandler->sync(this); + alt = getInterpreter()->adaptivePredict(_input, 218, _ctx); + } while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PropertyKeyNameContext ------------------------------------------------------------------ + +CypherParser::PropertyKeyNameContext::PropertyKeyNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +CypherParser::SymbolicNameContext* CypherParser::PropertyKeyNameContext::symbolicName() { + return getRuleContext(0); +} + + +size_t CypherParser::PropertyKeyNameContext::getRuleIndex() const { + return CypherParser::RulePropertyKeyName; +} + +void CypherParser::PropertyKeyNameContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterPropertyKeyName(this); +} + +void CypherParser::PropertyKeyNameContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitPropertyKeyName(this); +} + + +antlrcpp::Any CypherParser::PropertyKeyNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPropertyKeyName(this); + else + return visitor->visitChildren(this); +} + +CypherParser::PropertyKeyNameContext* CypherParser::propertyKeyName() { + PropertyKeyNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 144, CypherParser::RulePropertyKeyName); + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1219); + symbolicName(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- IntegerLiteralContext ------------------------------------------------------------------ + +CypherParser::IntegerLiteralContext::IntegerLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::IntegerLiteralContext::HexInteger() { + return getToken(CypherParser::HexInteger, 0); +} + +tree::TerminalNode* CypherParser::IntegerLiteralContext::OctalInteger() { + return getToken(CypherParser::OctalInteger, 0); +} + +tree::TerminalNode* CypherParser::IntegerLiteralContext::DecimalInteger() { + return getToken(CypherParser::DecimalInteger, 0); +} + + +size_t CypherParser::IntegerLiteralContext::getRuleIndex() const { + return CypherParser::RuleIntegerLiteral; +} + +void CypherParser::IntegerLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterIntegerLiteral(this); +} + +void CypherParser::IntegerLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitIntegerLiteral(this); +} + + +antlrcpp::Any CypherParser::IntegerLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitIntegerLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::IntegerLiteralContext* CypherParser::integerLiteral() { + IntegerLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 146, CypherParser::RuleIntegerLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1221); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::HexInteger) + | (1ULL << CypherParser::DecimalInteger) + | (1ULL << CypherParser::OctalInteger))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- DoubleLiteralContext ------------------------------------------------------------------ + +CypherParser::DoubleLiteralContext::DoubleLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::DoubleLiteralContext::ExponentDecimalReal() { + return getToken(CypherParser::ExponentDecimalReal, 0); +} + +tree::TerminalNode* CypherParser::DoubleLiteralContext::RegularDecimalReal() { + return getToken(CypherParser::RegularDecimalReal, 0); +} + + +size_t CypherParser::DoubleLiteralContext::getRuleIndex() const { + return CypherParser::RuleDoubleLiteral; +} + +void CypherParser::DoubleLiteralContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterDoubleLiteral(this); +} + +void CypherParser::DoubleLiteralContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitDoubleLiteral(this); +} + + +antlrcpp::Any CypherParser::DoubleLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitDoubleLiteral(this); + else + return visitor->visitChildren(this); +} + +CypherParser::DoubleLiteralContext* CypherParser::doubleLiteral() { + DoubleLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 148, CypherParser::RuleDoubleLiteral); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1223); + _la = _input->LA(1); + if (!(_la == CypherParser::ExponentDecimalReal + + || _la == CypherParser::RegularDecimalReal)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SymbolicNameContext ------------------------------------------------------------------ + +CypherParser::SymbolicNameContext::SymbolicNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::UnescapedSymbolicName() { + return getToken(CypherParser::UnescapedSymbolicName, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::EscapedSymbolicName() { + return getToken(CypherParser::EscapedSymbolicName, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::UNION() { + return getToken(CypherParser::UNION, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ALL() { + return getToken(CypherParser::ALL, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::OPTIONAL() { + return getToken(CypherParser::OPTIONAL, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::MATCH() { + return getToken(CypherParser::MATCH, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::UNWIND() { + return getToken(CypherParser::UNWIND, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::AS() { + return getToken(CypherParser::AS, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::MERGE() { + return getToken(CypherParser::MERGE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ON() { + return getToken(CypherParser::ON, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::CREATE() { + return getToken(CypherParser::CREATE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::SET() { + return getToken(CypherParser::SET, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::DETACH() { + return getToken(CypherParser::DETACH, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::DELETE() { + return getToken(CypherParser::DELETE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::REMOVE() { + return getToken(CypherParser::REMOVE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::WITH() { + return getToken(CypherParser::WITH, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::DISTINCT() { + return getToken(CypherParser::DISTINCT, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::RETURN() { + return getToken(CypherParser::RETURN, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ORDER() { + return getToken(CypherParser::ORDER, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::BY() { + return getToken(CypherParser::BY, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::L_SKIP() { + return getToken(CypherParser::L_SKIP, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::LIMIT() { + return getToken(CypherParser::LIMIT, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ASCENDING() { + return getToken(CypherParser::ASCENDING, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ASC() { + return getToken(CypherParser::ASC, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::DESCENDING() { + return getToken(CypherParser::DESCENDING, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::DESC() { + return getToken(CypherParser::DESC, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::WHERE() { + return getToken(CypherParser::WHERE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::OR() { + return getToken(CypherParser::OR, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::XOR() { + return getToken(CypherParser::XOR, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::AND() { + return getToken(CypherParser::AND, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::NOT() { + return getToken(CypherParser::NOT, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::IN() { + return getToken(CypherParser::IN, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::STARTS() { + return getToken(CypherParser::STARTS, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ENDS() { + return getToken(CypherParser::ENDS, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::CONTAINS() { + return getToken(CypherParser::CONTAINS, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::IS() { + return getToken(CypherParser::IS, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::CYPHERNULL() { + return getToken(CypherParser::CYPHERNULL, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::COUNT() { + return getToken(CypherParser::COUNT, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::FILTER() { + return getToken(CypherParser::FILTER, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::EXTRACT() { + return getToken(CypherParser::EXTRACT, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::ANY() { + return getToken(CypherParser::ANY, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::NONE() { + return getToken(CypherParser::NONE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::SINGLE() { + return getToken(CypherParser::SINGLE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::TRUE() { + return getToken(CypherParser::TRUE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::FALSE() { + return getToken(CypherParser::FALSE, 0); +} + +tree::TerminalNode* CypherParser::SymbolicNameContext::HexLetter() { + return getToken(CypherParser::HexLetter, 0); +} + + +size_t CypherParser::SymbolicNameContext::getRuleIndex() const { + return CypherParser::RuleSymbolicName; +} + +void CypherParser::SymbolicNameContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterSymbolicName(this); +} + +void CypherParser::SymbolicNameContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitSymbolicName(this); +} + + +antlrcpp::Any CypherParser::SymbolicNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSymbolicName(this); + else + return visitor->visitChildren(this); +} + +CypherParser::SymbolicNameContext* CypherParser::symbolicName() { + SymbolicNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 150, CypherParser::RuleSymbolicName); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1225); + _la = _input->LA(1); + if (!(((((_la - 55) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 55)) & ((1ULL << (CypherParser::HexLetter - 55)) + | (1ULL << (CypherParser::UNION - 55)) + | (1ULL << (CypherParser::ALL - 55)) + | (1ULL << (CypherParser::OPTIONAL - 55)) + | (1ULL << (CypherParser::MATCH - 55)) + | (1ULL << (CypherParser::UNWIND - 55)) + | (1ULL << (CypherParser::AS - 55)) + | (1ULL << (CypherParser::MERGE - 55)) + | (1ULL << (CypherParser::ON - 55)) + | (1ULL << (CypherParser::CREATE - 55)) + | (1ULL << (CypherParser::SET - 55)) + | (1ULL << (CypherParser::DETACH - 55)) + | (1ULL << (CypherParser::DELETE - 55)) + | (1ULL << (CypherParser::REMOVE - 55)) + | (1ULL << (CypherParser::WITH - 55)) + | (1ULL << (CypherParser::DISTINCT - 55)) + | (1ULL << (CypherParser::RETURN - 55)) + | (1ULL << (CypherParser::ORDER - 55)) + | (1ULL << (CypherParser::BY - 55)) + | (1ULL << (CypherParser::L_SKIP - 55)) + | (1ULL << (CypherParser::LIMIT - 55)) + | (1ULL << (CypherParser::ASCENDING - 55)) + | (1ULL << (CypherParser::ASC - 55)) + | (1ULL << (CypherParser::DESCENDING - 55)) + | (1ULL << (CypherParser::DESC - 55)) + | (1ULL << (CypherParser::WHERE - 55)) + | (1ULL << (CypherParser::OR - 55)) + | (1ULL << (CypherParser::XOR - 55)) + | (1ULL << (CypherParser::AND - 55)) + | (1ULL << (CypherParser::NOT - 55)) + | (1ULL << (CypherParser::IN - 55)) + | (1ULL << (CypherParser::STARTS - 55)) + | (1ULL << (CypherParser::ENDS - 55)) + | (1ULL << (CypherParser::CONTAINS - 55)) + | (1ULL << (CypherParser::IS - 55)) + | (1ULL << (CypherParser::CYPHERNULL - 55)) + | (1ULL << (CypherParser::COUNT - 55)) + | (1ULL << (CypherParser::FILTER - 55)) + | (1ULL << (CypherParser::EXTRACT - 55)) + | (1ULL << (CypherParser::ANY - 55)) + | (1ULL << (CypherParser::NONE - 55)) + | (1ULL << (CypherParser::SINGLE - 55)) + | (1ULL << (CypherParser::TRUE - 55)) + | (1ULL << (CypherParser::FALSE - 55)) + | (1ULL << (CypherParser::UnescapedSymbolicName - 55)) + | (1ULL << (CypherParser::EscapedSymbolicName - 55)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LeftArrowHeadContext ------------------------------------------------------------------ + +CypherParser::LeftArrowHeadContext::LeftArrowHeadContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + + +size_t CypherParser::LeftArrowHeadContext::getRuleIndex() const { + return CypherParser::RuleLeftArrowHead; +} + +void CypherParser::LeftArrowHeadContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterLeftArrowHead(this); +} + +void CypherParser::LeftArrowHeadContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitLeftArrowHead(this); +} + + +antlrcpp::Any CypherParser::LeftArrowHeadContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLeftArrowHead(this); + else + return visitor->visitChildren(this); +} + +CypherParser::LeftArrowHeadContext* CypherParser::leftArrowHead() { + LeftArrowHeadContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 152, CypherParser::RuleLeftArrowHead); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1227); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__21) + | (1ULL << CypherParser::T__30) + | (1ULL << CypherParser::T__31) + | (1ULL << CypherParser::T__32) + | (1ULL << CypherParser::T__33))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RightArrowHeadContext ------------------------------------------------------------------ + +CypherParser::RightArrowHeadContext::RightArrowHeadContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + + +size_t CypherParser::RightArrowHeadContext::getRuleIndex() const { + return CypherParser::RuleRightArrowHead; +} + +void CypherParser::RightArrowHeadContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterRightArrowHead(this); +} + +void CypherParser::RightArrowHeadContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitRightArrowHead(this); +} + + +antlrcpp::Any CypherParser::RightArrowHeadContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRightArrowHead(this); + else + return visitor->visitChildren(this); +} + +CypherParser::RightArrowHeadContext* CypherParser::rightArrowHead() { + RightArrowHeadContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 154, CypherParser::RuleRightArrowHead); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1229); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__22) + | (1ULL << CypherParser::T__34) + | (1ULL << CypherParser::T__35) + | (1ULL << CypherParser::T__36) + | (1ULL << CypherParser::T__37))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- DashContext ------------------------------------------------------------------ + +CypherParser::DashContext::DashContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + + +size_t CypherParser::DashContext::getRuleIndex() const { + return CypherParser::RuleDash; +} + +void CypherParser::DashContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterDash(this); +} + +void CypherParser::DashContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitDash(this); +} + + +antlrcpp::Any CypherParser::DashContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitDash(this); + else + return visitor->visitChildren(this); +} + +CypherParser::DashContext* CypherParser::dash() { + DashContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 156, CypherParser::RuleDash); + size_t _la = 0; + + auto onExit = finally([=] { + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1231); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << CypherParser::T__14) + | (1ULL << CypherParser::T__38) + | (1ULL << CypherParser::T__39) + | (1ULL << CypherParser::T__40) + | (1ULL << CypherParser::T__41) + | (1ULL << CypherParser::T__42) + | (1ULL << CypherParser::T__43) + | (1ULL << CypherParser::T__44) + | (1ULL << CypherParser::T__45) + | (1ULL << CypherParser::T__46) + | (1ULL << CypherParser::T__47) + | (1ULL << CypherParser::T__48))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +// Static vars and initialization. +std::vector CypherParser::_decisionToDFA; +atn::PredictionContextCache CypherParser::_sharedContextCache; + +// We own the ATN which in turn owns the ATN states. +atn::ATN CypherParser::_atn; +std::vector CypherParser::_serializedATN; + +std::vector CypherParser::_ruleNames = { + "cypher", "statement", "query", "regularQuery", "singleQuery", "cypherUnion", + "clause", "cypherMatch", "unwind", "merge", "mergeAction", "create", "set", + "setItem", "cypherDelete", "remove", "removeItem", "with", "cypherReturn", + "returnBody", "returnItems", "returnItem", "order", "skip", "limit", "sortItem", + "where", "pattern", "patternPart", "anonymousPatternPart", "patternElement", + "nodePattern", "patternElementChain", "relationshipPattern", "relationshipDetail", + "properties", "relationshipTypes", "nodeLabels", "nodeLabel", "rangeLiteral", + "labelName", "relTypeName", "expression", "expression12", "expression11", + "expression10", "expression9", "expression8", "expression7", "expression6", + "expression5", "expression4", "expression3", "expression2", "atom", "literal", + "booleanLiteral", "listLiteral", "partialComparisonExpression", "parenthesizedExpression", + "relationshipsPattern", "filterExpression", "idInColl", "functionInvocation", + "functionName", "listComprehension", "propertyLookup", "variable", "numberLiteral", + "mapLiteral", "parameter", "propertyExpression", "propertyKeyName", "integerLiteral", + "doubleLiteral", "symbolicName", "leftArrowHead", "rightArrowHead", "dash" +}; + +std::vector CypherParser::_literalNames = { + "", "';'", "','", "'='", "'+='", "'*'", "'('", "')'", "'['", "'?'", "']'", + "':'", "'|'", "'..'", "'+'", "'-'", "'/'", "'%'", "'^'", "'=~'", "'<>'", + "'!='", "'<'", "'>'", "'<='", "'>='", "'.'", "'!'", "'{'", "'}'", "'$'", + "'⟨'", "'〈'", "'﹤'", "'<'", "'⟩'", "'〉'", "'﹥'", "'>'", "'­'", "'‐'", + "'‑'", "'‒'", "'–'", "'—'", "'―'", "'−'", "'﹘'", "'﹣'", "'-'", "", "", + "", "", "", "", "", "", "", "", "", "'0'" +}; + +std::vector CypherParser::_symbolicNames = { + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "StringLiteral", + "EscapedChar", "HexInteger", "DecimalInteger", "OctalInteger", "HexLetter", + "HexDigit", "Digit", "NonZeroDigit", "NonZeroOctDigit", "OctDigit", "ZeroDigit", + "ExponentDecimalReal", "RegularDecimalReal", "UNION", "ALL", "OPTIONAL", + "MATCH", "UNWIND", "AS", "MERGE", "ON", "CREATE", "SET", "DETACH", "DELETE", + "REMOVE", "WITH", "DISTINCT", "RETURN", "ORDER", "BY", "L_SKIP", "LIMIT", + "ASCENDING", "ASC", "DESCENDING", "DESC", "WHERE", "OR", "XOR", "AND", + "NOT", "IN", "STARTS", "ENDS", "CONTAINS", "IS", "CYPHERNULL", "COUNT", + "FILTER", "EXTRACT", "ANY", "NONE", "SINGLE", "TRUE", "FALSE", "UnescapedSymbolicName", + "IdentifierStart", "IdentifierPart", "EscapedSymbolicName", "SP", "WHITESPACE", + "Comment", "L_0X" +}; + +dfa::Vocabulary CypherParser::_vocabulary(_literalNames, _symbolicNames); + +std::vector CypherParser::_tokenNames; + +CypherParser::Initializer::Initializer() { + for (size_t i = 0; i < _symbolicNames.size(); ++i) { + std::string name = _vocabulary.getLiteralName(i); + if (name.empty()) { + name = _vocabulary.getSymbolicName(i); + } + + if (name.empty()) { + _tokenNames.push_back(""); + } else { + _tokenNames.push_back(name); + } + } + + _serializedATN = { + 0x3, 0x430, 0xd6d1, 0x8206, 0xad2d, 0x4417, 0xaef1, 0x8d80, 0xaadd, + 0x3, 0x74, 0x4d4, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, + 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7, + 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, 0xb, + 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 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0xa, 0x10, 0x3, 0x10, 0x3, 0x10, 0x5, 0x10, + 0x136, 0xa, 0x10, 0x3, 0x10, 0x3, 0x10, 0x5, 0x10, 0x13a, 0xa, 0x10, + 0x3, 0x10, 0x3, 0x10, 0x5, 0x10, 0x13e, 0xa, 0x10, 0x3, 0x10, 0x7, 0x10, + 0x141, 0xa, 0x10, 0xc, 0x10, 0xe, 0x10, 0x144, 0xb, 0x10, 0x3, 0x11, + 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x5, 0x11, 0x14a, 0xa, 0x11, 0x3, 0x11, + 0x3, 0x11, 0x5, 0x11, 0x14e, 0xa, 0x11, 0x3, 0x11, 0x7, 0x11, 0x151, + 0xa, 0x11, 0xc, 0x11, 0xe, 0x11, 0x154, 0xb, 0x11, 0x3, 0x12, 0x3, 0x12, + 0x3, 0x12, 0x3, 0x12, 0x5, 0x12, 0x15a, 0xa, 0x12, 0x3, 0x13, 0x3, 0x13, + 0x5, 0x13, 0x15e, 0xa, 0x13, 0x3, 0x13, 0x5, 0x13, 0x161, 0xa, 0x13, + 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x5, 0x13, 0x166, 0xa, 0x13, 0x3, 0x13, + 0x5, 0x13, 0x169, 0xa, 0x13, 0x3, 0x14, 0x3, 0x14, 0x5, 0x14, 0x16d, + 0xa, 0x14, 0x3, 0x14, 0x5, 0x14, 0x170, 0xa, 0x14, 0x3, 0x14, 0x3, 0x14, + 0x3, 0x14, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x5, 0x15, 0x178, 0xa, 0x15, + 0x3, 0x15, 0x3, 0x15, 0x5, 0x15, 0x17c, 0xa, 0x15, 0x3, 0x15, 0x3, 0x15, + 0x5, 0x15, 0x180, 0xa, 0x15, 0x3, 0x16, 0x3, 0x16, 0x5, 0x16, 0x184, + 0xa, 0x16, 0x3, 0x16, 0x3, 0x16, 0x5, 0x16, 0x188, 0xa, 0x16, 0x3, 0x16, + 0x7, 0x16, 0x18b,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x1e, 0x3, 0x1e, 0x3, 0x1e, 0x5, 0x1e, 0x1e4, + 0xa, 0x1e, 0x3, 0x1f, 0x3, 0x1f, 0x3, 0x20, 0x3, 0x20, 0x5, 0x20, 0x1ea, + 0xa, 0x20, 0x3, 0x20, 0x7, 0x20, 0x1ed, 0xa, 0x20, 0xc, 0x20, 0xe, 0x20, + 0x1f0, 0xb, 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, 0x20, 0x5, 0x20, + 0x1f6, 0xa, 0x20, 0x3, 0x21, 0x3, 0x21, 0x5, 0x21, 0x1fa, 0xa, 0x21, + 0x3, 0x21, 0x3, 0x21, 0x5, 0x21, 0x1fe, 0xa, 0x21, 0x5, 0x21, 0x200, + 0xa, 0x21, 0x3, 0x21, 0x3, 0x21, 0x5, 0x21, 0x204, 0xa, 0x21, 0x5, 0x21, + 0x206, 0xa, 0x21, 0x3, 0x21, 0x3, 0x21, 0x5, 0x21, 0x20a, 0xa, 0x21, + 0x5, 0x21, 0x20c, 0xa, 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, 0x22, 0x3, 0x22, + 0x5, 0x22, 0x212, 0xa, 0x22, 0x3, 0x22, 0x3, 0x22, 0x3, 0x23, 0x3, 0x23, + 0x5, 0x23, 0x218, 0xa, 0x23, 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x21c, + 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, 0x21f, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, + 0x222, 0xa, 0x23, 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x226, 0xa, 0x23, + 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x22c, 0xa, 0x23, + 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x230, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, + 0x233, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, 0x236, 0xa, 0x23, 0x3, 0x23, + 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x23c, 0xa, 0x23, 0x3, 0x23, + 0x5, 0x23, 0x23f, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, 0x242, 0xa, 0x23, + 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x246, 0xa, 0x23, 0x3, 0x23, 0x3, 0x23, + 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x24c, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, + 0x24f, 0xa, 0x23, 0x3, 0x23, 0x5, 0x23, 0x252, 0xa, 0x23, 0x3, 0x23, + 0x3, 0x23, 0x5, 0x23, 0x256, 0xa, 0x23, 0x3, 0x24, 0x3, 0x24, 0x5, 0x24, + 0x25a, 0xa, 0x24, 0x3, 0x24, 0x5, 0x24, 0x25d, 0xa, 0x24, 0x3, 0x24, + 0x5, 0x24, 0x260, 0xa, 0x24, 0x3, 0x24, 0x5, 0x24, 0x263, 0xa, 0x24, + 0x3, 0x24, 0x5, 0x24, 0x266, 0xa, 0x24, 0x3, 0x24, 0x3, 0x24, 0x3, 0x25, + 0x3, 0x25, 0x5, 0x25, 0x26c, 0xa, 0x25, 0x3, 0x26, 0x3, 0x26, 0x3, 0x26, + 0x5, 0x26, 0x271, 0xa, 0x26, 0x3, 0x26, 0x3, 0x26, 0x5, 0x26, 0x275, + 0xa, 0x26, 0x3, 0x26, 0x5, 0x26, 0x278, 0xa, 0x26, 0x3, 0x26, 0x7, 0x26, + 0x27b, 0xa, 0x26, 0xc, 0x26, 0xe, 0x26, 0x27e, 0xb, 0x26, 0x3, 0x27, + 0x3, 0x27, 0x5, 0x27, 0x282, 0xa, 0x27, 0x3, 0x27, 0x7, 0x27, 0x285, + 0xa, 0x27, 0xc, 0x27, 0xe, 0x27, 0x288, 0xb, 0x27, 0x3, 0x28, 0x3, 0x28, + 0x3, 0x28, 0x3, 0x29, 0x3, 0x29, 0x5, 0x29, 0x28f, 0xa, 0x29, 0x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0x32, + 0x5, 0x32, 0x2e6, 0xa, 0x32, 0x3, 0x32, 0x3, 0x32, 0x5, 0x32, 0x2ea, + 0xa, 0x32, 0x3, 0x32, 0x7, 0x32, 0x2ed, 0xa, 0x32, 0xc, 0x32, 0xe, 0x32, + 0x2f0, 0xb, 0x32, 0x3, 0x33, 0x3, 0x33, 0x5, 0x33, 0x2f4, 0xa, 0x33, + 0x3, 0x33, 0x3, 0x33, 0x5, 0x33, 0x2f8, 0xa, 0x33, 0x3, 0x33, 0x3, 0x33, + 0x5, 0x33, 0x2fc, 0xa, 0x33, 0x3, 0x33, 0x3, 0x33, 0x5, 0x33, 0x300, + 0xa, 0x33, 0x3, 0x33, 0x3, 0x33, 0x5, 0x33, 0x304, 0xa, 0x33, 0x3, 0x33, + 0x3, 0x33, 0x5, 0x33, 0x308, 0xa, 0x33, 0x3, 0x33, 0x7, 0x33, 0x30b, + 0xa, 0x33, 0xc, 0x33, 0xe, 0x33, 0x30e, 0xb, 0x33, 0x3, 0x34, 0x3, 0x34, + 0x5, 0x34, 0x312, 0xa, 0x34, 0x3, 0x34, 0x3, 0x34, 0x5, 0x34, 0x316, + 0xa, 0x34, 0x3, 0x34, 0x7, 0x34, 0x319, 0xa, 0x34, 0xc, 0x34, 0xe, 0x34, + 0x31c, 0xb, 0x34, 0x3, 0x35, 0x3, 0x35, 0x5, 0x35, 0x320, 0xa, 0x35, + 0x7, 0x35, 0x322, 0xa, 0x35, 0xc, 0x35, 0xe, 0x35, 0x325, 0xb, 0x35, + 0x3, 0x35, 0x3, 0x35, 0x3, 0x36, 0x3, 0x36, 0x5, 0x36, 0x32b, 0xa, 0x36, + 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x5, 0x36, 0x332, + 0xa, 0x36, 0x3, 0x36, 0x3, 0x36, 0x5, 0x36, 0x336, 0xa, 0x36, 0x3, 0x36, + 0x3, 0x36, 0x5, 0x36, 0x33a, 0xa, 0x36, 0x3, 0x36, 0x3, 0x36, 0x5, 0x36, + 0x33e, 0xa, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, + 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, + 0x36, 0x3, 0x36, 0x5, 0x36, 0x34d, 0xa, 0x36, 0x3, 0x36, 0x5, 0x36, + 0x350, 0xa, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, + 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x7, + 0x36, 0x35d, 0xa, 0x36, 0xc, 0x36, 0xe, 0x36, 0x360, 0xb, 0x36, 0x3, + 0x37, 0x3, 0x37, 0x3, 0x37, 0x7, 0x37, 0x365, 0xa, 0x37, 0xc, 0x37, + 0xe, 0x37, 0x368, 0xb, 0x37, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, + 0x5, 0x38, 0x36e, 0xa, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x372, + 0xa, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x376, 0xa, 0x38, 0x3, 0x38, + 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x37c, 0xa, 0x38, 0x3, 0x38, + 0x3, 0x38, 0x5, 0x38, 0x380, 0xa, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, + 0x384, 0xa, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, + 0x38a, 0xa, 0x38, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x38e, 0xa, 0x38, + 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x392, 0xa, 0x38, 0x3, 0x38, 0x5, 0x38, + 0x395, 0xa, 0x38, 0x3, 0x38, 0x3, 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3, 0x40, 0x3, 0x41, 0x3, 0x41, 0x5, 0x41, 0x445, 0xa, 0x41, + 0x3, 0x41, 0x3, 0x41, 0x5, 0x41, 0x449, 0xa, 0x41, 0x3, 0x41, 0x3, 0x41, + 0x5, 0x41, 0x44d, 0xa, 0x41, 0x5, 0x41, 0x44f, 0xa, 0x41, 0x3, 0x41, + 0x3, 0x41, 0x5, 0x41, 0x453, 0xa, 0x41, 0x3, 0x41, 0x3, 0x41, 0x5, 0x41, + 0x457, 0xa, 0x41, 0x3, 0x41, 0x3, 0x41, 0x5, 0x41, 0x45b, 0xa, 0x41, + 0x7, 0x41, 0x45d, 0xa, 0x41, 0xc, 0x41, 0xe, 0x41, 0x460, 0xb, 0x41, + 0x5, 0x41, 0x462, 0xa, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x42, 0x3, 0x42, + 0x3, 0x43, 0x3, 0x43, 0x5, 0x43, 0x46a, 0xa, 0x43, 0x3, 0x43, 0x3, 0x43, + 0x5, 0x43, 0x46e, 0xa, 0x43, 0x3, 0x43, 0x3, 0x43, 0x5, 0x43, 0x472, + 0xa, 0x43, 0x3, 0x43, 0x5, 0x43, 0x475, 0xa, 0x43, 0x3, 0x43, 0x5, 0x43, + 0x478, 0xa, 0x43, 0x3, 0x43, 0x3, 0x43, 0x3, 0x44, 0x5, 0x44, 0x47d, + 0xa, 0x44, 0x3, 0x44, 0x3, 0x44, 0x5, 0x44, 0x481, 0xa, 0x44, 0x3, 0x44, + 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x5, 0x44, 0x487, 0xa, 0x44, 0x3, 0x45, + 0x3, 0x45, 0x3, 0x46, 0x3, 0x46, 0x5, 0x46, 0x48d, 0xa, 0x46, 0x3, 0x47, + 0x3, 0x47, 0x5, 0x47, 0x491, 0xa, 0x47, 0x3, 0x47, 0x3, 0x47, 0x5, 0x47, + 0x495, 0xa, 0x47, 0x3, 0x47, 0x3, 0x47, 0x5, 0x47, 0x499, 0xa, 0x47, + 0x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0x71, 0x2, 0x2, 0x10a, 0x10b, 0x7, 0x4a, 0x2, 0x2, + 0x10b, 0x10c, 0x7, 0x71, 0x2, 0x2, 0x10c, 0x10e, 0x5, 0x1a, 0xe, 0x2, + 0x10d, 0x103, 0x3, 0x2, 0x2, 0x2, 0x10d, 0x108, 0x3, 0x2, 0x2, 0x2, + 0x10e, 0x17, 0x3, 0x2, 0x2, 0x2, 0x10f, 0x111, 0x7, 0x4a, 0x2, 0x2, + 0x110, 0x112, 0x7, 0x71, 0x2, 0x2, 0x111, 0x110, 0x3, 0x2, 0x2, 0x2, + 0x111, 0x112, 0x3, 0x2, 0x2, 0x2, 0x112, 0x113, 0x3, 0x2, 0x2, 0x2, + 0x113, 0x114, 0x5, 0x38, 0x1d, 0x2, 0x114, 0x19, 0x3, 0x2, 0x2, 0x2, + 0x115, 0x116, 0x7, 0x4b, 0x2, 0x2, 0x116, 0x11b, 0x5, 0x1c, 0xf, 0x2, + 0x117, 0x118, 0x7, 0x4, 0x2, 0x2, 0x118, 0x11a, 0x5, 0x1c, 0xf, 0x2, + 0x119, 0x117, 0x3, 0x2, 0x2, 0x2, 0x11a, 0x11d, 0x3, 0x2, 0x2, 0x2, + 0x11b, 0x119, 0x3, 0x2, 0x2, 0x2, 0x11b, 0x11c, 0x3, 0x2, 0x2, 0x2, + 0x11c, 0x1b, 0x3, 0x2, 0x2, 0x2, 0x11d, 0x11b, 0x3, 0x2, 0x2, 0x2, 0x11e, + 0x11f, 0x5, 0x90, 0x49, 0x2, 0x11f, 0x120, 0x7, 0x5, 0x2, 0x2, 0x120, + 0x121, 0x5, 0x56, 0x2c, 0x2, 0x121, 0x12e, 0x3, 0x2, 0x2, 0x2, 0x122, + 0x123, 0x5, 0x88, 0x45, 0x2, 0x123, 0x124, 0x7, 0x5, 0x2, 0x2, 0x124, + 0x125, 0x5, 0x56, 0x2c, 0x2, 0x125, 0x12e, 0x3, 0x2, 0x2, 0x2, 0x126, + 0x127, 0x5, 0x88, 0x45, 0x2, 0x127, 0x128, 0x7, 0x6, 0x2, 0x2, 0x128, + 0x129, 0x5, 0x56, 0x2c, 0x2, 0x129, 0x12e, 0x3, 0x2, 0x2, 0x2, 0x12a, + 0x12b, 0x5, 0x88, 0x45, 0x2, 0x12b, 0x12c, 0x5, 0x4c, 0x27, 0x2, 0x12c, + 0x12e, 0x3, 0x2, 0x2, 0x2, 0x12d, 0x11e, 0x3, 0x2, 0x2, 0x2, 0x12d, + 0x122, 0x3, 0x2, 0x2, 0x2, 0x12d, 0x126, 0x3, 0x2, 0x2, 0x2, 0x12d, + 0x12a, 0x3, 0x2, 0x2, 0x2, 0x12e, 0x1d, 0x3, 0x2, 0x2, 0x2, 0x12f, 0x130, + 0x7, 0x4c, 0x2, 0x2, 0x130, 0x132, 0x7, 0x71, 0x2, 0x2, 0x131, 0x12f, + 0x3, 0x2, 0x2, 0x2, 0x131, 0x132, 0x3, 0x2, 0x2, 0x2, 0x132, 0x133, + 0x3, 0x2, 0x2, 0x2, 0x133, 0x135, 0x7, 0x4d, 0x2, 0x2, 0x134, 0x136, + 0x7, 0x71, 0x2, 0x2, 0x135, 0x134, 0x3, 0x2, 0x2, 0x2, 0x135, 0x136, + 0x3, 0x2, 0x2, 0x2, 0x136, 0x137, 0x3, 0x2, 0x2, 0x2, 0x137, 0x142, + 0x5, 0x56, 0x2c, 0x2, 0x138, 0x13a, 0x7, 0x71, 0x2, 0x2, 0x139, 0x138, + 0x3, 0x2, 0x2, 0x2, 0x139, 0x13a, 0x3, 0x2, 0x2, 0x2, 0x13a, 0x13b, + 0x3, 0x2, 0x2, 0x2, 0x13b, 0x13d, 0x7, 0x4, 0x2, 0x2, 0x13c, 0x13e, + 0x7, 0x71, 0x2, 0x2, 0x13d, 0x13c, 0x3, 0x2, 0x2, 0x2, 0x13d, 0x13e, + 0x3, 0x2, 0x2, 0x2, 0x13e, 0x13f, 0x3, 0x2, 0x2, 0x2, 0x13f, 0x141, + 0x5, 0x56, 0x2c, 0x2, 0x140, 0x139, 0x3, 0x2, 0x2, 0x2, 0x141, 0x144, + 0x3, 0x2, 0x2, 0x2, 0x142, 0x140, 0x3, 0x2, 0x2, 0x2, 0x142, 0x143, + 0x3, 0x2, 0x2, 0x2, 0x143, 0x1f, 0x3, 0x2, 0x2, 0x2, 0x144, 0x142, 0x3, + 0x2, 0x2, 0x2, 0x145, 0x146, 0x7, 0x4e, 0x2, 0x2, 0x146, 0x147, 0x7, + 0x71, 0x2, 0x2, 0x147, 0x152, 0x5, 0x22, 0x12, 0x2, 0x148, 0x14a, 0x7, + 0x71, 0x2, 0x2, 0x149, 0x148, 0x3, 0x2, 0x2, 0x2, 0x149, 0x14a, 0x3, + 0x2, 0x2, 0x2, 0x14a, 0x14b, 0x3, 0x2, 0x2, 0x2, 0x14b, 0x14d, 0x7, + 0x4, 0x2, 0x2, 0x14c, 0x14e, 0x7, 0x71, 0x2, 0x2, 0x14d, 0x14c, 0x3, + 0x2, 0x2, 0x2, 0x14d, 0x14e, 0x3, 0x2, 0x2, 0x2, 0x14e, 0x14f, 0x3, + 0x2, 0x2, 0x2, 0x14f, 0x151, 0x5, 0x22, 0x12, 0x2, 0x150, 0x149, 0x3, + 0x2, 0x2, 0x2, 0x151, 0x154, 0x3, 0x2, 0x2, 0x2, 0x152, 0x150, 0x3, + 0x2, 0x2, 0x2, 0x152, 0x153, 0x3, 0x2, 0x2, 0x2, 0x153, 0x21, 0x3, 0x2, + 0x2, 0x2, 0x154, 0x152, 0x3, 0x2, 0x2, 0x2, 0x155, 0x156, 0x5, 0x88, + 0x45, 0x2, 0x156, 0x157, 0x5, 0x4c, 0x27, 0x2, 0x157, 0x15a, 0x3, 0x2, + 0x2, 0x2, 0x158, 0x15a, 0x5, 0x90, 0x49, 0x2, 0x159, 0x155, 0x3, 0x2, + 0x2, 0x2, 0x159, 0x158, 0x3, 0x2, 0x2, 0x2, 0x15a, 0x23, 0x3, 0x2, 0x2, + 0x2, 0x15b, 0x160, 0x7, 0x4f, 0x2, 0x2, 0x15c, 0x15e, 0x7, 0x71, 0x2, + 0x2, 0x15d, 0x15c, 0x3, 0x2, 0x2, 0x2, 0x15d, 0x15e, 0x3, 0x2, 0x2, + 0x2, 0x15e, 0x15f, 0x3, 0x2, 0x2, 0x2, 0x15f, 0x161, 0x7, 0x50, 0x2, + 0x2, 0x160, 0x15d, 0x3, 0x2, 0x2, 0x2, 0x160, 0x161, 0x3, 0x2, 0x2, + 0x2, 0x161, 0x162, 0x3, 0x2, 0x2, 0x2, 0x162, 0x163, 0x7, 0x71, 0x2, + 0x2, 0x163, 0x168, 0x5, 0x28, 0x15, 0x2, 0x164, 0x166, 0x7, 0x71, 0x2, + 0x2, 0x165, 0x164, 0x3, 0x2, 0x2, 0x2, 0x165, 0x166, 0x3, 0x2, 0x2, + 0x2, 0x166, 0x167, 0x3, 0x2, 0x2, 0x2, 0x167, 0x169, 0x5, 0x36, 0x1c, + 0x2, 0x168, 0x165, 0x3, 0x2, 0x2, 0x2, 0x168, 0x169, 0x3, 0x2, 0x2, + 0x2, 0x169, 0x25, 0x3, 0x2, 0x2, 0x2, 0x16a, 0x16f, 0x7, 0x51, 0x2, + 0x2, 0x16b, 0x16d, 0x7, 0x71, 0x2, 0x2, 0x16c, 0x16b, 0x3, 0x2, 0x2, + 0x2, 0x16c, 0x16d, 0x3, 0x2, 0x2, 0x2, 0x16d, 0x16e, 0x3, 0x2, 0x2, + 0x2, 0x16e, 0x170, 0x7, 0x50, 0x2, 0x2, 0x16f, 0x16c, 0x3, 0x2, 0x2, + 0x2, 0x16f, 0x170, 0x3, 0x2, 0x2, 0x2, 0x170, 0x171, 0x3, 0x2, 0x2, + 0x2, 0x171, 0x172, 0x7, 0x71, 0x2, 0x2, 0x172, 0x173, 0x5, 0x28, 0x15, + 0x2, 0x173, 0x27, 0x3, 0x2, 0x2, 0x2, 0x174, 0x177, 0x5, 0x2a, 0x16, + 0x2, 0x175, 0x176, 0x7, 0x71, 0x2, 0x2, 0x176, 0x178, 0x5, 0x2e, 0x18, + 0x2, 0x177, 0x175, 0x3, 0x2, 0x2, 0x2, 0x177, 0x178, 0x3, 0x2, 0x2, + 0x2, 0x178, 0x17b, 0x3, 0x2, 0x2, 0x2, 0x179, 0x17a, 0x7, 0x71, 0x2, + 0x2, 0x17a, 0x17c, 0x5, 0x30, 0x19, 0x2, 0x17b, 0x179, 0x3, 0x2, 0x2, + 0x2, 0x17b, 0x17c, 0x3, 0x2, 0x2, 0x2, 0x17c, 0x17f, 0x3, 0x2, 0x2, + 0x2, 0x17d, 0x17e, 0x7, 0x71, 0x2, 0x2, 0x17e, 0x180, 0x5, 0x32, 0x1a, + 0x2, 0x17f, 0x17d, 0x3, 0x2, 0x2, 0x2, 0x17f, 0x180, 0x3, 0x2, 0x2, + 0x2, 0x180, 0x29, 0x3, 0x2, 0x2, 0x2, 0x181, 0x18c, 0x7, 0x7, 0x2, 0x2, + 0x182, 0x184, 0x7, 0x71, 0x2, 0x2, 0x183, 0x182, 0x3, 0x2, 0x2, 0x2, + 0x183, 0x184, 0x3, 0x2, 0x2, 0x2, 0x184, 0x185, 0x3, 0x2, 0x2, 0x2, + 0x185, 0x187, 0x7, 0x4, 0x2, 0x2, 0x186, 0x188, 0x7, 0x71, 0x2, 0x2, + 0x187, 0x186, 0x3, 0x2, 0x2, 0x2, 0x187, 0x188, 0x3, 0x2, 0x2, 0x2, + 0x188, 0x189, 0x3, 0x2, 0x2, 0x2, 0x189, 0x18b, 0x5, 0x2c, 0x17, 0x2, + 0x18a, 0x183, 0x3, 0x2, 0x2, 0x2, 0x18b, 0x18e, 0x3, 0x2, 0x2, 0x2, + 0x18c, 0x18a, 0x3, 0x2, 0x2, 0x2, 0x18c, 0x18d, 0x3, 0x2, 0x2, 0x2, + 0x18d, 0x19e, 0x3, 0x2, 0x2, 0x2, 0x18e, 0x18c, 0x3, 0x2, 0x2, 0x2, + 0x18f, 0x19a, 0x5, 0x2c, 0x17, 0x2, 0x190, 0x192, 0x7, 0x71, 0x2, 0x2, + 0x191, 0x190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2, 0x211, 0x210, + 0x3, 0x2, 0x2, 0x2, 0x211, 0x212, 0x3, 0x2, 0x2, 0x2, 0x212, 0x213, + 0x3, 0x2, 0x2, 0x2, 0x213, 0x214, 0x5, 0x40, 0x21, 0x2, 0x214, 0x43, + 0x3, 0x2, 0x2, 0x2, 0x215, 0x217, 0x5, 0x9a, 0x4e, 0x2, 0x216, 0x218, + 0x7, 0x71, 0x2, 0x2, 0x217, 0x216, 0x3, 0x2, 0x2, 0x2, 0x217, 0x218, + 0x3, 0x2, 0x2, 0x2, 0x218, 0x219, 0x3, 0x2, 0x2, 0x2, 0x219, 0x21b, + 0x5, 0x9e, 0x50, 0x2, 0x21a, 0x21c, 0x7, 0x71, 0x2, 0x2, 0x21b, 0x21a, + 0x3, 0x2, 0x2, 0x2, 0x21b, 0x21c, 0x3, 0x2, 0x2, 0x2, 0x21c, 0x21e, + 0x3, 0x2, 0x2, 0x2, 0x21d, 0x21f, 0x5, 0x46, 0x24, 0x2, 0x21e, 0x21d, + 0x3, 0x2, 0x2, 0x2, 0x21e, 0x21f, 0x3, 0x2, 0x2, 0x2, 0x21f, 0x221, + 0x3, 0x2, 0x2, 0x2, 0x220, 0x222, 0x7, 0x71, 0x2, 0x2, 0x221, 0x220, + 0x3, 0x2, 0x2, 0x2, 0x221, 0x222, 0x3, 0x2, 0x2, 0x2, 0x222, 0x223, + 0x3, 0x2, 0x2, 0x2, 0x223, 0x225, 0x5, 0x9e, 0x50, 0x2, 0x224, 0x226, + 0x7, 0x71, 0x2, 0x2, 0x225, 0x224, 0x3, 0x2, 0x2, 0x2, 0x225, 0x226, + 0x3, 0x2, 0x2, 0x2, 0x226, 0x227, 0x3, 0x2, 0x2, 0x2, 0x227, 0x228, + 0x5, 0x9c, 0x4f, 0x2, 0x228, 0x256, 0x3, 0x2, 0x2, 0x2, 0x229, 0x22b, + 0x5, 0x9a, 0x4e, 0x2, 0x22a, 0x22c, 0x7, 0x71, 0x2, 0x2, 0x22b, 0x22a, + 0x3, 0x2, 0x2, 0x2, 0x22b, 0x22c, 0x3, 0x2, 0x2, 0x2, 0x22c, 0x22d, + 0x3, 0x2, 0x2, 0x2, 0x22d, 0x22f, 0x5, 0x9e, 0x50, 0x2, 0x22e, 0x230, + 0x7, 0x71, 0x2, 0x2, 0x22f, 0x22e, 0x3, 0x2, 0x2, 0x2, 0x22f, 0x230, + 0x3, 0x2, 0x2, 0x2, 0x230, 0x232, 0x3, 0x2, 0x2, 0x2, 0x231, 0x233, + 0x5, 0x46, 0x24, 0x2, 0x232, 0x231, 0x3, 0x2, 0x2, 0x2, 0x232, 0x233, + 0x3, 0x2, 0x2, 0x2, 0x233, 0x235, 0x3, 0x2, 0x2, 0x2, 0x234, 0x236, + 0x7, 0x71, 0x2, 0x2, 0x235, 0x234, 0x3, 0x2, 0x2, 0x2, 0x235, 0x236, + 0x3, 0x2, 0x2, 0x2, 0x236, 0x237, 0x3, 0x2, 0x2, 0x2, 0x237, 0x238, + 0x5, 0x9e, 0x50, 0x2, 0x238, 0x256, 0x3, 0x2, 0x2, 0x2, 0x239, 0x23b, + 0x5, 0x9e, 0x50, 0x2, 0x23a, 0x23c, 0x7, 0x71, 0x2, 0x2, 0x23b, 0x23a, + 0x3, 0x2, 0x2, 0x2, 0x23b, 0x23c, 0x3, 0x2, 0x2, 0x2, 0x23c, 0x23e, + 0x3, 0x2, 0x2, 0x2, 0x23d, 0x23f, 0x5, 0x46, 0x24, 0x2, 0x23e, 0x23d, + 0x3, 0x2, 0x2, 0x2, 0x23e, 0x23f, 0x3, 0x2, 0x2, 0x2, 0x23f, 0x241, + 0x3, 0x2, 0x2, 0x2, 0x240, 0x242, 0x7, 0x71, 0x2, 0x2, 0x241, 0x240, + 0x3, 0x2, 0x2, 0x2, 0x241, 0x242, 0x3, 0x2, 0x2, 0x2, 0x242, 0x243, + 0x3, 0x2, 0x2, 0x2, 0x243, 0x245, 0x5, 0x9e, 0x50, 0x2, 0x244, 0x246, + 0x7, 0x71, 0x2, 0x2, 0x245, 0x244, 0x3, 0x2, 0x2, 0x2, 0x245, 0x246, + 0x3, 0x2, 0x2, 0x2, 0x246, 0x247, 0x3, 0x2, 0x2, 0x2, 0x247, 0x248, + 0x5, 0x9c, 0x4f, 0x2, 0x248, 0x256, 0x3, 0x2, 0x2, 0x2, 0x249, 0x24b, + 0x5, 0x9e, 0x50, 0x2, 0x24a, 0x24c, 0x7, 0x71, 0x2, 0x2, 0x24b, 0x24a, + 0x3, 0x2, 0x2, 0x2, 0x24b, 0x24c, 0x3, 0x2, 0x2, 0x2, 0x24c, 0x24e, + 0x3, 0x2, 0x2, 0x2, 0x24d, 0x24f, 0x5, 0x46, 0x24, 0x2, 0x24e, 0x24d, + 0x3, 0x2, 0x2, 0x2, 0x24e, 0x24f, 0x3, 0x2, 0x2, 0x2, 0x24f, 0x251, + 0x3, 0x2, 0x2, 0x2, 0x250, 0x252, 0x7, 0x71, 0x2, 0x2, 0x251, 0x250, + 0x3, 0x2, 0x2, 0x2, 0x251, 0x252, 0x3, 0x2, 0x2, 0x2, 0x252, 0x253, + 0x3, 0x2, 0x2, 0x2, 0x253, 0x254, 0x5, 0x9e, 0x50, 0x2, 0x254, 0x256, + 0x3, 0x2, 0x2, 0x2, 0x255, 0x215, 0x3, 0x2, 0x2, 0x2, 0x255, 0x229, + 0x3, 0x2, 0x2, 0x2, 0x255, 0x239, 0x3, 0x2, 0x2, 0x2, 0x255, 0x249, + 0x3, 0x2, 0x2, 0x2, 0x256, 0x45, 0x3, 0x2, 0x2, 0x2, 0x257, 0x259, 0x7, + 0xa, 0x2, 0x2, 0x258, 0x25a, 0x5, 0x88, 0x45, 0x2, 0x259, 0x258, 0x3, + 0x2, 0x2, 0x2, 0x259, 0x25a, 0x3, 0x2, 0x2, 0x2, 0x25a, 0x25c, 0x3, + 0x2, 0x2, 0x2, 0x25b, 0x25d, 0x7, 0xb, 0x2, 0x2, 0x25c, 0x25b, 0x3, + 0x2, 0x2, 0x2, 0x25c, 0x25d, 0x3, 0x2, 0x2, 0x2, 0x25d, 0x25f, 0x3, + 0x2, 0x2, 0x2, 0x25e, 0x260, 0x5, 0x4a, 0x26, 0x2, 0x25f, 0x25e, 0x3, + 0x2, 0x2, 0x2, 0x25f, 0x260, 0x3, 0x2, 0x2, 0x2, 0x260, 0x262, 0x3, + 0x2, 0x2, 0x2, 0x261, 0x263, 0x5, 0x50, 0x29, 0x2, 0x262, 0x261, 0x3, + 0x2, 0x2, 0x2, 0x262, 0x263, 0x3, 0x2, 0x2, 0x2, 0x263, 0x265, 0x3, + 0x2, 0x2, 0x2, 0x264, 0x266, 0x5, 0x48, 0x25, 0x2, 0x265, 0x264, 0x3, + 0x2, 0x2, 0x2, 0x265, 0x266, 0x3, 0x2, 0x2, 0x2, 0x266, 0x267, 0x3, + 0x2, 0x2, 0x2, 0x267, 0x268, 0x7, 0xc, 0x2, 0x2, 0x268, 0x47, 0x3, 0x2, + 0x2, 0x2, 0x269, 0x26c, 0x5, 0x8c, 0x47, 0x2, 0x26a, 0x26c, 0x5, 0x8e, + 0x48, 0x2, 0x26b, 0x269, 0x3, 0x2, 0x2, 0x2, 0x26b, 0x26a, 0x3, 0x2, + 0x2, 0x2, 0x26c, 0x49, 0x3, 0x2, 0x2, 0x2, 0x26d, 0x26e, 0x7, 0xd, 0x2, + 0x2, 0x26e, 0x27c, 0x5, 0x54, 0x2b, 0x2, 0x26f, 0x271, 0x7, 0x71, 0x2, + 0x2, 0x270, 0x26f, 0x3, 0x2, 0x2, 0x2, 0x270, 0x271, 0x3, 0x2, 0x2, + 0x2, 0x271, 0x272, 0x3, 0x2, 0x2, 0x2, 0x272, 0x274, 0x7, 0xe, 0x2, + 0x2, 0x273, 0x275, 0x7, 0xd, 0x2, 0x2, 0x274, 0x273, 0x3, 0x2, 0x2, + 0x2, 0x274, 0x275, 0x3, 0x2, 0x2, 0x2, 0x275, 0x277, 0x3, 0x2, 0x2, + 0x2, 0x276, 0x278, 0x7, 0x71, 0x2, 0x2, 0x277, 0x276, 0x3, 0x2, 0x2, + 0x2, 0x277, 0x278, 0x3, 0x2, 0x2, 0x2, 0x278, 0x279, 0x3, 0x2, 0x2, + 0x2, 0x279, 0x27b, 0x5, 0x54, 0x2b, 0x2, 0x27a, 0x270, 0x3, 0x2, 0x2, + 0x2, 0x27b, 0x27e, 0x3, 0x2, 0x2, 0x2, 0x27c, 0x27a, 0x3, 0x2, 0x2, + 0x2, 0x27c, 0x27d, 0x3, 0x2, 0x2, 0x2, 0x27d, 0x4b, 0x3, 0x2, 0x2, 0x2, + 0x27e, 0x27c, 0x3, 0x2, 0x2, 0x2, 0x27f, 0x286, 0x5, 0x4e, 0x28, 0x2, + 0x280, 0x282, 0x7, 0x71, 0x2, 0x2, 0x281, 0x280, 0x3, 0x2, 0x2, 0x2, + 0x281, 0x282, 0x3, 0x2, 0x2, 0x2, 0x282, 0x283, 0x3, 0x2, 0x2, 0x2, + 0x283, 0x285, 0x5, 0x4e, 0x28, 0x2, 0x284, 0x281, 0x3, 0x2, 0x2, 0x2, + 0x285, 0x288, 0x3, 0x2, 0x2, 0x2, 0x286, 0x284, 0x3, 0x2, 0x2, 0x2, + 0x286, 0x287, 0x3, 0x2, 0x2, 0x2, 0x287, 0x4d, 0x3, 0x2, 0x2, 0x2, 0x288, + 0x286, 0x3, 0x2, 0x2, 0x2, 0x289, 0x28a, 0x7, 0xd, 0x2, 0x2, 0x28a, + 0x28b, 0x5, 0x52, 0x2a, 0x2, 0x28b, 0x4f, 0x3, 0x2, 0x2, 0x2, 0x28c, + 0x28e, 0x7, 0x7, 0x2, 0x2, 0x28d, 0x28f, 0x7, 0x71, 0x2, 0x2, 0x28e, + 0x28d, 0x3, 0x2, 0x2, 0x2, 0x28e, 0x28f, 0x3, 0x2, 0x2, 0x2, 0x28f, + 0x294, 0x3, 0x2, 0x2, 0x2, 0x290, 0x292, 0x5, 0x94, 0x4b, 0x2, 0x291, + 0x293, 0x7, 0x71, 0x2, 0x2, 0x292, 0x291, 0x3, 0x2, 0x2, 0x2, 0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 0x5, 0x68, 0x35, 0x2, 0x310, + 0x312, 0x7, 0x71, 0x2, 0x2, 0x311, 0x310, 0x3, 0x2, 0x2, 0x2, 0x311, + 0x312, 0x3, 0x2, 0x2, 0x2, 0x312, 0x313, 0x3, 0x2, 0x2, 0x2, 0x313, + 0x315, 0x7, 0x14, 0x2, 0x2, 0x314, 0x316, 0x7, 0x71, 0x2, 0x2, 0x315, + 0x314, 0x3, 0x2, 0x2, 0x2, 0x315, 0x316, 0x3, 0x2, 0x2, 0x2, 0x316, + 0x317, 0x3, 0x2, 0x2, 0x2, 0x317, 0x319, 0x5, 0x68, 0x35, 0x2, 0x318, + 0x311, 0x3, 0x2, 0x2, 0x2, 0x319, 0x31c, 0x3, 0x2, 0x2, 0x2, 0x31a, + 0x318, 0x3, 0x2, 0x2, 0x2, 0x31a, 0x31b, 0x3, 0x2, 0x2, 0x2, 0x31b, + 0x67, 0x3, 0x2, 0x2, 0x2, 0x31c, 0x31a, 0x3, 0x2, 0x2, 0x2, 0x31d, 0x31f, + 0x9, 0x3, 0x2, 0x2, 0x31e, 0x320, 0x7, 0x71, 0x2, 0x2, 0x31f, 0x31e, + 0x3, 0x2, 0x2, 0x2, 0x31f, 0x320, 0x3, 0x2, 0x2, 0x2, 0x320, 0x322, + 0x3, 0x2, 0x2, 0x2, 0x321, 0x31d, 0x3, 0x2, 0x2, 0x2, 0x322, 0x325, + 0x3, 0x2, 0x2, 0x2, 0x323, 0x321, 0x3, 0x2, 0x2, 0x2, 0x323, 0x324, + 0x3, 0x2, 0x2, 0x2, 0x324, 0x326, 0x3, 0x2, 0x2, 0x2, 0x325, 0x323, + 0x3, 0x2, 0x2, 0x2, 0x326, 0x327, 0x5, 0x6a, 0x36, 0x2, 0x327, 0x69, + 0x3, 0x2, 0x2, 0x2, 0x328, 0x35e, 0x5, 0x6c, 0x37, 0x2, 0x329, 0x32b, + 0x7, 0x71, 0x2, 0x2, 0x32a, 0x329, 0x3, 0x2, 0x2, 0x2, 0x32a, 0x32b, + 0x3, 0x2, 0x2, 0x2, 0x32b, 0x32c, 0x3, 0x2, 0x2, 0x2, 0x32c, 0x32d, + 0x7, 0xa, 0x2, 0x2, 0x32d, 0x32e, 0x5, 0x56, 0x2c, 0x2, 0x32e, 0x32f, + 0x7, 0xc, 0x2, 0x2, 0x32f, 0x35d, 0x3, 0x2, 0x2, 0x2, 0x330, 0x332, + 0x7, 0x71, 0x2, 0x2, 0x331, 0x330, 0x3, 0x2, 0x2, 0x2, 0x331, 0x332, + 0x3, 0x2, 0x2, 0x2, 0x332, 0x333, 0x3, 0x2, 0x2, 0x2, 0x333, 0x335, + 0x7, 0xa, 0x2, 0x2, 0x334, 0x336, 0x5, 0x56, 0x2c, 0x2, 0x335, 0x334, + 0x3, 0x2, 0x2, 0x2, 0x335, 0x336, 0x3, 0x2, 0x2, 0x2, 0x336, 0x337, + 0x3, 0x2, 0x2, 0x2, 0x337, 0x339, 0x7, 0xf, 0x2, 0x2, 0x338, 0x33a, + 0x5, 0x56, 0x2c, 0x2, 0x339, 0x338, 0x3, 0x2, 0x2, 0x2, 0x339, 0x33a, + 0x3, 0x2, 0x2, 0x2, 0x33a, 0x33b, 0x3, 0x2, 0x2, 0x2, 0x33b, 0x35d, + 0x7, 0xc, 0x2, 0x2, 0x33c, 0x33e, 0x7, 0x71, 0x2, 0x2, 0x33d, 0x33c, + 0x3, 0x2, 0x2, 0x2, 0x33d, 0x33e, 0x3, 0x2, 0x2, 0x2, 0x33e, 0x33f, + 0x3, 0x2, 0x2, 0x2, 0x33f, 0x34d, 0x7, 0x15, 0x2, 0x2, 0x340, 0x341, + 0x7, 0x71, 0x2, 0x2, 0x341, 0x34d, 0x7, 0x5f, 0x2, 0x2, 0x342, 0x343, + 0x7, 0x71, 0x2, 0x2, 0x343, 0x344, 0x7, 0x60, 0x2, 0x2, 0x344, 0x345, + 0x7, 0x71, 0x2, 0x2, 0x345, 0x34d, 0x7, 0x4f, 0x2, 0x2, 0x346, 0x347, + 0x7, 0x71, 0x2, 0x2, 0x347, 0x348, 0x7, 0x61, 0x2, 0x2, 0x348, 0x349, + 0x7, 0x71, 0x2, 0x2, 0x349, 0x34d, 0x7, 0x4f, 0x2, 0x2, 0x34a, 0x34b, + 0x7, 0x71, 0x2, 0x2, 0x34b, 0x34d, 0x7, 0x62, 0x2, 0x2, 0x34c, 0x33d, + 0x3, 0x2, 0x2, 0x2, 0x34c, 0x340, 0x3, 0x2, 0x2, 0x2, 0x34c, 0x342, + 0x3, 0x2, 0x2, 0x2, 0x34c, 0x346, 0x3, 0x2, 0x2, 0x2, 0x34c, 0x34a, + 0x3, 0x2, 0x2, 0x2, 0x34d, 0x34f, 0x3, 0x2, 0x2, 0x2, 0x34e, 0x350, + 0x7, 0x71, 0x2, 0x2, 0x34f, 0x34e, 0x3, 0x2, 0x2, 0x2, 0x34f, 0x350, + 0x3, 0x2, 0x2, 0x2, 0x350, 0x351, 0x3, 0x2, 0x2, 0x2, 0x351, 0x35d, + 0x5, 0x6c, 0x37, 0x2, 0x352, 0x353, 0x7, 0x71, 0x2, 0x2, 0x353, 0x354, + 0x7, 0x63, 0x2, 0x2, 0x354, 0x355, 0x7, 0x71, 0x2, 0x2, 0x355, 0x35d, + 0x7, 0x64, 0x2, 0x2, 0x356, 0x357, 0x7, 0x71, 0x2, 0x2, 0x357, 0x358, + 0x7, 0x63, 0x2, 0x2, 0x358, 0x359, 0x7, 0x71, 0x2, 0x2, 0x359, 0x35a, + 0x7, 0x5e, 0x2, 0x2, 0x35a, 0x35b, 0x7, 0x71, 0x2, 0x2, 0x35b, 0x35d, + 0x7, 0x64, 0x2, 0x2, 0x35c, 0x32a, 0x3, 0x2, 0x2, 0x2, 0x35c, 0x331, + 0x3, 0x2, 0x2, 0x2, 0x35c, 0x34c, 0x3, 0x2, 0x2, 0x2, 0x35c, 0x352, + 0x3, 0x2, 0x2, 0x2, 0x35c, 0x356, 0x3, 0x2, 0x2, 0x2, 0x35d, 0x360, + 0x3, 0x2, 0x2, 0x2, 0x35e, 0x35c, 0x3, 0x2, 0x2, 0x2, 0x35e, 0x35f, + 0x3, 0x2, 0x2, 0x2, 0x35f, 0x6b, 0x3, 0x2, 0x2, 0x2, 0x360, 0x35e, 0x3, + 0x2, 0x2, 0x2, 0x361, 0x366, 0x5, 0x6e, 0x38, 0x2, 0x362, 0x365, 0x5, + 0x86, 0x44, 0x2, 0x363, 0x365, 0x5, 0x4c, 0x27, 0x2, 0x364, 0x362, 0x3, + 0x2, 0x2, 0x2, 0x364, 0x363, 0x3, 0x2, 0x2, 0x2, 0x365, 0x368, 0x3, + 0x2, 0x2, 0x2, 0x366, 0x364, 0x3, 0x2, 0x2, 0x2, 0x366, 0x367, 0x3, + 0x2, 0x2, 0x2, 0x367, 0x6d, 0x3, 0x2, 0x2, 0x2, 0x368, 0x366, 0x3, 0x2, + 0x2, 0x2, 0x369, 0x3d9, 0x5, 0x70, 0x39, 0x2, 0x36a, 0x3d9, 0x5, 0x8e, + 0x48, 0x2, 0x36b, 0x36d, 0x7, 0x65, 0x2, 0x2, 0x36c, 0x36e, 0x7, 0x71, + 0x2, 0x2, 0x36d, 0x36c, 0x3, 0x2, 0x2, 0x2, 0x36d, 0x36e, 0x3, 0x2, + 0x2, 0x2, 0x36e, 0x36f, 0x3, 0x2, 0x2, 0x2, 0x36f, 0x371, 0x7, 0x8, + 0x2, 0x2, 0x370, 0x372, 0x7, 0x71, 0x2, 0x2, 0x371, 0x370, 0x3, 0x2, + 0x2, 0x2, 0x371, 0x372, 0x3, 0x2, 0x2, 0x2, 0x372, 0x373, 0x3, 0x2, + 0x2, 0x2, 0x373, 0x375, 0x7, 0x7, 0x2, 0x2, 0x374, 0x376, 0x7, 0x71, + 0x2, 0x2, 0x375, 0x374, 0x3, 0x2, 0x2, 0x2, 0x375, 0x376, 0x3, 0x2, + 0x2, 0x2, 0x376, 0x377, 0x3, 0x2, 0x2, 0x2, 0x377, 0x3d9, 0x7, 0x9, + 0x2, 0x2, 0x378, 0x3d9, 0x5, 0x84, 0x43, 0x2, 0x379, 0x37b, 0x7, 0x66, + 0x2, 0x2, 0x37a, 0x37c, 0x7, 0x71, 0x2, 0x2, 0x37b, 0x37a, 0x3, 0x2, + 0x2, 0x2, 0x37b, 0x37c, 0x3, 0x2, 0x2, 0x2, 0x37c, 0x37d, 0x3, 0x2, + 0x2, 0x2, 0x37d, 0x37f, 0x7, 0x8, 0x2, 0x2, 0x37e, 0x380, 0x7, 0x71, + 0x2, 0x2, 0x37f, 0x37e, 0x3, 0x2, 0x2, 0x2, 0x37f, 0x380, 0x3, 0x2, + 0x2, 0x2, 0x380, 0x381, 0x3, 0x2, 0x2, 0x2, 0x381, 0x383, 0x5, 0x7c, + 0x3f, 0x2, 0x382, 0x384, 0x7, 0x71, 0x2, 0x2, 0x383, 0x382, 0x3, 0x2, + 0x2, 0x2, 0x383, 0x384, 0x3, 0x2, 0x2, 0x2, 0x384, 0x385, 0x3, 0x2, + 0x2, 0x2, 0x385, 0x386, 0x7, 0x9, 0x2, 0x2, 0x386, 0x3d9, 0x3, 0x2, + 0x2, 0x2, 0x387, 0x389, 0x7, 0x67, 0x2, 0x2, 0x388, 0x38a, 0x7, 0x71, + 0x2, 0x2, 0x389, 0x388, 0x3, 0x2, 0x2, 0x2, 0x389, 0x38a, 0x3, 0x2, + 0x2, 0x2, 0x38a, 0x38b, 0x3, 0x2, 0x2, 0x2, 0x38b, 0x38d, 0x7, 0x8, + 0x2, 0x2, 0x38c, 0x38e, 0x7, 0x71, 0x2, 0x2, 0x38d, 0x38c, 0x3, 0x2, + 0x2, 0x2, 0x38d, 0x38e, 0x3, 0x2, 0x2, 0x2, 0x38e, 0x38f, 0x3, 0x2, + 0x2, 0x2, 0x38f, 0x391, 0x5, 0x7c, 0x3f, 0x2, 0x390, 0x392, 0x7, 0x71, + 0x2, 0x2, 0x391, 0x390, 0x3, 0x2, 0x2, 0x2, 0x391, 0x392, 0x3, 0x2, + 0x2, 0x2, 0x392, 0x398, 0x3, 0x2, 0x2, 0x2, 0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16, 0x2, 0x2, 0x403, + 0x405, 0x7, 0x71, 0x2, 0x2, 0x404, 0x403, 0x3, 0x2, 0x2, 0x2, 0x404, + 0x405, 0x3, 0x2, 0x2, 0x2, 0x405, 0x406, 0x3, 0x2, 0x2, 0x2, 0x406, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x407, 0x409, 0x7, 0x17, 0x2, 0x2, 0x408, + 0x40a, 0x7, 0x71, 0x2, 0x2, 0x409, 0x408, 0x3, 0x2, 0x2, 0x2, 0x409, + 0x40a, 0x3, 0x2, 0x2, 0x2, 0x40a, 0x40b, 0x3, 0x2, 0x2, 0x2, 0x40b, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x40c, 0x40e, 0x7, 0x18, 0x2, 0x2, 0x40d, + 0x40f, 0x7, 0x71, 0x2, 0x2, 0x40e, 0x40d, 0x3, 0x2, 0x2, 0x2, 0x40e, + 0x40f, 0x3, 0x2, 0x2, 0x2, 0x40f, 0x410, 0x3, 0x2, 0x2, 0x2, 0x410, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x411, 0x413, 0x7, 0x19, 0x2, 0x2, 0x412, + 0x414, 0x7, 0x71, 0x2, 0x2, 0x413, 0x412, 0x3, 0x2, 0x2, 0x2, 0x413, + 0x414, 0x3, 0x2, 0x2, 0x2, 0x414, 0x415, 0x3, 0x2, 0x2, 0x2, 0x415, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x416, 0x418, 0x7, 0x1a, 0x2, 0x2, 0x417, + 0x419, 0x7, 0x71, 0x2, 0x2, 0x418, 0x417, 0x3, 0x2, 0x2, 0x2, 0x418, + 0x419, 0x3, 0x2, 0x2, 0x2, 0x419, 0x41a, 0x3, 0x2, 0x2, 0x2, 0x41a, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x41b, 0x41d, 0x7, 0x1b, 0x2, 0x2, 0x41c, + 0x41e, 0x7, 0x71, 0x2, 0x2, 0x41d, 0x41c, 0x3, 0x2, 0x2, 0x2, 0x41d, + 0x41e, 0x3, 0x2, 0x2, 0x2, 0x41e, 0x41f, 0x3, 0x2, 0x2, 0x2, 0x41f, + 0x421, 0x5, 0x62, 0x32, 0x2, 0x420, 0x3fd, 0x3, 0x2, 0x2, 0x2, 0x420, + 0x402, 0x3, 0x2, 0x2, 0x2, 0x420, 0x407, 0x3, 0x2, 0x2, 0x2, 0x420, + 0x40c, 0x3, 0x2, 0x2, 0x2, 0x420, 0x411, 0x3, 0x2, 0x2, 0x2, 0x420, + 0x416, 0x3, 0x2, 0x2, 0x2, 0x420, 0x41b, 0x3, 0x2, 0x2, 0x2, 0x421, + 0x77, 0x3, 0x2, 0x2, 0x2, 0x422, 0x424, 0x7, 0x8, 0x2, 0x2, 0x423, 0x425, + 0x7, 0x71, 0x2, 0x2, 0x424, 0x423, 0x3, 0x2, 0x2, 0x2, 0x424, 0x425, + 0x3, 0x2, 0x2, 0x2, 0x425, 0x426, 0x3, 0x2, 0x2, 0x2, 0x426, 0x428, + 0x5, 0x56, 0x2c, 0x2, 0x427, 0x429, 0x7, 0x71, 0x2, 0x2, 0x428, 0x427, + 0x3, 0x2, 0x2, 0x2, 0x428, 0x429, 0x3, 0x2, 0x2, 0x2, 0x429, 0x42a, + 0x3, 0x2, 0x2, 0x2, 0x42a, 0x42b, 0x7, 0x9, 0x2, 0x2, 0x42b, 0x79, 0x3, + 0x2, 0x2, 0x2, 0x42c, 0x431, 0x5, 0x40, 0x21, 0x2, 0x42d, 0x42f, 0x7, + 0x71, 0x2, 0x2, 0x42e, 0x42d, 0x3, 0x2, 0x2, 0x2, 0x42e, 0x42f, 0x3, + 0x2, 0x2, 0x2, 0x42f, 0x430, 0x3, 0x2, 0x2, 0x2, 0x430, 0x432, 0x5, + 0x42, 0x22, 0x2, 0x431, 0x42e, 0x3, 0x2, 0x2, 0x2, 0x432, 0x433, 0x3, + 0x2, 0x2, 0x2, 0x433, 0x431, 0x3, 0x2, 0x2, 0x2, 0x433, 0x434, 0x3, + 0x2, 0x2, 0x2, 0x434, 0x7b, 0x3, 0x2, 0x2, 0x2, 0x435, 0x43a, 0x5, 0x7e, + 0x40, 0x2, 0x436, 0x438, 0x7, 0x71, 0x2, 0x2, 0x437, 0x436, 0x3, 0x2, + 0x2, 0x2, 0x437, 0x438, 0x3, 0x2, 0x2, 0x2, 0x438, 0x439, 0x3, 0x2, + 0x2, 0x2, 0x439, 0x43b, 0x5, 0x36, 0x1c, 0x2, 0x43a, 0x437, 0x3, 0x2, + 0x2, 0x2, 0x43a, 0x43b, 0x3, 0x2, 0x2, 0x2, 0x43b, 0x7d, 0x3, 0x2, 0x2, + 0x2, 0x43c, 0x43d, 0x5, 0x88, 0x45, 0x2, 0x43d, 0x43e, 0x7, 0x71, 0x2, + 0x2, 0x43e, 0x43f, 0x7, 0x5f, 0x2, 0x2, 0x43f, 0x440, 0x7, 0x71, 0x2, + 0x2, 0x440, 0x441, 0x5, 0x56, 0x2c, 0x2, 0x441, 0x7f, 0x3, 0x2, 0x2, + 0x2, 0x442, 0x444, 0x5, 0x82, 0x42, 0x2, 0x443, 0x445, 0x7, 0x71, 0x2, + 0x2, 0x444, 0x443, 0x3, 0x2, 0x2, 0x2, 0x444, 0x445, 0x3, 0x2, 0x2, + 0x2, 0x445, 0x446, 0x3, 0x2, 0x2, 0x2, 0x446, 0x448, 0x7, 0x8, 0x2, + 0x2, 0x447, 0x449, 0x7, 0x71, 0x2, 0x2, 0x448, 0x447, 0x3, 0x2, 0x2, + 0x2, 0x448, 0x449, 0x3, 0x2, 0x2, 0x2, 0x449, 0x44e, 0x3, 0x2, 0x2, + 0x2, 0x44a, 0x44c, 0x7, 0x50, 0x2, 0x2, 0x44b, 0x44d, 0x7, 0x71, 0x2, + 0x2, 0x44c, 0x44b, 0x3, 0x2, 0x2, 0x2, 0x44c, 0x44d, 0x3, 0x2, 0x2, + 0x2, 0x44d, 0x44f, 0x3, 0x2, 0x2, 0x2, 0x44e, 0x44a, 0x3, 0x2, 0x2, + 0x2, 0x44e, 0x44f, 0x3, 0x2, 0x2, 0x2, 0x44f, 0x461, 0x3, 0x2, 0x2, + 0x2, 0x450, 0x452, 0x5, 0x56, 0x2c, 0x2, 0x451, 0x453, 0x7, 0x71, 0x2, + 0x2, 0x452, 0x451, 0x3, 0x2, 0x2, 0x2, 0x452, 0x453, 0x3, 0x2, 0x2, + 0x2, 0x453, 0x45e, 0x3, 0x2, 0x2, 0x2, 0x454, 0x456, 0x7, 0x4, 0x2, + 0x2, 0x455, 0x457, 0x7, 0x71, 0x2, 0x2, 0x456, 0x455, 0x3, 0x2, 0x2, + 0x2, 0x456, 0x457, 0x3, 0x2, 0x2, 0x2, 0x457, 0x458, 0x3, 0x2, 0x2, + 0x2, 0x458, 0x45a, 0x5, 0x56, 0x2c, 0x2, 0x459, 0x45b, 0x7, 0x71, 0x2, + 0x2, 0x45a, 0x459, 0x3, 0x2, 0x2, 0x2, 0x45a, 0x45b, 0x3, 0x2, 0x2, + 0x2, 0x45b, 0x45d, 0x3, 0x2, 0x2, 0x2, 0x45c, 0x454, 0x3, 0x2, 0x2, + 0x2, 0x45d, 0x460, 0x3, 0x2, 0x2, 0x2, 0x45e, 0x45c, 0x3, 0x2, 0x2, + 0x2, 0x45e, 0x45f, 0x3, 0x2, 0x2, 0x2, 0x45f, 0x462, 0x3, 0x2, 0x2, + 0x2, 0x460, 0x45e, 0x3, 0x2, 0x2, 0x2, 0x461, 0x450, 0x3, 0x2, 0x2, + 0x2, 0x461, 0x462, 0x3, 0x2, 0x2, 0x2, 0x462, 0x463, 0x3, 0x2, 0x2, + 0x2, 0x463, 0x464, 0x7, 0x9, 0x2, 0x2, 0x464, 0x81, 0x3, 0x2, 0x2, 0x2, + 0x465, 0x466, 0x9, 0x5, 0x2, 0x2, 0x466, 0x83, 0x3, 0x2, 0x2, 0x2, 0x467, + 0x469, 0x7, 0xa, 0x2, 0x2, 0x468, 0x46a, 0x7, 0x71, 0x2, 0x2, 0x469, + 0x468, 0x3, 0x2, 0x2, 0x2, 0x469, 0x46a, 0x3, 0x2, 0x2, 0x2, 0x46a, + 0x46b, 0x3, 0x2, 0x2, 0x2, 0x46b, 0x474, 0x5, 0x7c, 0x3f, 0x2, 0x46c, + 0x46e, 0x7, 0x71, 0x2, 0x2, 0x46d, 0x46c, 0x3, 0x2, 0x2, 0x2, 0x46d, + 0x46e, 0x3, 0x2, 0x2, 0x2, 0x46e, 0x46f, 0x3, 0x2, 0x2, 0x2, 0x46f, + 0x471, 0x7, 0xe, 0x2, 0x2, 0x470, 0x472, 0x7, 0x71, 0x2, 0x2, 0x471, + 0x470, 0x3, 0x2, 0x2, 0x2, 0x471, 0x472, 0x3, 0x2, 0x2, 0x2, 0x472, + 0x473, 0x3, 0x2, 0x2, 0x2, 0x473, 0x475, 0x5, 0x56, 0x2c, 0x2, 0x474, + 0x46d, 0x3, 0x2, 0x2, 0x2, 0x474, 0x475, 0x3, 0x2, 0x2, 0x2, 0x475, + 0x477, 0x3, 0x2, 0x2, 0x2, 0x476, 0x478, 0x7, 0x71, 0x2, 0x2, 0x477, + 0x476, 0x3, 0x2, 0x2, 0x2, 0x477, 0x478, 0x3, 0x2, 0x2, 0x2, 0x478, + 0x479, 0x3, 0x2, 0x2, 0x2, 0x479, 0x47a, 0x7, 0xc, 0x2, 0x2, 0x47a, + 0x85, 0x3, 0x2, 0x2, 0x2, 0x47b, 0x47d, 0x7, 0x71, 0x2, 0x2, 0x47c, + 0x47b, 0x3, 0x2, 0x2, 0x2, 0x47c, 0x47d, 0x3, 0x2, 0x2, 0x2, 0x47d, + 0x47e, 0x3, 0x2, 0x2, 0x2, 0x47e, 0x480, 0x7, 0x1c, 0x2, 0x2, 0x47f, + 0x481, 0x7, 0x71, 0x2, 0x2, 0x480, 0x47f, 0x3, 0x2, 0x2, 0x2, 0x480, + 0x481, 0x3, 0x2, 0x2, 0x2, 0x481, 0x486, 0x3, 0x2, 0x2, 0x2, 0x482, + 0x483, 0x5, 0x92, 0x4a, 0x2, 0x483, 0x484, 0x9, 0x6, 0x2, 0x2, 0x484, + 0x487, 0x3, 0x2, 0x2, 0x2, 0x485, 0x487, 0x5, 0x92, 0x4a, 0x2, 0x486, + 0x482, 0x3, 0x2, 0x2, 0x2, 0x486, 0x485, 0x3, 0x2, 0x2, 0x2, 0x487, + 0x87, 0x3, 0x2, 0x2, 0x2, 0x488, 0x489, 0x5, 0x98, 0x4d, 0x2, 0x489, + 0x89, 0x3, 0x2, 0x2, 0x2, 0x48a, 0x48d, 0x5, 0x96, 0x4c, 0x2, 0x48b, + 0x48d, 0x5, 0x94, 0x4b, 0x2, 0x48c, 0x48a, 0x3, 0x2, 0x2, 0x2, 0x48c, + 0x48b, 0x3, 0x2, 0x2, 0x2, 0x48d, 0x8b, 0x3, 0x2, 0x2, 0x2, 0x48e, 0x490, + 0x7, 0x1e, 0x2, 0x2, 0x48f, 0x491, 0x7, 0x71, 0x2, 0x2, 0x490, 0x48f, + 0x3, 0x2, 0x2, 0x2, 0x490, 0x491, 0x3, 0x2, 0x2, 0x2, 0x491, 0x4b3, + 0x3, 0x2, 0x2, 0x2, 0x492, 0x494, 0x5, 0x92, 0x4a, 0x2, 0x493, 0x495, + 0x7, 0x71, 0x2, 0x2, 0x494, 0x493, 0x3, 0x2, 0x2, 0x2, 0x494, 0x495, + 0x3, 0x2, 0x2, 0x2, 0x495, 0x496, 0x3, 0x2, 0x2, 0x2, 0x496, 0x498, + 0x7, 0xd, 0x2, 0x2, 0x497, 0x499, 0x7, 0x71, 0x2, 0x2, 0x498, 0x497, + 0x3, 0x2, 0x2, 0x2, 0x498, 0x499, 0x3, 0x2, 0x2, 0x2, 0x499, 0x49a, + 0x3, 0x2, 0x2, 0x2, 0x49a, 0x49c, 0x5, 0x56, 0x2c, 0x2, 0x49b, 0x49d, + 0x7, 0x71, 0x2, 0x2, 0x49c, 0x49b, 0x3, 0x2, 0x2, 0x2, 0x49c, 0x49d, + 0x3, 0x2, 0x2, 0x2, 0x49d, 0x4b0, 0x3, 0x2, 0x2, 0x2, 0x49e, 0x4a0, + 0x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 0x9, 0xc, 0x2, 0x2, 0x4d2, 0x9f, 0x3, + 0x2, 0x2, 0x2, 0xdd, 0xa1, 0xa5, 0xa8, 0xab, 0xb3, 0xb8, 0xbd, 0xc2, + 0xc9, 0xce, 0xd1, 0xdc, 0xe0, 0xe4, 0xe8, 0xeb, 0xef, 0xf9, 0x100, 0x10d, + 0x111, 0x11b, 0x12d, 0x131, 0x135, 0x139, 0x13d, 0x142, 0x149, 0x14d, + 0x152, 0x159, 0x15d, 0x160, 0x165, 0x168, 0x16c, 0x16f, 0x177, 0x17b, + 0x17f, 0x183, 0x187, 0x18c, 0x191, 0x195, 0x19a, 0x19d, 0x1a6, 0x1af, + 0x1b4, 0x1c1, 0x1c4, 0x1cc, 0x1d0, 0x1d5, 0x1da, 0x1de, 0x1e3, 0x1e9, + 0x1ee, 0x1f5, 0x1f9, 0x1fd, 0x1ff, 0x203, 0x205, 0x209, 0x20b, 0x211, + 0x217, 0x21b, 0x21e, 0x221, 0x225, 0x22b, 0x22f, 0x232, 0x235, 0x23b, + 0x23e, 0x241, 0x245, 0x24b, 0x24e, 0x251, 0x255, 0x259, 0x25c, 0x25f, + 0x262, 0x265, 0x26b, 0x270, 0x274, 0x277, 0x27c, 0x281, 0x286, 0x28e, + 0x292, 0x294, 0x298, 0x29c, 0x29e, 0x2a0, 0x2af, 0x2b9, 0x2c3, 0x2c8, + 0x2cc, 0x2d3, 0x2d8, 0x2dd, 0x2e1, 0x2e5, 0x2e9, 0x2ec, 0x2ee, 0x2f3, + 0x2f7, 0x2fb, 0x2ff, 0x303, 0x307, 0x30a, 0x30c, 0x311, 0x315, 0x31a, + 0x31f, 0x323, 0x32a, 0x331, 0x335, 0x339, 0x33d, 0x34c, 0x34f, 0x35c, + 0x35e, 0x364, 0x366, 0x36d, 0x371, 0x375, 0x37b, 0x37f, 0x383, 0x389, + 0x38d, 0x391, 0x394, 0x398, 0x39e, 0x3a2, 0x3a6, 0x3ac, 0x3b0, 0x3b4, + 0x3ba, 0x3be, 0x3c2, 0x3c8, 0x3cc, 0x3d0, 0x3d8, 0x3e0, 0x3e6, 0x3ea, + 0x3ee, 0x3f2, 0x3f6, 0x3f9, 0x3ff, 0x404, 0x409, 0x40e, 0x413, 0x418, + 0x41d, 0x420, 0x424, 0x428, 0x42e, 0x433, 0x437, 0x43a, 0x444, 0x448, + 0x44c, 0x44e, 0x452, 0x456, 0x45a, 0x45e, 0x461, 0x469, 0x46d, 0x471, + 0x474, 0x477, 0x47c, 0x480, 0x486, 0x48c, 0x490, 0x494, 0x498, 0x49c, + 0x4a0, 0x4a4, 0x4a8, 0x4ac, 0x4b0, 0x4b3, 0x4ba, 0x4be, 0x4c3, + }; + + atn::ATNDeserializer deserializer; + _atn = deserializer.deserialize(_serializedATN); + + size_t count = _atn.getNumberOfDecisions(); + _decisionToDFA.reserve(count); + for (size_t i = 0; i < count; i++) { + _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); + } +} + +CypherParser::Initializer CypherParser::_init; diff --git a/src/query/frontend/opencypher/generated/CypherParser.h b/src/query/frontend/opencypher/generated/CypherParser.h new file mode 100644 index 000000000..bf893e58f --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherParser.h @@ -0,0 +1,1658 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" + + +namespace antlrcpptest { + + +class CypherParser : public antlr4::Parser { +public: + enum { + T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7, + T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14, + T__14 = 15, T__15 = 16, T__16 = 17, T__17 = 18, T__18 = 19, T__19 = 20, + T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, T__24 = 25, T__25 = 26, + T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, T__31 = 32, + T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38, + T__38 = 39, T__39 = 40, T__40 = 41, T__41 = 42, T__42 = 43, T__43 = 44, + T__44 = 45, T__45 = 46, T__46 = 47, T__47 = 48, T__48 = 49, StringLiteral = 50, + EscapedChar = 51, HexInteger = 52, DecimalInteger = 53, OctalInteger = 54, + HexLetter = 55, HexDigit = 56, Digit = 57, NonZeroDigit = 58, NonZeroOctDigit = 59, + OctDigit = 60, ZeroDigit = 61, ExponentDecimalReal = 62, RegularDecimalReal = 63, + UNION = 64, ALL = 65, OPTIONAL = 66, MATCH = 67, UNWIND = 68, AS = 69, + MERGE = 70, ON = 71, CREATE = 72, SET = 73, DETACH = 74, DELETE = 75, + REMOVE = 76, WITH = 77, DISTINCT = 78, RETURN = 79, ORDER = 80, BY = 81, + L_SKIP = 82, LIMIT = 83, ASCENDING = 84, ASC = 85, DESCENDING = 86, + DESC = 87, WHERE = 88, OR = 89, XOR = 90, AND = 91, NOT = 92, IN = 93, + STARTS = 94, ENDS = 95, CONTAINS = 96, IS = 97, CYPHERNULL = 98, COUNT = 99, + FILTER = 100, EXTRACT = 101, ANY = 102, NONE = 103, SINGLE = 104, TRUE = 105, + FALSE = 106, UnescapedSymbolicName = 107, IdentifierStart = 108, IdentifierPart = 109, + EscapedSymbolicName = 110, SP = 111, WHITESPACE = 112, Comment = 113, + L_0X = 114 + }; + + enum { + RuleCypher = 0, RuleStatement = 1, RuleQuery = 2, RuleRegularQuery = 3, + RuleSingleQuery = 4, RuleCypherUnion = 5, RuleClause = 6, RuleCypherMatch = 7, + RuleUnwind = 8, RuleMerge = 9, RuleMergeAction = 10, RuleCreate = 11, + RuleSet = 12, RuleSetItem = 13, RuleCypherDelete = 14, RuleRemove = 15, + RuleRemoveItem = 16, RuleWith = 17, RuleCypherReturn = 18, RuleReturnBody = 19, + RuleReturnItems = 20, RuleReturnItem = 21, RuleOrder = 22, RuleSkip = 23, + RuleLimit = 24, RuleSortItem = 25, RuleWhere = 26, RulePattern = 27, + RulePatternPart = 28, RuleAnonymousPatternPart = 29, RulePatternElement = 30, + RuleNodePattern = 31, RulePatternElementChain = 32, RuleRelationshipPattern = 33, + RuleRelationshipDetail = 34, RuleProperties = 35, RuleRelationshipTypes = 36, + RuleNodeLabels = 37, RuleNodeLabel = 38, RuleRangeLiteral = 39, RuleLabelName = 40, + RuleRelTypeName = 41, RuleExpression = 42, RuleExpression12 = 43, RuleExpression11 = 44, + RuleExpression10 = 45, RuleExpression9 = 46, RuleExpression8 = 47, RuleExpression7 = 48, + RuleExpression6 = 49, RuleExpression5 = 50, RuleExpression4 = 51, RuleExpression3 = 52, + RuleExpression2 = 53, RuleAtom = 54, RuleLiteral = 55, RuleBooleanLiteral = 56, + RuleListLiteral = 57, RulePartialComparisonExpression = 58, RuleParenthesizedExpression = 59, + RuleRelationshipsPattern = 60, RuleFilterExpression = 61, RuleIdInColl = 62, + RuleFunctionInvocation = 63, RuleFunctionName = 64, RuleListComprehension = 65, + RulePropertyLookup = 66, RuleVariable = 67, RuleNumberLiteral = 68, + RuleMapLiteral = 69, RuleParameter = 70, RulePropertyExpression = 71, + RulePropertyKeyName = 72, RuleIntegerLiteral = 73, RuleDoubleLiteral = 74, + RuleSymbolicName = 75, RuleLeftArrowHead = 76, RuleRightArrowHead = 77, + RuleDash = 78 + }; + + CypherParser(antlr4::TokenStream *input); + ~CypherParser(); + + virtual std::string getGrammarFileName() const override; + virtual const antlr4::atn::ATN& getATN() const override { return _atn; }; + virtual const std::vector& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead. + virtual const std::vector& getRuleNames() const override; + virtual antlr4::dfa::Vocabulary& getVocabulary() const override; + + + class CypherContext; + class StatementContext; + class QueryContext; + class RegularQueryContext; + class SingleQueryContext; + class CypherUnionContext; + class ClauseContext; + class CypherMatchContext; + class UnwindContext; + class MergeContext; + class MergeActionContext; + class CreateContext; + class SetContext; + class SetItemContext; + class CypherDeleteContext; + class RemoveContext; + class RemoveItemContext; + class WithContext; + class CypherReturnContext; + class ReturnBodyContext; + class ReturnItemsContext; + class ReturnItemContext; + class OrderContext; + class SkipContext; + class LimitContext; + class SortItemContext; + class WhereContext; + class PatternContext; + class PatternPartContext; + class AnonymousPatternPartContext; + class PatternElementContext; + class NodePatternContext; + class PatternElementChainContext; + class RelationshipPatternContext; + class RelationshipDetailContext; + class PropertiesContext; + class RelationshipTypesContext; + class NodeLabelsContext; + class NodeLabelContext; + class RangeLiteralContext; + class LabelNameContext; + class RelTypeNameContext; + class ExpressionContext; + class Expression12Context; + class Expression11Context; + class Expression10Context; + class Expression9Context; + class Expression8Context; + class Expression7Context; + class Expression6Context; + class Expression5Context; + class Expression4Context; + class Expression3Context; + class Expression2Context; + class AtomContext; + class LiteralContext; + class BooleanLiteralContext; + class ListLiteralContext; + class PartialComparisonExpressionContext; + class ParenthesizedExpressionContext; + class RelationshipsPatternContext; + class FilterExpressionContext; + class IdInCollContext; + class FunctionInvocationContext; + class FunctionNameContext; + class ListComprehensionContext; + class PropertyLookupContext; + class VariableContext; + class NumberLiteralContext; + class MapLiteralContext; + class ParameterContext; + class PropertyExpressionContext; + class PropertyKeyNameContext; + class IntegerLiteralContext; + class DoubleLiteralContext; + class SymbolicNameContext; + class LeftArrowHeadContext; + class RightArrowHeadContext; + class DashContext; + + class CypherContext : public antlr4::ParserRuleContext { + public: + CypherContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + StatementContext *statement(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CypherContext* cypher(); + + class StatementContext : public antlr4::ParserRuleContext { + public: + StatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + QueryContext *query(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + StatementContext* statement(); + + class QueryContext : public antlr4::ParserRuleContext { + public: + QueryContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + RegularQueryContext *regularQuery(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + QueryContext* query(); + + class RegularQueryContext : public antlr4::ParserRuleContext { + public: + RegularQueryContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SingleQueryContext *singleQuery(); + std::vector cypherUnion(); + CypherUnionContext* cypherUnion(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RegularQueryContext* regularQuery(); + + class SingleQueryContext : public antlr4::ParserRuleContext { + public: + SingleQueryContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector clause(); + ClauseContext* clause(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SingleQueryContext* singleQuery(); + + class CypherUnionContext : public antlr4::ParserRuleContext { + public: + CypherUnionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *UNION(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *ALL(); + SingleQueryContext *singleQuery(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CypherUnionContext* cypherUnion(); + + class ClauseContext : public antlr4::ParserRuleContext { + public: + ClauseContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + CypherMatchContext *cypherMatch(); + UnwindContext *unwind(); + MergeContext *merge(); + CreateContext *create(); + SetContext *set(); + CypherDeleteContext *cypherDelete(); + RemoveContext *remove(); + WithContext *with(); + CypherReturnContext *cypherReturn(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ClauseContext* clause(); + + class CypherMatchContext : public antlr4::ParserRuleContext { + public: + CypherMatchContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *MATCH(); + PatternContext *pattern(); + antlr4::tree::TerminalNode *OPTIONAL(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + WhereContext *where(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CypherMatchContext* cypherMatch(); + + class UnwindContext : public antlr4::ParserRuleContext { + public: + UnwindContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *UNWIND(); + ExpressionContext *expression(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *AS(); + VariableContext *variable(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + UnwindContext* unwind(); + + class MergeContext : public antlr4::ParserRuleContext { + public: + MergeContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *MERGE(); + PatternPartContext *patternPart(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector mergeAction(); + MergeActionContext* mergeAction(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + MergeContext* merge(); + + class MergeActionContext : public antlr4::ParserRuleContext { + public: + MergeActionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ON(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *MATCH(); + SetContext *set(); + antlr4::tree::TerminalNode *CREATE(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + MergeActionContext* mergeAction(); + + class CreateContext : public antlr4::ParserRuleContext { + public: + CreateContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *CREATE(); + PatternContext *pattern(); + antlr4::tree::TerminalNode *SP(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CreateContext* create(); + + class SetContext : public antlr4::ParserRuleContext { + public: + SetContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SET(); + std::vector setItem(); + SetItemContext* setItem(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SetContext* set(); + + class SetItemContext : public antlr4::ParserRuleContext { + public: + SetItemContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PropertyExpressionContext *propertyExpression(); + ExpressionContext *expression(); + VariableContext *variable(); + NodeLabelsContext *nodeLabels(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SetItemContext* setItem(); + + class CypherDeleteContext : public antlr4::ParserRuleContext { + public: + CypherDeleteContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *DELETE(); + std::vector expression(); + ExpressionContext* expression(size_t i); + antlr4::tree::TerminalNode *DETACH(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CypherDeleteContext* cypherDelete(); + + class RemoveContext : public antlr4::ParserRuleContext { + public: + RemoveContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *REMOVE(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector removeItem(); + RemoveItemContext* removeItem(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RemoveContext* remove(); + + class RemoveItemContext : public antlr4::ParserRuleContext { + public: + RemoveItemContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + VariableContext *variable(); + NodeLabelsContext *nodeLabels(); + PropertyExpressionContext *propertyExpression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RemoveItemContext* removeItem(); + + class WithContext : public antlr4::ParserRuleContext { + public: + WithContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *WITH(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + ReturnBodyContext *returnBody(); + antlr4::tree::TerminalNode *DISTINCT(); + WhereContext *where(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + WithContext* with(); + + class CypherReturnContext : public antlr4::ParserRuleContext { + public: + CypherReturnContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *RETURN(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + ReturnBodyContext *returnBody(); + antlr4::tree::TerminalNode *DISTINCT(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CypherReturnContext* cypherReturn(); + + class ReturnBodyContext : public antlr4::ParserRuleContext { + public: + ReturnBodyContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + ReturnItemsContext *returnItems(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + OrderContext *order(); + SkipContext *skip(); + LimitContext *limit(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ReturnBodyContext* returnBody(); + + class ReturnItemsContext : public antlr4::ParserRuleContext { + public: + ReturnItemsContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector returnItem(); + ReturnItemContext* returnItem(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ReturnItemsContext* returnItems(); + + class ReturnItemContext : public antlr4::ParserRuleContext { + public: + ReturnItemContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + ExpressionContext *expression(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *AS(); + VariableContext *variable(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ReturnItemContext* returnItem(); + + class OrderContext : public antlr4::ParserRuleContext { + public: + OrderContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ORDER(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *BY(); + std::vector sortItem(); + SortItemContext* sortItem(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + OrderContext* order(); + + class SkipContext : public antlr4::ParserRuleContext { + public: + SkipContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *L_SKIP(); + antlr4::tree::TerminalNode *SP(); + ExpressionContext *expression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SkipContext* skip(); + + class LimitContext : public antlr4::ParserRuleContext { + public: + LimitContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LIMIT(); + antlr4::tree::TerminalNode *SP(); + ExpressionContext *expression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LimitContext* limit(); + + class SortItemContext : public antlr4::ParserRuleContext { + public: + SortItemContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + ExpressionContext *expression(); + antlr4::tree::TerminalNode *ASCENDING(); + antlr4::tree::TerminalNode *ASC(); + antlr4::tree::TerminalNode *DESCENDING(); + antlr4::tree::TerminalNode *DESC(); + antlr4::tree::TerminalNode *SP(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SortItemContext* sortItem(); + + class WhereContext : public antlr4::ParserRuleContext { + public: + WhereContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *WHERE(); + antlr4::tree::TerminalNode *SP(); + ExpressionContext *expression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + WhereContext* where(); + + class PatternContext : public antlr4::ParserRuleContext { + public: + PatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector patternPart(); + PatternPartContext* patternPart(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternContext* pattern(); + + class PatternPartContext : public antlr4::ParserRuleContext { + public: + PatternPartContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + VariableContext *variable(); + AnonymousPatternPartContext *anonymousPatternPart(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternPartContext* patternPart(); + + class AnonymousPatternPartContext : public antlr4::ParserRuleContext { + public: + AnonymousPatternPartContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PatternElementContext *patternElement(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AnonymousPatternPartContext* anonymousPatternPart(); + + class PatternElementContext : public antlr4::ParserRuleContext { + public: + PatternElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + NodePatternContext *nodePattern(); + std::vector patternElementChain(); + PatternElementChainContext* patternElementChain(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + PatternElementContext *patternElement(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternElementContext* patternElement(); + + class NodePatternContext : public antlr4::ParserRuleContext { + public: + NodePatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + VariableContext *variable(); + NodeLabelsContext *nodeLabels(); + PropertiesContext *properties(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NodePatternContext* nodePattern(); + + class PatternElementChainContext : public antlr4::ParserRuleContext { + public: + PatternElementChainContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + RelationshipPatternContext *relationshipPattern(); + NodePatternContext *nodePattern(); + antlr4::tree::TerminalNode *SP(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternElementChainContext* patternElementChain(); + + class RelationshipPatternContext : public antlr4::ParserRuleContext { + public: + RelationshipPatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + LeftArrowHeadContext *leftArrowHead(); + std::vector dash(); + DashContext* dash(size_t i); + RightArrowHeadContext *rightArrowHead(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + RelationshipDetailContext *relationshipDetail(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RelationshipPatternContext* relationshipPattern(); + + class RelationshipDetailContext : public antlr4::ParserRuleContext { + public: + RelationshipDetailContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + VariableContext *variable(); + RelationshipTypesContext *relationshipTypes(); + RangeLiteralContext *rangeLiteral(); + PropertiesContext *properties(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RelationshipDetailContext* relationshipDetail(); + + class PropertiesContext : public antlr4::ParserRuleContext { + public: + PropertiesContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + MapLiteralContext *mapLiteral(); + ParameterContext *parameter(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PropertiesContext* properties(); + + class RelationshipTypesContext : public antlr4::ParserRuleContext { + public: + RelationshipTypesContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector relTypeName(); + RelTypeNameContext* relTypeName(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RelationshipTypesContext* relationshipTypes(); + + class NodeLabelsContext : public antlr4::ParserRuleContext { + public: + NodeLabelsContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector nodeLabel(); + NodeLabelContext* nodeLabel(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NodeLabelsContext* nodeLabels(); + + class NodeLabelContext : public antlr4::ParserRuleContext { + public: + NodeLabelContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + LabelNameContext *labelName(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NodeLabelContext* nodeLabel(); + + class RangeLiteralContext : public antlr4::ParserRuleContext { + public: + RangeLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector integerLiteral(); + IntegerLiteralContext* integerLiteral(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RangeLiteralContext* rangeLiteral(); + + class LabelNameContext : public antlr4::ParserRuleContext { + public: + LabelNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SymbolicNameContext *symbolicName(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LabelNameContext* labelName(); + + class RelTypeNameContext : public antlr4::ParserRuleContext { + public: + RelTypeNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SymbolicNameContext *symbolicName(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RelTypeNameContext* relTypeName(); + + class ExpressionContext : public antlr4::ParserRuleContext { + public: + ExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + Expression12Context *expression12(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ExpressionContext* expression(); + + class Expression12Context : public antlr4::ParserRuleContext { + public: + Expression12Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression11(); + Expression11Context* expression11(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector OR(); + antlr4::tree::TerminalNode* OR(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression12Context* expression12(); + + class Expression11Context : public antlr4::ParserRuleContext { + public: + Expression11Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression10(); + Expression10Context* expression10(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector XOR(); + antlr4::tree::TerminalNode* XOR(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression11Context* expression11(); + + class Expression10Context : public antlr4::ParserRuleContext { + public: + Expression10Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression9(); + Expression9Context* expression9(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector AND(); + antlr4::tree::TerminalNode* AND(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression10Context* expression10(); + + class Expression9Context : public antlr4::ParserRuleContext { + public: + Expression9Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + Expression8Context *expression8(); + std::vector NOT(); + antlr4::tree::TerminalNode* NOT(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression9Context* expression9(); + + class Expression8Context : public antlr4::ParserRuleContext { + public: + Expression8Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + Expression7Context *expression7(); + std::vector partialComparisonExpression(); + PartialComparisonExpressionContext* partialComparisonExpression(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression8Context* expression8(); + + class Expression7Context : public antlr4::ParserRuleContext { + public: + Expression7Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression6(); + Expression6Context* expression6(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression7Context* expression7(); + + class Expression6Context : public antlr4::ParserRuleContext { + public: + Expression6Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression5(); + Expression5Context* expression5(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression6Context* expression6(); + + class Expression5Context : public antlr4::ParserRuleContext { + public: + Expression5Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression4(); + Expression4Context* expression4(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression5Context* expression5(); + + class Expression4Context : public antlr4::ParserRuleContext { + public: + Expression4Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + Expression3Context *expression3(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression4Context* expression4(); + + class Expression3Context : public antlr4::ParserRuleContext { + public: + Expression3Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector expression2(); + Expression2Context* expression2(size_t i); + std::vector expression(); + ExpressionContext* expression(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector IS(); + antlr4::tree::TerminalNode* IS(size_t i); + std::vector CYPHERNULL(); + antlr4::tree::TerminalNode* CYPHERNULL(size_t i); + std::vector NOT(); + antlr4::tree::TerminalNode* NOT(size_t i); + std::vector IN(); + antlr4::tree::TerminalNode* IN(size_t i); + std::vector STARTS(); + antlr4::tree::TerminalNode* STARTS(size_t i); + std::vector WITH(); + antlr4::tree::TerminalNode* WITH(size_t i); + std::vector ENDS(); + antlr4::tree::TerminalNode* ENDS(size_t i); + std::vector CONTAINS(); + antlr4::tree::TerminalNode* CONTAINS(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression3Context* expression3(); + + class Expression2Context : public antlr4::ParserRuleContext { + public: + Expression2Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + AtomContext *atom(); + std::vector propertyLookup(); + PropertyLookupContext* propertyLookup(size_t i); + std::vector nodeLabels(); + NodeLabelsContext* nodeLabels(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Expression2Context* expression2(); + + class AtomContext : public antlr4::ParserRuleContext { + public: + AtomContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + LiteralContext *literal(); + ParameterContext *parameter(); + antlr4::tree::TerminalNode *COUNT(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + ListComprehensionContext *listComprehension(); + antlr4::tree::TerminalNode *FILTER(); + FilterExpressionContext *filterExpression(); + antlr4::tree::TerminalNode *EXTRACT(); + ExpressionContext *expression(); + antlr4::tree::TerminalNode *ALL(); + antlr4::tree::TerminalNode *ANY(); + antlr4::tree::TerminalNode *NONE(); + antlr4::tree::TerminalNode *SINGLE(); + RelationshipsPatternContext *relationshipsPattern(); + ParenthesizedExpressionContext *parenthesizedExpression(); + FunctionInvocationContext *functionInvocation(); + VariableContext *variable(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AtomContext* atom(); + + class LiteralContext : public antlr4::ParserRuleContext { + public: + LiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + NumberLiteralContext *numberLiteral(); + antlr4::tree::TerminalNode *StringLiteral(); + BooleanLiteralContext *booleanLiteral(); + antlr4::tree::TerminalNode *CYPHERNULL(); + MapLiteralContext *mapLiteral(); + ListLiteralContext *listLiteral(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LiteralContext* literal(); + + class BooleanLiteralContext : public antlr4::ParserRuleContext { + public: + BooleanLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *TRUE(); + antlr4::tree::TerminalNode *FALSE(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + BooleanLiteralContext* booleanLiteral(); + + class ListLiteralContext : public antlr4::ParserRuleContext { + public: + ListLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector expression(); + ExpressionContext* expression(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ListLiteralContext* listLiteral(); + + class PartialComparisonExpressionContext : public antlr4::ParserRuleContext { + public: + PartialComparisonExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + Expression7Context *expression7(); + antlr4::tree::TerminalNode *SP(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PartialComparisonExpressionContext* partialComparisonExpression(); + + class ParenthesizedExpressionContext : public antlr4::ParserRuleContext { + public: + ParenthesizedExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + ExpressionContext *expression(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ParenthesizedExpressionContext* parenthesizedExpression(); + + class RelationshipsPatternContext : public antlr4::ParserRuleContext { + public: + RelationshipsPatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + NodePatternContext *nodePattern(); + std::vector patternElementChain(); + PatternElementChainContext* patternElementChain(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RelationshipsPatternContext* relationshipsPattern(); + + class FilterExpressionContext : public antlr4::ParserRuleContext { + public: + FilterExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + IdInCollContext *idInColl(); + WhereContext *where(); + antlr4::tree::TerminalNode *SP(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FilterExpressionContext* filterExpression(); + + class IdInCollContext : public antlr4::ParserRuleContext { + public: + IdInCollContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + VariableContext *variable(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *IN(); + ExpressionContext *expression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + IdInCollContext* idInColl(); + + class FunctionInvocationContext : public antlr4::ParserRuleContext { + public: + FunctionInvocationContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + FunctionNameContext *functionName(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + antlr4::tree::TerminalNode *DISTINCT(); + std::vector expression(); + ExpressionContext* expression(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FunctionInvocationContext* functionInvocation(); + + class FunctionNameContext : public antlr4::ParserRuleContext { + public: + FunctionNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *UnescapedSymbolicName(); + antlr4::tree::TerminalNode *EscapedSymbolicName(); + antlr4::tree::TerminalNode *COUNT(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FunctionNameContext* functionName(); + + class ListComprehensionContext : public antlr4::ParserRuleContext { + public: + ListComprehensionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + FilterExpressionContext *filterExpression(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + ExpressionContext *expression(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ListComprehensionContext* listComprehension(); + + class PropertyLookupContext : public antlr4::ParserRuleContext { + public: + PropertyLookupContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PropertyKeyNameContext *propertyKeyName(); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PropertyLookupContext* propertyLookup(); + + class VariableContext : public antlr4::ParserRuleContext { + public: + VariableContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SymbolicNameContext *symbolicName(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VariableContext* variable(); + + class NumberLiteralContext : public antlr4::ParserRuleContext { + public: + NumberLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + DoubleLiteralContext *doubleLiteral(); + IntegerLiteralContext *integerLiteral(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NumberLiteralContext* numberLiteral(); + + class MapLiteralContext : public antlr4::ParserRuleContext { + public: + MapLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + std::vector propertyKeyName(); + PropertyKeyNameContext* propertyKeyName(size_t i); + std::vector expression(); + ExpressionContext* expression(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + MapLiteralContext* mapLiteral(); + + class ParameterContext : public antlr4::ParserRuleContext { + public: + ParameterContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SymbolicNameContext *symbolicName(); + antlr4::tree::TerminalNode *DecimalInteger(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ParameterContext* parameter(); + + class PropertyExpressionContext : public antlr4::ParserRuleContext { + public: + PropertyExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + AtomContext *atom(); + std::vector propertyLookup(); + PropertyLookupContext* propertyLookup(size_t i); + std::vector SP(); + antlr4::tree::TerminalNode* SP(size_t i); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PropertyExpressionContext* propertyExpression(); + + class PropertyKeyNameContext : public antlr4::ParserRuleContext { + public: + PropertyKeyNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + SymbolicNameContext *symbolicName(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PropertyKeyNameContext* propertyKeyName(); + + class IntegerLiteralContext : public antlr4::ParserRuleContext { + public: + IntegerLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *HexInteger(); + antlr4::tree::TerminalNode *OctalInteger(); + antlr4::tree::TerminalNode *DecimalInteger(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + IntegerLiteralContext* integerLiteral(); + + class DoubleLiteralContext : public antlr4::ParserRuleContext { + public: + DoubleLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ExponentDecimalReal(); + antlr4::tree::TerminalNode *RegularDecimalReal(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + DoubleLiteralContext* doubleLiteral(); + + class SymbolicNameContext : public antlr4::ParserRuleContext { + public: + SymbolicNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *UnescapedSymbolicName(); + antlr4::tree::TerminalNode *EscapedSymbolicName(); + antlr4::tree::TerminalNode *UNION(); + antlr4::tree::TerminalNode *ALL(); + antlr4::tree::TerminalNode *OPTIONAL(); + antlr4::tree::TerminalNode *MATCH(); + antlr4::tree::TerminalNode *UNWIND(); + antlr4::tree::TerminalNode *AS(); + antlr4::tree::TerminalNode *MERGE(); + antlr4::tree::TerminalNode *ON(); + antlr4::tree::TerminalNode *CREATE(); + antlr4::tree::TerminalNode *SET(); + antlr4::tree::TerminalNode *DETACH(); + antlr4::tree::TerminalNode *DELETE(); + antlr4::tree::TerminalNode *REMOVE(); + antlr4::tree::TerminalNode *WITH(); + antlr4::tree::TerminalNode *DISTINCT(); + antlr4::tree::TerminalNode *RETURN(); + antlr4::tree::TerminalNode *ORDER(); + antlr4::tree::TerminalNode *BY(); + antlr4::tree::TerminalNode *L_SKIP(); + antlr4::tree::TerminalNode *LIMIT(); + antlr4::tree::TerminalNode *ASCENDING(); + antlr4::tree::TerminalNode *ASC(); + antlr4::tree::TerminalNode *DESCENDING(); + antlr4::tree::TerminalNode *DESC(); + antlr4::tree::TerminalNode *WHERE(); + antlr4::tree::TerminalNode *OR(); + antlr4::tree::TerminalNode *XOR(); + antlr4::tree::TerminalNode *AND(); + antlr4::tree::TerminalNode *NOT(); + antlr4::tree::TerminalNode *IN(); + antlr4::tree::TerminalNode *STARTS(); + antlr4::tree::TerminalNode *ENDS(); + antlr4::tree::TerminalNode *CONTAINS(); + antlr4::tree::TerminalNode *IS(); + antlr4::tree::TerminalNode *CYPHERNULL(); + antlr4::tree::TerminalNode *COUNT(); + antlr4::tree::TerminalNode *FILTER(); + antlr4::tree::TerminalNode *EXTRACT(); + antlr4::tree::TerminalNode *ANY(); + antlr4::tree::TerminalNode *NONE(); + antlr4::tree::TerminalNode *SINGLE(); + antlr4::tree::TerminalNode *TRUE(); + antlr4::tree::TerminalNode *FALSE(); + antlr4::tree::TerminalNode *HexLetter(); + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SymbolicNameContext* symbolicName(); + + class LeftArrowHeadContext : public antlr4::ParserRuleContext { + public: + LeftArrowHeadContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LeftArrowHeadContext* leftArrowHead(); + + class RightArrowHeadContext : public antlr4::ParserRuleContext { + public: + RightArrowHeadContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RightArrowHeadContext* rightArrowHead(); + + class DashContext : public antlr4::ParserRuleContext { + public: + DashContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + DashContext* dash(); + + +private: + static std::vector _decisionToDFA; + static antlr4::atn::PredictionContextCache _sharedContextCache; + static std::vector _ruleNames; + static std::vector _tokenNames; + + static std::vector _literalNames; + static std::vector _symbolicNames; + static antlr4::dfa::Vocabulary _vocabulary; + static antlr4::atn::ATN _atn; + static std::vector _serializedATN; + + + struct Initializer { + Initializer(); + }; + static Initializer _init; +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/generated/CypherVisitor.cpp b/src/query/frontend/opencypher/generated/CypherVisitor.cpp new file mode 100644 index 000000000..0b56ca8fd --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherVisitor.cpp @@ -0,0 +1,9 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + + +#include "CypherVisitor.h" + + +using namespace antlrcpptest; + diff --git a/src/query/frontend/opencypher/generated/CypherVisitor.h b/src/query/frontend/opencypher/generated/CypherVisitor.h new file mode 100644 index 000000000..5fc29342c --- /dev/null +++ b/src/query/frontend/opencypher/generated/CypherVisitor.h @@ -0,0 +1,184 @@ + +// Generated from /home/buda/Workspace/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6 + +#pragma once + + +#include "antlr4-runtime.h" +#include "CypherParser.h" + + +namespace antlrcpptest { + +/** + * This class defines an abstract visitor for a parse tree + * produced by CypherParser. + */ +class CypherVisitor : public antlr4::tree::AbstractParseTreeVisitor { +public: + + /** + * Visit parse trees produced by CypherParser. + */ + virtual antlrcpp::Any visitCypher(CypherParser::CypherContext *context) = 0; + + virtual antlrcpp::Any visitStatement(CypherParser::StatementContext *context) = 0; + + virtual antlrcpp::Any visitQuery(CypherParser::QueryContext *context) = 0; + + virtual antlrcpp::Any visitRegularQuery(CypherParser::RegularQueryContext *context) = 0; + + virtual antlrcpp::Any visitSingleQuery(CypherParser::SingleQueryContext *context) = 0; + + virtual antlrcpp::Any visitCypherUnion(CypherParser::CypherUnionContext *context) = 0; + + virtual antlrcpp::Any visitClause(CypherParser::ClauseContext *context) = 0; + + virtual antlrcpp::Any visitCypherMatch(CypherParser::CypherMatchContext *context) = 0; + + virtual antlrcpp::Any visitUnwind(CypherParser::UnwindContext *context) = 0; + + virtual antlrcpp::Any visitMerge(CypherParser::MergeContext *context) = 0; + + virtual antlrcpp::Any visitMergeAction(CypherParser::MergeActionContext *context) = 0; + + virtual antlrcpp::Any visitCreate(CypherParser::CreateContext *context) = 0; + + virtual antlrcpp::Any visitSet(CypherParser::SetContext *context) = 0; + + virtual antlrcpp::Any visitSetItem(CypherParser::SetItemContext *context) = 0; + + virtual antlrcpp::Any visitCypherDelete(CypherParser::CypherDeleteContext *context) = 0; + + virtual antlrcpp::Any visitRemove(CypherParser::RemoveContext *context) = 0; + + virtual antlrcpp::Any visitRemoveItem(CypherParser::RemoveItemContext *context) = 0; + + virtual antlrcpp::Any visitWith(CypherParser::WithContext *context) = 0; + + virtual antlrcpp::Any visitCypherReturn(CypherParser::CypherReturnContext *context) = 0; + + virtual antlrcpp::Any visitReturnBody(CypherParser::ReturnBodyContext *context) = 0; + + virtual antlrcpp::Any visitReturnItems(CypherParser::ReturnItemsContext *context) = 0; + + virtual antlrcpp::Any visitReturnItem(CypherParser::ReturnItemContext *context) = 0; + + virtual antlrcpp::Any visitOrder(CypherParser::OrderContext *context) = 0; + + virtual antlrcpp::Any visitSkip(CypherParser::SkipContext *context) = 0; + + virtual antlrcpp::Any visitLimit(CypherParser::LimitContext *context) = 0; + + virtual antlrcpp::Any visitSortItem(CypherParser::SortItemContext *context) = 0; + + virtual antlrcpp::Any visitWhere(CypherParser::WhereContext *context) = 0; + + virtual antlrcpp::Any visitPattern(CypherParser::PatternContext *context) = 0; + + virtual antlrcpp::Any visitPatternPart(CypherParser::PatternPartContext *context) = 0; + + virtual antlrcpp::Any visitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *context) = 0; + + virtual antlrcpp::Any visitPatternElement(CypherParser::PatternElementContext *context) = 0; + + virtual antlrcpp::Any visitNodePattern(CypherParser::NodePatternContext *context) = 0; + + virtual antlrcpp::Any visitPatternElementChain(CypherParser::PatternElementChainContext *context) = 0; + + virtual antlrcpp::Any visitRelationshipPattern(CypherParser::RelationshipPatternContext *context) = 0; + + virtual antlrcpp::Any visitRelationshipDetail(CypherParser::RelationshipDetailContext *context) = 0; + + virtual antlrcpp::Any visitProperties(CypherParser::PropertiesContext *context) = 0; + + virtual antlrcpp::Any visitRelationshipTypes(CypherParser::RelationshipTypesContext *context) = 0; + + virtual antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *context) = 0; + + virtual antlrcpp::Any visitNodeLabel(CypherParser::NodeLabelContext *context) = 0; + + virtual antlrcpp::Any visitRangeLiteral(CypherParser::RangeLiteralContext *context) = 0; + + virtual antlrcpp::Any visitLabelName(CypherParser::LabelNameContext *context) = 0; + + virtual antlrcpp::Any visitRelTypeName(CypherParser::RelTypeNameContext *context) = 0; + + virtual antlrcpp::Any visitExpression(CypherParser::ExpressionContext *context) = 0; + + virtual antlrcpp::Any visitExpression12(CypherParser::Expression12Context *context) = 0; + + virtual antlrcpp::Any visitExpression11(CypherParser::Expression11Context *context) = 0; + + virtual antlrcpp::Any visitExpression10(CypherParser::Expression10Context *context) = 0; + + virtual antlrcpp::Any visitExpression9(CypherParser::Expression9Context *context) = 0; + + virtual antlrcpp::Any visitExpression8(CypherParser::Expression8Context *context) = 0; + + virtual antlrcpp::Any visitExpression7(CypherParser::Expression7Context *context) = 0; + + virtual antlrcpp::Any visitExpression6(CypherParser::Expression6Context *context) = 0; + + virtual antlrcpp::Any visitExpression5(CypherParser::Expression5Context *context) = 0; + + virtual antlrcpp::Any visitExpression4(CypherParser::Expression4Context *context) = 0; + + virtual antlrcpp::Any visitExpression3(CypherParser::Expression3Context *context) = 0; + + virtual antlrcpp::Any visitExpression2(CypherParser::Expression2Context *context) = 0; + + virtual antlrcpp::Any visitAtom(CypherParser::AtomContext *context) = 0; + + virtual antlrcpp::Any visitLiteral(CypherParser::LiteralContext *context) = 0; + + virtual antlrcpp::Any visitBooleanLiteral(CypherParser::BooleanLiteralContext *context) = 0; + + virtual antlrcpp::Any visitListLiteral(CypherParser::ListLiteralContext *context) = 0; + + virtual antlrcpp::Any visitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *context) = 0; + + virtual antlrcpp::Any visitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *context) = 0; + + virtual antlrcpp::Any visitRelationshipsPattern(CypherParser::RelationshipsPatternContext *context) = 0; + + virtual antlrcpp::Any visitFilterExpression(CypherParser::FilterExpressionContext *context) = 0; + + virtual antlrcpp::Any visitIdInColl(CypherParser::IdInCollContext *context) = 0; + + virtual antlrcpp::Any visitFunctionInvocation(CypherParser::FunctionInvocationContext *context) = 0; + + virtual antlrcpp::Any visitFunctionName(CypherParser::FunctionNameContext *context) = 0; + + virtual antlrcpp::Any visitListComprehension(CypherParser::ListComprehensionContext *context) = 0; + + virtual antlrcpp::Any visitPropertyLookup(CypherParser::PropertyLookupContext *context) = 0; + + virtual antlrcpp::Any visitVariable(CypherParser::VariableContext *context) = 0; + + virtual antlrcpp::Any visitNumberLiteral(CypherParser::NumberLiteralContext *context) = 0; + + virtual antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *context) = 0; + + virtual antlrcpp::Any visitParameter(CypherParser::ParameterContext *context) = 0; + + virtual antlrcpp::Any visitPropertyExpression(CypherParser::PropertyExpressionContext *context) = 0; + + virtual antlrcpp::Any visitPropertyKeyName(CypherParser::PropertyKeyNameContext *context) = 0; + + virtual antlrcpp::Any visitIntegerLiteral(CypherParser::IntegerLiteralContext *context) = 0; + + virtual antlrcpp::Any visitDoubleLiteral(CypherParser::DoubleLiteralContext *context) = 0; + + virtual antlrcpp::Any visitSymbolicName(CypherParser::SymbolicNameContext *context) = 0; + + virtual antlrcpp::Any visitLeftArrowHead(CypherParser::LeftArrowHeadContext *context) = 0; + + virtual antlrcpp::Any visitRightArrowHead(CypherParser::RightArrowHeadContext *context) = 0; + + virtual antlrcpp::Any visitDash(CypherParser::DashContext *context) = 0; + + +}; + +} // namespace antlrcpptest diff --git a/src/query/frontend/opencypher/grammar/Cypher.g4 b/src/query/frontend/opencypher/grammar/Cypher.g4 new file mode 100644 index 000000000..1c0a8d431 --- /dev/null +++ b/src/query/frontend/opencypher/grammar/Cypher.g4 @@ -0,0 +1,566 @@ +/* + * Copyright (c) 2015-2016 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +grammar Cypher; + +cypher : SP? statement ( SP? ';' )? SP? ; + +statement : query ; + +query : regularQuery ; + +regularQuery : singleQuery ( SP? cypherUnion )* ; + +singleQuery : clause ( SP? clause )* ; + +cypherUnion : ( UNION SP ALL SP? singleQuery ) + | ( UNION SP? singleQuery ) + ; + +clause : cypherMatch + | unwind + | merge + | create + | set + | cypherDelete + | remove + | with + | cypherReturn + ; + +cypherMatch : ( OPTIONAL SP )? MATCH SP? pattern ( SP? where )? ; + +unwind : UNWIND SP? expression SP AS SP variable ; + +merge : MERGE SP? patternPart ( SP mergeAction )* ; + +mergeAction : ( ON SP MATCH SP set ) + | ( ON SP CREATE SP set ) + ; + +create : CREATE SP? pattern ; + +set : SET setItem ( ',' setItem )* ; + +setItem : ( propertyExpression '=' expression ) + | ( variable '=' expression ) + | ( variable '+=' expression ) + | ( variable nodeLabels ) + ; + +cypherDelete : ( DETACH SP )? DELETE SP? expression ( SP? ',' SP? expression )* ; + +remove : REMOVE SP removeItem ( SP? ',' SP? removeItem )* ; + +removeItem : ( variable nodeLabels ) + | propertyExpression + ; + +with : WITH ( SP? DISTINCT )? SP returnBody ( SP? where )? ; + +cypherReturn : RETURN ( SP? DISTINCT )? SP returnBody ; + +returnBody : returnItems ( SP order )? ( SP skip )? ( SP limit )? ; + +returnItems : ( '*' ( SP? ',' SP? returnItem )* ) + | ( returnItem ( SP? ',' SP? returnItem )* ) + ; + +returnItem : ( expression SP AS SP variable ) + | expression + ; + +order : ORDER SP BY SP sortItem ( ',' SP? sortItem )* ; + +skip : L_SKIP SP expression ; + +limit : LIMIT SP expression ; + +sortItem : expression ( SP? ( ASCENDING | ASC | DESCENDING | DESC ) )? ; + +where : WHERE SP expression ; + +pattern : patternPart ( SP? ',' SP? patternPart )* ; + +patternPart : ( variable SP? '=' SP? anonymousPatternPart ) + | anonymousPatternPart + ; + +anonymousPatternPart : patternElement ; + +patternElement : ( nodePattern ( SP? patternElementChain )* ) + | ( '(' patternElement ')' ) + ; + +nodePattern : '(' SP? ( variable SP? )? ( nodeLabels SP? )? ( properties SP? )? ')' ; + +patternElementChain : relationshipPattern SP? nodePattern ; + +relationshipPattern : ( leftArrowHead SP? dash SP? relationshipDetail? SP? dash SP? rightArrowHead ) + | ( leftArrowHead SP? dash SP? relationshipDetail? SP? dash ) + | ( dash SP? relationshipDetail? SP? dash SP? rightArrowHead ) + | ( dash SP? relationshipDetail? SP? dash ) + ; + +relationshipDetail : '[' variable? '?'? relationshipTypes? rangeLiteral? properties? ']' ; + +properties : mapLiteral + | parameter + ; + +relationshipTypes : ':' relTypeName ( SP? '|' ':'? SP? relTypeName )* ; + +nodeLabels : nodeLabel ( SP? nodeLabel )* ; + +nodeLabel : ':' labelName ; + +rangeLiteral : '*' SP? ( integerLiteral SP? )? ( '..' SP? ( integerLiteral SP? )? )? ; + +labelName : symbolicName ; + +relTypeName : symbolicName ; + +expression : expression12 ; + +expression12 : expression11 ( SP OR SP expression11 )* ; + +expression11 : expression10 ( SP XOR SP expression10 )* ; + +expression10 : expression9 ( SP AND SP expression9 )* ; + +expression9 : ( NOT SP? )* expression8 ; + +expression8 : expression7 ( SP? partialComparisonExpression )* ; + +expression7 : expression6 ( ( SP? '+' SP? expression6 ) | ( SP? '-' SP? expression6 ) )* ; + +expression6 : expression5 ( ( SP? '*' SP? expression5 ) | ( SP? '/' SP? expression5 ) | ( SP? '%' SP? expression5 ) )* ; + +expression5 : expression4 ( SP? '^' SP? expression4 )* ; + +expression4 : ( ( '+' | '-' ) SP? )* expression3 ; + +expression3 : expression2 ( ( SP? '[' expression ']' ) | ( SP? '[' expression? '..' expression? ']' ) | ( ( ( SP? '=~' ) | ( SP IN ) | ( SP STARTS SP WITH ) | ( SP ENDS SP WITH ) | ( SP CONTAINS ) ) SP? expression2 ) | ( SP IS SP CYPHERNULL ) | ( SP IS SP NOT SP CYPHERNULL ) )* ; + +expression2 : atom ( propertyLookup | nodeLabels )* ; + +atom : literal + | parameter + | ( COUNT SP? '(' SP? '*' SP? ')' ) + | listComprehension + | ( FILTER SP? '(' SP? filterExpression SP? ')' ) + | ( EXTRACT SP? '(' SP? filterExpression SP? ( SP? '|' expression )? ')' ) + | ( ALL SP? '(' SP? filterExpression SP? ')' ) + | ( ANY SP? '(' SP? filterExpression SP? ')' ) + | ( NONE SP? '(' SP? filterExpression SP? ')' ) + | ( SINGLE SP? '(' SP? filterExpression SP? ')' ) + | relationshipsPattern + | parenthesizedExpression + | functionInvocation + | variable + ; + +literal : numberLiteral + | StringLiteral + | booleanLiteral + | CYPHERNULL + | mapLiteral + | listLiteral + ; + +booleanLiteral : TRUE + | FALSE + ; + +listLiteral : '[' SP? ( expression SP? ( ',' SP? expression SP? )* )? ']' ; + +partialComparisonExpression : ( '=' SP? expression7 ) + | ( '<>' SP? expression7 ) + | ( '!=' SP? expression7 ) + | ( '<' SP? expression7 ) + | ( '>' SP? expression7 ) + | ( '<=' SP? expression7 ) + | ( '>=' SP? expression7 ) + ; + +parenthesizedExpression : '(' SP? expression SP? ')' ; + +relationshipsPattern : nodePattern ( SP? patternElementChain )+ ; + +filterExpression : idInColl ( SP? where )? ; + +idInColl : variable SP IN SP expression ; + +functionInvocation : functionName SP? '(' SP? ( DISTINCT SP? )? ( expression SP? ( ',' SP? expression SP? )* )? ')' ; + +functionName : UnescapedSymbolicName + | EscapedSymbolicName + | COUNT ; + +listComprehension : '[' SP? filterExpression ( SP? '|' SP? expression )? SP? ']' ; + +propertyLookup : SP? '.' SP? ( ( propertyKeyName ( '?' | '!' ) ) | propertyKeyName ) ; + +variable : symbolicName ; + +StringLiteral : ( '"' ( StringLiteral_0 | EscapedChar )* '"' ) + | ( '\'' ( StringLiteral_1 | EscapedChar )* '\'' ) + ; + +EscapedChar : '\\' ( '\\' | '\'' | '"' | ( 'B' | 'b' ) | ( 'F' | 'f' ) | ( 'N' | 'n' ) | ( 'R' | 'r' ) | ( 'T' | 't' ) | '_' | '%' | ( ( 'U' | 'u' ) ( HexDigit HexDigit HexDigit HexDigit ) ) | ( ( 'U' | 'u' ) ( HexDigit HexDigit HexDigit HexDigit HexDigit HexDigit HexDigit HexDigit ) ) ) ; + +numberLiteral : doubleLiteral + | integerLiteral + ; + +mapLiteral : '{' SP? ( propertyKeyName SP? ':' SP? expression SP? ( ',' SP? propertyKeyName SP? ':' SP? expression SP? )* )? '}' ; + +parameter : '$' ( symbolicName | DecimalInteger ) ; + +propertyExpression : atom ( SP? propertyLookup )+ ; + +propertyKeyName : symbolicName ; + +integerLiteral : HexInteger + | OctalInteger + | DecimalInteger + ; + +HexInteger : L_0X ( HexDigit )+ ; + +DecimalInteger : ZeroDigit + | ( NonZeroDigit ( Digit )* ) + ; + +OctalInteger : ZeroDigit ( OctDigit )+ ; + +HexLetter : ( 'A' | 'a' ) + | ( 'B' | 'b' ) + | ( 'C' | 'c' ) + | ( 'D' | 'd' ) + | ( 'E' | 'e' ) + | ( 'F' | 'f' ) + ; + +HexDigit : Digit + | HexLetter + ; + +Digit : ZeroDigit + | NonZeroDigit + ; + +NonZeroDigit : NonZeroOctDigit + | '8' + | '9' + ; + +NonZeroOctDigit : '1' + | '2' + | '3' + | '4' + | '5' + | '6' + | '7' + ; + +OctDigit : ZeroDigit + | NonZeroOctDigit + ; + +ZeroDigit : '0' ; + +doubleLiteral : ExponentDecimalReal + | RegularDecimalReal + ; + +ExponentDecimalReal : ( ( Digit )+ | ( ( Digit )+ '.' ( Digit )+ ) | ( '.' ( Digit )+ ) ) ( ( 'E' | 'e' ) | ( 'E' | 'e' ) ) '-'? ( Digit )+ ; + +RegularDecimalReal : ( Digit )* '.' ( Digit )+ ; + +symbolicName : UnescapedSymbolicName + | EscapedSymbolicName + | UNION + | ALL + | OPTIONAL + | MATCH + | UNWIND + | AS + | MERGE + | ON + | CREATE + | SET + | DETACH + | DELETE + | REMOVE + | WITH + | DISTINCT + | RETURN + | ORDER + | BY + | L_SKIP + | LIMIT + | ASCENDING + | ASC + | DESCENDING + | DESC + | WHERE + | OR + | XOR + | AND + | NOT + | IN + | STARTS + | ENDS + | CONTAINS + | IS + | CYPHERNULL + | COUNT + | FILTER + | EXTRACT + | ANY + | NONE + | SINGLE + | TRUE + | FALSE + | HexLetter + ; + +UNION : ( 'U' | 'u' ) ( 'N' | 'n' ) ( 'I' | 'i' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ; + +ALL : ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'L' | 'l' ) ; + +OPTIONAL : ( 'O' | 'o' ) ( 'P' | 'p' ) ( 'T' | 't' ) ( 'I' | 'i' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ; + +MATCH : ( 'M' | 'm' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'C' | 'c' ) ( 'H' | 'h' ) ; + +UNWIND : ( 'U' | 'u' ) ( 'N' | 'n' ) ( 'W' | 'w' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'D' | 'd' ) ; + +AS : ( 'A' | 'a' ) ( 'S' | 's' ) ; + +MERGE : ( 'M' | 'm' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'G' | 'g' ) ( 'E' | 'e' ) ; + +ON : ( 'O' | 'o' ) ( 'N' | 'n' ) ; + +CREATE : ( 'C' | 'c' ) ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'E' | 'e' ) ; + +SET : ( 'S' | 's' ) ( 'E' | 'e' ) ( 'T' | 't' ) ; + +DETACH : ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'C' | 'c' ) ( 'H' | 'h' ) ; + +DELETE : ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'L' | 'l' ) ( 'E' | 'e' ) ( 'T' | 't' ) ( 'E' | 'e' ) ; + +REMOVE : ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'M' | 'm' ) ( 'O' | 'o' ) ( 'V' | 'v' ) ( 'E' | 'e' ) ; + +WITH : ( 'W' | 'w' ) ( 'I' | 'i' ) ( 'T' | 't' ) ( 'H' | 'h' ) ; + +DISTINCT : ( 'D' | 'd' ) ( 'I' | 'i' ) ( 'S' | 's' ) ( 'T' | 't' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'C' | 'c' ) ( 'T' | 't' ) ; + +RETURN : ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'T' | 't' ) ( 'U' | 'u' ) ( 'R' | 'r' ) ( 'N' | 'n' ) ; + +ORDER : ( 'O' | 'o' ) ( 'R' | 'r' ) ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ; + +BY : ( 'B' | 'b' ) ( 'Y' | 'y' ) ; + +L_SKIP : ( 'S' | 's' ) ( 'K' | 'k' ) ( 'I' | 'i' ) ( 'P' | 'p' ) ; + +LIMIT : ( 'L' | 'l' ) ( 'I' | 'i' ) ( 'M' | 'm' ) ( 'I' | 'i' ) ( 'T' | 't' ) ; + +ASCENDING : ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' ) ( 'E' | 'e' ) ( 'N' | 'n' ) ( 'D' | 'd' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'G' | 'g' ) ; + +ASC : ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' ) ; + +DESCENDING : ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' ) ( 'E' | 'e' ) ( 'N' | 'n' ) ( 'D' | 'd' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'G' | 'g' ) ; + +DESC : ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' ) ; + +WHERE : ( 'W' | 'w' ) ( 'H' | 'h' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'E' | 'e' ) ; + +OR : ( 'O' | 'o' ) ( 'R' | 'r' ) ; + +XOR : ( 'X' | 'x' ) ( 'O' | 'o' ) ( 'R' | 'r' ) ; + +AND : ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' ) ; + +NOT : ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' ) ; + +IN : ( 'I' | 'i' ) ( 'N' | 'n' ) ; + +STARTS : ( 'S' | 's' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'R' | 'r' ) ( 'T' | 't' ) ( 'S' | 's' ) ; + +ENDS : ( 'E' | 'e' ) ( 'N' | 'n' ) ( 'D' | 'd' ) ( 'S' | 's' ) ; + +CONTAINS : ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'S' | 's' ) ; + +IS : ( 'I' | 'i' ) ( 'S' | 's' ) ; + +CYPHERNULL : ( 'N' | 'n' ) ( 'U' | 'u' ) ( 'L' | 'l' ) ( 'L' | 'l' ) ; + +COUNT : ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'U' | 'u' ) ( 'N' | 'n' ) ( 'T' | 't' ) ; + +FILTER : ( 'F' | 'f' ) ( 'I' | 'i' ) ( 'L' | 'l' ) ( 'T' | 't' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ; + +EXTRACT : ( 'E' | 'e' ) ( 'X' | 'x' ) ( 'T' | 't' ) ( 'R' | 'r' ) ( 'A' | 'a' ) ( 'C' | 'c' ) ( 'T' | 't' ) ; + +ANY : ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'Y' | 'y' ) ; + +NONE : ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'E' | 'e' ) ; + +SINGLE : ( 'S' | 's' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'G' | 'g' ) ( 'L' | 'l' ) ( 'E' | 'e' ) ; + +TRUE : ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' ) ; + +FALSE : ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' ) ; + +UnescapedSymbolicName : IdentifierStart ( IdentifierPart )* ; + +/** + * Based on the unicode identifier and pattern syntax + * (http://www.unicode.org/reports/tr31/) + * And extended with a few characters. + */ +IdentifierStart : ID_Start + | '_' + | '‿' + | '⁀' + | '⁔' + | '︳' + | '︴' + | '﹍' + | '﹎' + | '﹏' + | '_' + ; + +/** + * Based on the unicode identifier and pattern syntax + * (http://www.unicode.org/reports/tr31/) + * And extended with a few characters. + */ +IdentifierPart : ID_Continue + | Sc + ; + +/** + * Any character except "`", enclosed within `backticks`. Backticks are escaped with double backticks. */ +EscapedSymbolicName : ( '`' ( EscapedSymbolicName_0 )* '`' )+ ; + +SP : ( WHITESPACE )+ ; + +WHITESPACE : SPACE + | TAB + | LF + | VT + | FF + | CR + | FS + | GS + | RS + | US + | ' ' + | '᠎' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | '
' + | '
' + | ' ' + | ' ' + | ' ' + | ' ' + | ' ' + | Comment + ; + +Comment : ( '/*' ( Comment_1 | ( '*' Comment_2 ) )* '*/' ) + | ( '//' Comment_3 CR? ( LF | EOF ) ) + ; + +leftArrowHead : '<' + | '⟨' + | '〈' + | '﹤' + | '<' + ; + +rightArrowHead : '>' + | '⟩' + | '〉' + | '﹥' + | '>' + ; + +dash : '-' + | '­' + | '‐' + | '‑' + | '‒' + | '–' + | '—' + | '―' + | '−' + | '﹘' + | '﹣' + | '-' + ; + +L_0X : ( '0' | '0' ) ( 'X' | 'x' ) ; + +fragment FF : [\f] ; + +fragment EscapedSymbolicName_0 : [\u0000-_a-\uFFFF] ; + +fragment RS : [\u001E] ; + +fragment ID_Continue : [0-9A-Z_a-z\u00AA\u00B5\u00B7\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0377\u037A-\u037D\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7-\u09C8\u09CB-\u09CE\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C58-\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18-\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772-\u1773\u1780-\u17D3\u17D7\u17DC-\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F-\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33-\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC] ; + +fragment Comment_1 : [\u0000-)+-\uFFFF] ; + +fragment StringLiteral_1 : [\u0000-&(-[\]-\uFFFF] ; + +fragment Comment_3 : [\u0000-\t\u000B-\f\u000E-\uFFFF] ; + +fragment Comment_2 : [\u0000-.0-\uFFFF] ; + +fragment GS : [\u001D] ; + +fragment FS : [\u001C] ; + +fragment CR : [\r] ; + +fragment Sc : [$\u00A2-\u00A5\u058F\u060B\u09F2-\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BA\uA838\uFDFC\uFE69\uFF04\uFFE0-\uFFE1\uFFE5-\uFFE6] ; + +fragment SPACE : [ ] ; + +fragment TAB : [\t] ; + +fragment StringLiteral_0 : [\u0000-!#-[\]-\uFFFF] ; + +fragment LF : [\n] ; + +fragment VT : [\u000B] ; + +fragment US : [\u001F] ; + +fragment ID_Start : [A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376-\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4-\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58-\u0C59\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC] ; + diff --git a/src/query/frontend/opencypher/parser.hpp b/src/query/frontend/opencypher/parser.hpp new file mode 100644 index 000000000..ddcd67252 --- /dev/null +++ b/src/query/frontend/opencypher/parser.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include "antlr4-runtime.h" +#include "query/frontend/opencypher/generated/CypherLexer.h" +#include "query/frontend/opencypher/generated/CypherParser.h" + +namespace frontend { +namespace opencypher { + +using namespace antlrcpptest; +using namespace antlr4; + +/** + * Generates openCypher AST + */ +class Parser { + public: + /** + * @param query incomming query that has to be compiled into query plan + * the first step is to generate AST + */ + auto generate_ast(const std::string &query) { + // get tokens + ANTLRInputStream input(query.c_str()); + CypherLexer lexer(&input); + CommonTokenStream tokens(&lexer); + + // generate ast + CypherParser parser(&tokens); + tree::ParseTree *tree = parser.cypher(); + + return tree; + } +}; +} +} diff --git a/src/query/plan_compiler.hpp b/src/query/plan_compiler.hpp new file mode 100644 index 000000000..948ca64d4 --- /dev/null +++ b/src/query/plan_compiler.hpp @@ -0,0 +1,85 @@ +#pragma once + +#include + +#include "logging/default.hpp" +#include "logging/loggable.hpp" +#include "query/exception/plan_compilation.hpp" +#include "utils/string/join.hpp" + +// TODO: +// * all libraries have to be compiled in the server compile time +// * compile command has to be generated + +/** + * Compiles code into shared object (.so) + */ +class PlanCompiler : public Loggable { + public: + PlanCompiler() : Loggable("PlanCompiler") {} + + /** + * Compiles in_file into out_file (.cpp -> .so) + * + * @param in_file C++ file that can be compiled into dynamic lib + * @param out_file dynamic lib (on linux .so) + * + * @return void + */ + void compile(const std::string &in_file, const std::string &out_file) { + std::string flags; + +// TODO: sync this with cmake configuration +#ifdef NDEBUG + flags += " -DNDEBUG -O2"; +#endif +#ifdef LOG_NO_TRACE + flags += " -DLOG_NO_TRACE"; +#endif +#ifdef LOG_NO_DEBUG + flags += " -DLOG_NO_DEBUG"; +#endif +#ifdef LOG_NO_INFO + flags += " -DLOG_NO_INFO"; +#endif +#ifdef LOG_NO_WARN + flags += " -DLOG_NO_WARN"; +#endif +#ifdef LOG_NO_ERROR + flags += " -DLOG_NO_ERROR"; +#endif + + // TODO: load from config (generate compile command) + // generate compile command + auto compile_command = utils::prints( + "clang++" + flags, + // "-std=c++1y -O2 -DNDEBUG", + "-std=c++1y", // compile flags + in_file, // input file + "-o", out_file, // ouput file + "-I./include", // include paths + "-I../include", "-I../../include", "-I../../../include", + "-I../libs/fmt", "-I../../libs/fmt", "-I../../../libs/fmt", + "-L./ -L../ -L../../", "-lmemgraph_pic", + "-shared -fPIC" // shared library flags + ); + + logger.debug("compile command -> {}", compile_command); + + // synchronous call + auto compile_status = system(compile_command.c_str()); + + logger.debug("compile status {}", compile_status); + + // if compilation has failed throw exception + if (compile_status != 0) { + logger.debug("FAIL: Query Code Compilation: {} -> {}", in_file, out_file); + throw PlanCompilationException( + "Code compilation error. Generated code is not compilable or " + "compilation settings are wrong"); + } + + logger.debug("SUCCESS: Query Code Compilation: {} -> {}", in_file, + out_file); + } +}; diff --git a/src/query/plan_generator.hpp b/src/query/plan_generator.hpp new file mode 100644 index 000000000..366a397ec --- /dev/null +++ b/src/query/plan_generator.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +namespace fs = std::experimental::filesystem; + +/** + * @class PlanGenerator + * + * @tparam Frontend defines compiler frontend for query parsing + * object of this class must have method with name generate_ast + * @tparam Backend defines compiler backend for plan gen + * object of this class must have method with name generate_code + * + */ +template +class PlanGenerator { + public: + /** + * Generates query plan based on the input query + */ + void generate_plan(const std::string &query, const uint64_t stripped_hash, + const fs::path &path) { + auto ast = frontend.generate_ast(query); + backend.generate_plan(ast, query, stripped_hash, path); + } + + private: + Frontend frontend; + Backend backend; +}; diff --git a/src/query/plan_interface.hpp b/src/query/plan_interface.hpp new file mode 100644 index 000000000..66eaa490b --- /dev/null +++ b/src/query/plan_interface.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "communication/bolt/communication.hpp" +#include "database/graph_db_accessor.hpp" +#include "query/stripped.hpp" + +/** + * @class PlanInterface + * + * @brief Pure Abstract class that is interface to query plans. + * + * @tparam Stream stream for results writing. + */ +template +class PlanInterface { + public: + /** + * In derived classes this method has to be overriden in order to implement + * concrete execution plan. + * + * @param db_accessor Accessor for ihe database. + * @param args plan argument (vector of literal values from the query) + * @param stream stream for results writing + * + * @return bool status after execution (success OR fail) + */ + virtual bool run(GraphDbAccessor &db_accessor, const TypedValueStore<> &args, + Stream &stream) = 0; + + /** + * Virtual destructor in base class. + */ + virtual ~PlanInterface() {} +}; + +/** + * Defines type of underlying extern C functions and library object class name. + * (ObjectPrototype). + * + * @tparam underlying object depends on Stream template parameter because + * it will send the results throughout a custom Stream object. + */ +template +struct QueryPlanTrait { + using ObjectPrototype = PlanInterface; + using ProducePrototype = PlanInterface *(*)(); + using DestructPrototype = void (*)(PlanInterface *); +}; diff --git a/src/query/preprocessor.hpp b/src/query/preprocessor.hpp new file mode 100644 index 000000000..5f80c48e8 --- /dev/null +++ b/src/query/preprocessor.hpp @@ -0,0 +1,44 @@ +#pragma once + +#include "logging/loggable.hpp" +#include "query/stripper.hpp" + +/* + * Query preprocessing contains: + * * query stripping + * + * This class is here because conceptually process of query preprocessing + * might have more than one step + in current version of C++ standard + * isn't trivial to instantiate QueryStripper because of template arguments + + * it depends on underlying lexical analyser. + * + * The preprocessing results are: + * * stripped query | + * * stripped arguments |-> StrippedQuery + * * stripped query hash | + */ +class QueryPreprocessor : public Loggable { + public: + QueryPreprocessor() : Loggable("QueryPreprocessor") {} + + /** + * Preprocess the query: + * * strip parameters + * * calculate query hash + * + * @param query that is going to be stripped + * + * @return QueryStripped object + */ + auto preprocess(const std::string &query) { + auto preprocessed = stripper.strip(query); + + logger.info("stripped_query = {}", preprocessed.query); + logger.info("query_hash = {}", preprocessed.hash); + + return preprocessed; + } + + private: + QueryStripper stripper; +}; diff --git a/src/query/stripped.hpp b/src/query/stripped.hpp new file mode 100644 index 000000000..ec2a2935a --- /dev/null +++ b/src/query/stripped.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include "storage/typed_value_store.hpp" +#include "utils/hashing/fnv.hpp" + +/* +* StrippedQuery contains: +* * stripped query +* * plan arguments stripped from query +* * hash of stripped query +*/ +struct StrippedQuery { + StrippedQuery(const std::string &&query, TypedValueStore<> &&arguments, + HashType hash) + : query(std::forward(query)), + arguments(std::forward>(arguments)), + hash(hash) {} + + /** + * Copy constructor is deleted because we don't want to make unecessary + * copies of this object (copying of string and vector could be expensive) + */ + StrippedQuery(const StrippedQuery &other) = delete; + StrippedQuery &operator=(const StrippedQuery &other) = delete; + + /** + * Move is allowed operation because it is not expensive and we can + * move the object after it was created. + */ + StrippedQuery(StrippedQuery &&other) = default; + StrippedQuery &operator=(StrippedQuery &&other) = default; + + /** + * Stripped query + */ + const std::string query; + + /** + * Stripped arguments + */ + const TypedValueStore<> arguments; + + /** + * Hash based on stripped query. + */ + const HashType hash; +}; diff --git a/src/query/stripper.hpp b/src/query/stripper.hpp new file mode 100644 index 000000000..d932a2d9e --- /dev/null +++ b/src/query/stripper.hpp @@ -0,0 +1,103 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "logging/loggable.hpp" +#include "query/stripped.hpp" +#include "storage/typed_value_store.hpp" +#include "utils/hashing/fnv.hpp" +#include "utils/string/transform.hpp" +#include "utils/variadic/variadic.hpp" + +#include "antlr4-runtime.h" +#include "query/frontend/opencypher/generated/CypherLexer.h" +#include "query/frontend/opencypher/generated/CypherParser.h" + +using namespace antlr4; +using namespace antlrcpptest; + +/** + * @brief QueryStripper + * + * Strips the input query and returns stripped query, stripped arguments and + * stripped query hash. + */ +class QueryStripper : public Loggable { + public: + QueryStripper() : Loggable("QueryStripper") {} + + QueryStripper(const QueryStripper &) = delete; + QueryStripper(QueryStripper &&) = delete; + QueryStripper &operator=(const QueryStripper &) = delete; + QueryStripper &operator=(QueryStripper &&) = delete; + + /** + * Strips the input query (openCypher query). + * + * @param query input query + * @param separator char that is added between all literals in the stripped query + * because after stripping compiler frontend will use the stripped query to + * AST and literals have to be separated + * @return stripped query, stripped arguments and stripped query hash as a + * single object of class StrippedQuery + */ + auto strip(const std::string &query, const std::string &separator = " ") { + // generate tokens + ANTLRInputStream input(query); + CypherLexer lexer(&input); + CommonTokenStream tokens(&lexer); + + // initialize data structures that will be populated + TypedValueStore<> stripped_arguments; + std::string stripped_query; + stripped_query.reserve(query.size()); + + // iterate through tokens -> take arguments and generate stripped query + tokens.fill(); + int counter = 0; + for (auto token : tokens.getTokens()) { + int type = token->getType(); + if (type == CypherLexer::DecimalInteger || + type == CypherLexer::StringLiteral || + type == CypherLexer::RegularDecimalReal) { // TODO: add others + switch (type) { + case CypherLexer::DecimalInteger: + stripped_arguments.set(counter, std::stoi(token->getText())); + break; + case CypherLexer::StringLiteral: + stripped_arguments.set(counter, token->getText()); + break; + case CypherLexer::RegularDecimalReal: + stripped_arguments.set(counter, std::stof(token->getText())); + break; + } + stripped_query += std::to_string(counter++) + separator; + + } else if (type == CypherLexer::MATCH || type == CypherLexer::CREATE || + type == CypherLexer::RETURN || type == CypherLexer::DELETE || + type == CypherLexer::SET || + type == CypherLexer::WHERE) { // TODO: add others + auto value = token->getText(); + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + stripped_query += value + separator; + } else if (type == CypherLexer::SP || type < 0 || + type > 113) { // SP || EOF // TODO: add others if exist + // pass + } else { + stripped_query += token->getText() + separator; + } + } + + // calculate query hash + HashType hash = fnv(stripped_query); + + // return stripped query, stripped arguments and stripped query hash + return StrippedQuery(std::move(stripped_query), + std::move(stripped_arguments), hash); + } +}; diff --git a/src/query/util.hpp b/src/query/util.hpp new file mode 100644 index 000000000..8bb1534f2 --- /dev/null +++ b/src/query/util.hpp @@ -0,0 +1,68 @@ +#pragma once + +#include +#include +#include +#include + +#include "fmt/format.h" +#include "logging/default.hpp" +#include "utils/exceptions/basic_exception.hpp" + +using std::cout; +using std::endl; + +// this is a nice way how to avoid multiple definition problem with +// headers because it will create a unique namespace for each compilation unit +// http://stackoverflow.com/questions/2727582/multiple-definition-in-header-file +// but sometimes that might be a problem +namespace { + +class CodeLineFormatException : public BasicException { + public: + using BasicException::BasicException; +}; + +template +std::string format(const std::string &format_str, const Args &... args) { + return fmt::format(format_str, args...); +} + +template +std::string code_line(const std::string &format_str, const Args &... args) { + try { + return "\t" + format(format_str, args...) + "\n"; + } catch (std::runtime_error &e) { + throw CodeLineFormatException(std::string(e.what()) + " " + format_str); + } +} + +class CoutSocket { + public: + CoutSocket() : logger(logging::log->logger("Cout Socket")) {} + + int write(const std::string &str) { + logger.info(str); + return str.size(); + } + + int write(const char *data, size_t len) { + logger.info(std::string(data, len)); + return len; + } + + int write(const byte *data, size_t len) { + std::stringstream ss; + for (int i = 0; i < len; i++) { + ss << data[i]; + } + std::string output(ss.str()); + cout << output << endl; + logger.info(output); + return len; + } + + private: + Logger logger; +}; +} diff --git a/include/serialization/graph_decoder.hpp b/src/serialization/graph_decoder.hpp similarity index 100% rename from include/serialization/graph_decoder.hpp rename to src/serialization/graph_decoder.hpp diff --git a/include/serialization/graph_encoder.hpp b/src/serialization/graph_encoder.hpp similarity index 100% rename from include/serialization/graph_encoder.hpp rename to src/serialization/graph_encoder.hpp diff --git a/include/serialization/serialization.hpp b/src/serialization/serialization.hpp similarity index 100% rename from include/serialization/serialization.hpp rename to src/serialization/serialization.hpp diff --git a/include/snapshot/snapshot_decoder.hpp b/src/snapshot/snapshot_decoder.hpp similarity index 100% rename from include/snapshot/snapshot_decoder.hpp rename to src/snapshot/snapshot_decoder.hpp diff --git a/include/snapshot/snapshot_encoder.hpp b/src/snapshot/snapshot_encoder.hpp similarity index 100% rename from include/snapshot/snapshot_encoder.hpp rename to src/snapshot/snapshot_encoder.hpp diff --git a/include/snapshot/snapshot_engine.hpp b/src/snapshot/snapshot_engine.hpp similarity index 100% rename from include/snapshot/snapshot_engine.hpp rename to src/snapshot/snapshot_engine.hpp diff --git a/include/snapshot/snapshoter.hpp b/src/snapshot/snapshoter.hpp similarity index 100% rename from include/snapshot/snapshoter.hpp rename to src/snapshot/snapshoter.hpp diff --git a/src/storage/cursor.hpp b/src/storage/cursor.hpp deleted file mode 100644 index c1dcf2408..000000000 --- a/src/storage/cursor.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "transactions/transaction.hpp" -#include "mvcc/version_list.hpp" -#include "storage/model/properties/property.hpp" - -#include "storage/vertex.hpp" - -template -class Cursor : public Crtp -{ -public: - Cursor(Accessor&& accessor, It item, tx::Transaction& t) - : accessor(accessor), item(item), t(t) - { - - } - - Derived& operator++() - { - ++item; - return this->derived(); - } - - Derived& operator++(int) - { - return operator++(); - } - -protected: - Accessor accessor; - tx::Transaction& t; - It item; -}; diff --git a/include/storage/edge.hpp b/src/storage/edge.hpp similarity index 100% rename from include/storage/edge.hpp rename to src/storage/edge.hpp diff --git a/include/storage/edge_accessor.hpp b/src/storage/edge_accessor.hpp similarity index 100% rename from include/storage/edge_accessor.hpp rename to src/storage/edge_accessor.hpp diff --git a/include/storage/garbage/delete_sensitive.hpp b/src/storage/garbage/delete_sensitive.hpp similarity index 100% rename from include/storage/garbage/delete_sensitive.hpp rename to src/storage/garbage/delete_sensitive.hpp diff --git a/include/storage/garbage/garbage.hpp b/src/storage/garbage/garbage.hpp similarity index 100% rename from include/storage/garbage/garbage.hpp rename to src/storage/garbage/garbage.hpp diff --git a/include/storage/locking/lock_status.hpp b/src/storage/locking/lock_status.hpp similarity index 100% rename from include/storage/locking/lock_status.hpp rename to src/storage/locking/lock_status.hpp diff --git a/include/storage/locking/record_lock.hpp b/src/storage/locking/record_lock.hpp similarity index 100% rename from include/storage/locking/record_lock.hpp rename to src/storage/locking/record_lock.hpp diff --git a/include/storage/record_accessor.hpp b/src/storage/record_accessor.hpp similarity index 100% rename from include/storage/record_accessor.hpp rename to src/storage/record_accessor.hpp diff --git a/include/storage/typed_value.hpp b/src/storage/typed_value.hpp similarity index 100% rename from include/storage/typed_value.hpp rename to src/storage/typed_value.hpp diff --git a/include/storage/typed_value_store.hpp b/src/storage/typed_value_store.hpp similarity index 80% rename from include/storage/typed_value_store.hpp rename to src/storage/typed_value_store.hpp index bb336eff6..4eacdd894 100644 --- a/include/storage/typed_value_store.hpp +++ b/src/storage/typed_value_store.hpp @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include #include "typed_value.hpp" @@ -15,7 +16,7 @@ */ template class TypedValueStore { -public: + public: using sptr = std::shared_ptr; /** @@ -28,10 +29,9 @@ public: * @param key The key for which a TypedValue is sought. * @return See above. */ - const TypedValue& at(const TKey &key) const { - for (const auto& kv : props_) - if (kv.first == key) - return kv.second; + const TypedValue &at(const TKey &key) const { + for (const auto &kv : props_) + if (kv.first == key) return kv.second; return TypedValue::Null; } @@ -46,9 +46,9 @@ public: * value at the same key (if there was one) is replaced. * @param value The value to set. */ - template + template void set(const TKey &key, const TValue &value) { - for (auto& kv: props_) + for (auto &kv : props_) if (kv.first == key) { kv.second = TypedValue(value); return; @@ -68,9 +68,7 @@ public: * value at the same key (if there was one) is replaced. * @param value The value to set. */ - void set(const TKey &key, const char *value) { - set(key, std::string(value)); - } + void set(const TKey &key, const char *value) { set(key, std::string(value)); } /** * Removes the TypedValue for the given key. @@ -79,12 +77,9 @@ public: * @return The number of removed properties (0 or 1). */ size_t erase(const TKey &key) { - auto found = std::find_if( - props_.begin(), - props_.end(), - [&key](std::pair &kv){return kv.first == key;} - ); + props_.begin(), props_.end(), + [&key](std::pair &kv) { return kv.first == key; }); if (found != props_.end()) { props_.erase(found); @@ -96,23 +91,21 @@ public: /** * @return The number of Properties in this collection. */ - size_t size() const { - return props_.size(); - } + size_t size() const { return props_.size(); } /** * Returns a const iterator over key-value pairs. * * @return See above. */ - const auto begin() const { return props_.begin(); } + auto begin() const { return props_.begin(); } /** * Returns an end iterator. * * @return See above. */ - const auto end() const { return props_.end(); } + auto end() const { return props_.end(); } /** * Accepts two functions. @@ -123,13 +116,11 @@ public: void Accept(std::function handler, std::function finish = {}) const { if (handler) - for (const auto& prop : props_) - handler(prop.first, prop.second); + for (const auto &prop : props_) handler(prop.first, prop.second); - if (finish) - finish(); + if (finish) finish(); } -private: + private: std::vector> props_; }; diff --git a/include/storage/typed_value_utils.hpp b/src/storage/typed_value_utils.hpp similarity index 100% rename from include/storage/typed_value_utils.hpp rename to src/storage/typed_value_utils.hpp diff --git a/include/storage/unique_object_store.hpp b/src/storage/unique_object_store.hpp similarity index 100% rename from include/storage/unique_object_store.hpp rename to src/storage/unique_object_store.hpp diff --git a/include/storage/util.hpp b/src/storage/util.hpp similarity index 100% rename from include/storage/util.hpp rename to src/storage/util.hpp diff --git a/include/storage/vertex.hpp b/src/storage/vertex.hpp similarity index 100% rename from include/storage/vertex.hpp rename to src/storage/vertex.hpp diff --git a/include/storage/vertex_accessor.hpp b/src/storage/vertex_accessor.hpp similarity index 97% rename from include/storage/vertex_accessor.hpp rename to src/storage/vertex_accessor.hpp index c9c9b707a..db9b702fd 100644 --- a/include/storage/vertex_accessor.hpp +++ b/src/storage/vertex_accessor.hpp @@ -5,7 +5,6 @@ #include "storage/record_accessor.hpp" #include "storage/vertex.hpp" -#include "utils/iterator/iterator.hpp" #include "database/graph_db.hpp" // forward declaring the EdgeAccessor because it's returned diff --git a/include/template_engine/engine.hpp b/src/template_engine/engine.hpp similarity index 100% rename from include/template_engine/engine.hpp rename to src/template_engine/engine.hpp diff --git a/src/test/lockfree_list.cpp b/src/test/lockfree_list.cpp deleted file mode 100644 index e16326f03..000000000 --- a/src/test/lockfree_list.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include - -#include -#include "memory/hp.hpp" -#include "data_structures/list/lockfree_list.hpp" -#include "mvcc/atom.hpp" - -using namespace std; - -template -class ListNode { -public: - explicit ListNode(T value) : value(value) {} - - std::atomic value; - std::atomic*> prev; - std::atomic*> next; -}; - -using lf_list = lockfree::List>; -using sptr_listnode = std::shared_ptr; - -void test(sptr_listnode& list) -{ - auto& hp = memory::HP::get(); - - auto head = list->begin(); - cout << hp; - cout << "Element: " << (*head).value << endl; - - ++head; - cout << hp; - cout << "Element: " << (*head).value << endl; -} - -void print_list(sptr_listnode& list) -{ - cout << "Lockfree list: "; - auto head = list->begin(); - while (head->next != nullptr) { - cout << (*head).value << " "; - ++head; - } - cout << (*head).value << " "; - cout << endl; -} - -int main() -{ - auto& hp = memory::HP::get(); - sptr_listnode list(new lf_list()); - - list->push_front(new ListNode(1)); - list->push_front(new ListNode(2)); - list->push_front(new ListNode(3)); - - cout << "Initial list" << endl; - print_list(list); - - test(list); - cout << "After test method" << endl; - - // remove element from the list - auto rw_head = list->rw_begin(); - ++rw_head; - ++rw_head; - list->remove(rw_head); - cout << "After remove method" << endl; - - cout << "Final list" << endl; - print_list(list); - - cout << "Final HP list (before main exit, some hp references may still exist)" << endl; - cout << hp; - - return 0; -} diff --git a/src/test/unit/http_api/run.sh b/src/test/unit/http_api/run.sh deleted file mode 100755 index 4b607bfa9..000000000 --- a/src/test/unit/http_api/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -python -m unittest discover -v -s ./ -p *_test.py diff --git a/src/test/unit/http_api/vertex_crud_test.py b/src/test/unit/http_api/vertex_crud_test.py deleted file mode 100644 index dd6bd8594..000000000 --- a/src/test/unit/http_api/vertex_crud_test.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- - -import unittest -import requests - - -class VertexCrudTest(unittest.TestCase): - - def check_response_status_code(self, r, code): - ''' - Checks status code of the response and returns - response data as json. - - Returns: - response data (json) - ''' - self.assertEqual(r.status_code, code) - - def check_metadata_and_id(self, response, id=None): - ''' - Checks reponse id and return it. - ''' - self.assertIn("metadata", response) - metadata = response["metadata"] - self.assertIn("id", metadata) - response_id = metadata["id"] - if id is not None: - self.assertEqual(id, response_id) - return response_id - - def check_response_data(self, response, data): - ''' - Takes data from response json and compare them to the data - argument. - ''' - self.assertIn("data", response) - response_data = response["data"] - self.assertDictEqual(response_data, data) - return response_data - - def check_read(self, resource_id, valid_data): - ''' - Check a whole get request. - ''' - resource_url = self.endpoint + '/%s' % resource_id - r = requests.get(resource_url) - self.check_response_status_code(r, 200) - response = r.json() - self.check_metadata_and_id(response, resource_id) - self.check_response_data(response, valid_data) - - def test_crud(self): - ''' - CRUD test: - create -> read -> update -> read -> delete -> read - ''' - self.endpoint = 'http://localhost:7474/db/data/node' - - create_payload = {"foo1": "bar1", "foo2": "bar2"} - edit_payload = {"foo2": "bar22", "foo3": "bar3"} - edited_resource = {"foo1": "bar1", "foo2": "bar22", "foo3": "bar3"} - - # 1. create - r = requests.post(self.endpoint, json=create_payload) - self.check_response_status_code(r, 201) - response = r.json() - self.resource_id = self.check_metadata_and_id(response) - self.resource_url = self.endpoint + "/%s" % self.resource_id - print("Id: %s Url: %s" % (str(self.resource_id), - str(self.resource_url))) - self.check_response_data(response, create_payload) - - # 2. read - self.check_read(self.resource_id, create_payload) - - # 3. update - r = requests.put(self.resource_url, json=edit_payload) - # TODO-buda: check this also - # r = requests.put(self.resource_url, {}) - self.check_response_status_code(r, 200) - - # 4. read - self.check_read(self.resource_id, edited_resource) - - # 5. delete - r = requests.delete(self.resource_url) - self.check_response_status_code(r, 200) - - # 6. read - r = requests.get(self.resource_url) - self.check_response_status_code(r, 404) - -if __name__ == '__main__': - unittest.main() diff --git a/include/threading/.gitignore b/src/threading/.gitignore similarity index 100% rename from include/threading/.gitignore rename to src/threading/.gitignore diff --git a/include/threading/hazard_ptr.hpp b/src/threading/hazard_ptr.hpp similarity index 100% rename from include/threading/hazard_ptr.hpp rename to src/threading/hazard_ptr.hpp diff --git a/include/threading/hazard_store.hpp b/src/threading/hazard_store.hpp similarity index 100% rename from include/threading/hazard_store.hpp rename to src/threading/hazard_store.hpp diff --git a/include/threading/id.hpp b/src/threading/id.hpp similarity index 100% rename from include/threading/id.hpp rename to src/threading/id.hpp diff --git a/include/threading/pool.hpp b/src/threading/pool.hpp similarity index 97% rename from include/threading/pool.hpp rename to src/threading/pool.hpp index 021ca8916..7ee46fd7f 100644 --- a/include/threading/pool.hpp +++ b/src/threading/pool.hpp @@ -6,7 +6,7 @@ #include #include -#include "sync/lockable.hpp" +#include "threading/sync/lockable.hpp" class Pool : Lockable { diff --git a/include/threading/sync/caslock.hpp b/src/threading/sync/caslock.hpp similarity index 100% rename from include/threading/sync/caslock.hpp rename to src/threading/sync/caslock.hpp diff --git a/include/threading/sync/futex.hpp b/src/threading/sync/futex.hpp similarity index 98% rename from include/threading/sync/futex.hpp rename to src/threading/sync/futex.hpp index e11dab3d5..d4739a94f 100644 --- a/include/threading/sync/futex.hpp +++ b/src/threading/sync/futex.hpp @@ -4,7 +4,7 @@ #include #include -#include "threading/sync/lock_timeout_error.hpp" +#include "lock_timeout_error.hpp" #include "utils/cpu_relax.hpp" #include "utils/sys.hpp" diff --git a/include/threading/sync/lock_timeout_error.hpp b/src/threading/sync/lock_timeout_error.hpp similarity index 100% rename from include/threading/sync/lock_timeout_error.hpp rename to src/threading/sync/lock_timeout_error.hpp diff --git a/include/threading/sync/lockable.hpp b/src/threading/sync/lockable.hpp similarity index 94% rename from include/threading/sync/lockable.hpp rename to src/threading/sync/lockable.hpp index f99eb4a87..b68edf1f7 100644 --- a/include/threading/sync/lockable.hpp +++ b/src/threading/sync/lockable.hpp @@ -2,7 +2,7 @@ #include -#include "threading/sync/spinlock.hpp" +#include "spinlock.hpp" /** * @class Lockable diff --git a/include/threading/sync/spinlock.hpp b/src/threading/sync/spinlock.hpp similarity index 100% rename from include/threading/sync/spinlock.hpp rename to src/threading/sync/spinlock.hpp diff --git a/include/threading/sync/timed_spinlock.hpp b/src/threading/sync/timed_spinlock.hpp similarity index 100% rename from include/threading/sync/timed_spinlock.hpp rename to src/threading/sync/timed_spinlock.hpp diff --git a/include/threading/task.hpp b/src/threading/task.hpp similarity index 100% rename from include/threading/task.hpp rename to src/threading/task.hpp diff --git a/include/threading/test.cpp b/src/threading/test.cpp similarity index 100% rename from include/threading/test.cpp rename to src/threading/test.cpp diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp index b6fe76486..aa5705186 100644 --- a/src/threading/thread.cpp +++ b/src/threading/thread.cpp @@ -1,4 +1,4 @@ -#include "threading/thread.hpp" +#include "thread.hpp" Thread::Thread(Thread &&other) { diff --git a/include/threading/thread.hpp b/src/threading/thread.hpp similarity index 97% rename from include/threading/thread.hpp rename to src/threading/thread.hpp index 3aefb5cde..490ae2e5f 100644 --- a/include/threading/thread.hpp +++ b/src/threading/thread.hpp @@ -4,7 +4,7 @@ #include #include -#include "threading/id.hpp" +#include "id.hpp" #include "utils/underlying_cast.hpp" class Thread diff --git a/include/transactions/commit_log.hpp b/src/transactions/commit_log.hpp similarity index 100% rename from include/transactions/commit_log.hpp rename to src/transactions/commit_log.hpp diff --git a/include/transactions/engine.hpp b/src/transactions/engine.hpp similarity index 100% rename from include/transactions/engine.hpp rename to src/transactions/engine.hpp diff --git a/include/transactions/lock_store.hpp b/src/transactions/lock_store.hpp similarity index 100% rename from include/transactions/lock_store.hpp rename to src/transactions/lock_store.hpp diff --git a/include/transactions/snapshot.hpp b/src/transactions/snapshot.hpp similarity index 100% rename from include/transactions/snapshot.hpp rename to src/transactions/snapshot.hpp diff --git a/include/transactions/transaction.hpp b/src/transactions/transaction.hpp similarity index 100% rename from include/transactions/transaction.hpp rename to src/transactions/transaction.hpp diff --git a/include/transactions/transaction_read.hpp b/src/transactions/transaction_read.hpp similarity index 100% rename from include/transactions/transaction_read.hpp rename to src/transactions/transaction_read.hpp diff --git a/include/transactions/transaction_store.hpp b/src/transactions/transaction_store.hpp similarity index 100% rename from include/transactions/transaction_store.hpp rename to src/transactions/transaction_store.hpp diff --git a/include/utils/algorithm.hpp b/src/utils/algorithm.hpp similarity index 100% rename from include/utils/algorithm.hpp rename to src/utils/algorithm.hpp diff --git a/include/utils/align.hpp b/src/utils/align.hpp similarity index 100% rename from include/utils/align.hpp rename to src/utils/align.hpp diff --git a/include/utils/array_store.hpp b/src/utils/array_store.hpp similarity index 100% rename from include/utils/array_store.hpp rename to src/utils/array_store.hpp diff --git a/include/utils/assert.hpp b/src/utils/assert.hpp similarity index 100% rename from include/utils/assert.hpp rename to src/utils/assert.hpp diff --git a/include/utils/auto_scope.hpp b/src/utils/auto_scope.hpp similarity index 100% rename from include/utils/auto_scope.hpp rename to src/utils/auto_scope.hpp diff --git a/include/utils/bash_colors.hpp b/src/utils/bash_colors.hpp similarity index 100% rename from include/utils/bash_colors.hpp rename to src/utils/bash_colors.hpp diff --git a/include/utils/border.hpp b/src/utils/border.hpp similarity index 100% rename from include/utils/border.hpp rename to src/utils/border.hpp diff --git a/include/utils/bswap.hpp b/src/utils/bswap.hpp similarity index 100% rename from include/utils/bswap.hpp rename to src/utils/bswap.hpp diff --git a/include/utils/buffer.hpp b/src/utils/buffer.hpp similarity index 95% rename from include/utils/buffer.hpp rename to src/utils/buffer.hpp index 4c0ccc96b..807f6e2b9 100644 --- a/include/utils/buffer.hpp +++ b/src/utils/buffer.hpp @@ -2,7 +2,7 @@ #include -#include "numerics/ceil.hpp" +#include "utils/numerics/ceil.hpp" class Buffer { diff --git a/include/utils/char_str.hpp b/src/utils/char_str.hpp similarity index 100% rename from include/utils/char_str.hpp rename to src/utils/char_str.hpp diff --git a/include/utils/command_line/arguments.hpp b/src/utils/command_line/arguments.hpp similarity index 100% rename from include/utils/command_line/arguments.hpp rename to src/utils/command_line/arguments.hpp diff --git a/include/utils/config/config.hpp b/src/utils/config/config.hpp similarity index 100% rename from include/utils/config/config.hpp rename to src/utils/config/config.hpp diff --git a/include/utils/counters/atomic_counter.hpp b/src/utils/counters/atomic_counter.hpp similarity index 100% rename from include/utils/counters/atomic_counter.hpp rename to src/utils/counters/atomic_counter.hpp diff --git a/include/utils/counters/ring_counter.hpp b/src/utils/counters/ring_counter.hpp similarity index 100% rename from include/utils/counters/ring_counter.hpp rename to src/utils/counters/ring_counter.hpp diff --git a/include/utils/counters/simple_counter.hpp b/src/utils/counters/simple_counter.hpp similarity index 100% rename from include/utils/counters/simple_counter.hpp rename to src/utils/counters/simple_counter.hpp diff --git a/include/utils/cpu_relax.hpp b/src/utils/cpu_relax.hpp similarity index 100% rename from include/utils/cpu_relax.hpp rename to src/utils/cpu_relax.hpp diff --git a/include/utils/crtp.hpp b/src/utils/crtp.hpp similarity index 100% rename from include/utils/crtp.hpp rename to src/utils/crtp.hpp diff --git a/include/utils/datetime/datetime.hpp b/src/utils/datetime/datetime.hpp similarity index 100% rename from include/utils/datetime/datetime.hpp rename to src/utils/datetime/datetime.hpp diff --git a/include/utils/datetime/datetime_error.hpp b/src/utils/datetime/datetime_error.hpp similarity index 100% rename from include/utils/datetime/datetime_error.hpp rename to src/utils/datetime/datetime_error.hpp diff --git a/include/utils/datetime/timestamp.hpp b/src/utils/datetime/timestamp.hpp similarity index 100% rename from include/utils/datetime/timestamp.hpp rename to src/utils/datetime/timestamp.hpp diff --git a/include/utils/dynamic_lib.hpp b/src/utils/dynamic_lib.hpp similarity index 100% rename from include/utils/dynamic_lib.hpp rename to src/utils/dynamic_lib.hpp diff --git a/include/utils/eq_wrapper.hpp b/src/utils/eq_wrapper.hpp similarity index 100% rename from include/utils/eq_wrapper.hpp rename to src/utils/eq_wrapper.hpp diff --git a/include/utils/exceptions/basic_exception.hpp b/src/utils/exceptions/basic_exception.hpp similarity index 100% rename from include/utils/exceptions/basic_exception.hpp rename to src/utils/exceptions/basic_exception.hpp diff --git a/include/utils/exceptions/non_exaustive_switch.hpp b/src/utils/exceptions/non_exaustive_switch.hpp similarity index 100% rename from include/utils/exceptions/non_exaustive_switch.hpp rename to src/utils/exceptions/non_exaustive_switch.hpp diff --git a/include/utils/exceptions/not_yet_implemented.hpp b/src/utils/exceptions/not_yet_implemented.hpp similarity index 100% rename from include/utils/exceptions/not_yet_implemented.hpp rename to src/utils/exceptions/not_yet_implemented.hpp diff --git a/include/utils/exceptions/out_of_memory.hpp b/src/utils/exceptions/out_of_memory.hpp similarity index 100% rename from include/utils/exceptions/out_of_memory.hpp rename to src/utils/exceptions/out_of_memory.hpp diff --git a/include/utils/file.hpp b/src/utils/file.hpp similarity index 100% rename from include/utils/file.hpp rename to src/utils/file.hpp diff --git a/include/utils/fswatcher.hpp b/src/utils/fswatcher.hpp similarity index 100% rename from include/utils/fswatcher.hpp rename to src/utils/fswatcher.hpp diff --git a/include/utils/handle_write.hpp b/src/utils/handle_write.hpp similarity index 100% rename from include/utils/handle_write.hpp rename to src/utils/handle_write.hpp diff --git a/include/utils/hashing/fnv.hpp b/src/utils/hashing/fnv.hpp similarity index 100% rename from include/utils/hashing/fnv.hpp rename to src/utils/hashing/fnv.hpp diff --git a/include/utils/hashing/fnv32.hpp b/src/utils/hashing/fnv32.hpp similarity index 100% rename from include/utils/hashing/fnv32.hpp rename to src/utils/hashing/fnv32.hpp diff --git a/include/utils/hashing/fnv64.hpp b/src/utils/hashing/fnv64.hpp similarity index 100% rename from include/utils/hashing/fnv64.hpp rename to src/utils/hashing/fnv64.hpp diff --git a/include/utils/ioc/container.hpp b/src/utils/ioc/container.hpp similarity index 100% rename from include/utils/ioc/container.hpp rename to src/utils/ioc/container.hpp diff --git a/include/utils/iterator/accessor.hpp b/src/utils/iterator/accessor.hpp similarity index 100% rename from include/utils/iterator/accessor.hpp rename to src/utils/iterator/accessor.hpp diff --git a/include/utils/iterator/combined.hpp b/src/utils/iterator/combined.hpp similarity index 100% rename from include/utils/iterator/combined.hpp rename to src/utils/iterator/combined.hpp diff --git a/include/utils/iterator/composable.hpp b/src/utils/iterator/composable.hpp similarity index 100% rename from include/utils/iterator/composable.hpp rename to src/utils/iterator/composable.hpp diff --git a/include/utils/iterator/count.hpp b/src/utils/iterator/count.hpp similarity index 100% rename from include/utils/iterator/count.hpp rename to src/utils/iterator/count.hpp diff --git a/include/utils/iterator/filter.hpp b/src/utils/iterator/filter.hpp similarity index 100% rename from include/utils/iterator/filter.hpp rename to src/utils/iterator/filter.hpp diff --git a/include/utils/iterator/flat_map.hpp b/src/utils/iterator/flat_map.hpp similarity index 100% rename from include/utils/iterator/flat_map.hpp rename to src/utils/iterator/flat_map.hpp diff --git a/include/utils/iterator/for_all.hpp b/src/utils/iterator/for_all.hpp similarity index 100% rename from include/utils/iterator/for_all.hpp rename to src/utils/iterator/for_all.hpp diff --git a/include/utils/iterator/inspect.hpp b/src/utils/iterator/inspect.hpp similarity index 100% rename from include/utils/iterator/inspect.hpp rename to src/utils/iterator/inspect.hpp diff --git a/include/utils/iterator/iterator.hpp b/src/utils/iterator/iterator.hpp similarity index 100% rename from include/utils/iterator/iterator.hpp rename to src/utils/iterator/iterator.hpp diff --git a/include/utils/iterator/iterator_accessor.hpp b/src/utils/iterator/iterator_accessor.hpp similarity index 100% rename from include/utils/iterator/iterator_accessor.hpp rename to src/utils/iterator/iterator_accessor.hpp diff --git a/include/utils/iterator/iterator_base.hpp b/src/utils/iterator/iterator_base.hpp similarity index 100% rename from include/utils/iterator/iterator_base.hpp rename to src/utils/iterator/iterator_base.hpp diff --git a/include/utils/iterator/lambda_iterator.hpp b/src/utils/iterator/lambda_iterator.hpp similarity index 100% rename from include/utils/iterator/lambda_iterator.hpp rename to src/utils/iterator/lambda_iterator.hpp diff --git a/include/utils/iterator/limited_map.hpp b/src/utils/iterator/limited_map.hpp similarity index 100% rename from include/utils/iterator/limited_map.hpp rename to src/utils/iterator/limited_map.hpp diff --git a/include/utils/iterator/map.hpp b/src/utils/iterator/map.hpp similarity index 100% rename from include/utils/iterator/map.hpp rename to src/utils/iterator/map.hpp diff --git a/include/utils/iterator/query.hpp b/src/utils/iterator/query.hpp similarity index 100% rename from include/utils/iterator/query.hpp rename to src/utils/iterator/query.hpp diff --git a/include/utils/iterator/range_iterator.hpp b/src/utils/iterator/range_iterator.hpp similarity index 100% rename from include/utils/iterator/range_iterator.hpp rename to src/utils/iterator/range_iterator.hpp diff --git a/include/utils/iterator/virtual_iter.hpp b/src/utils/iterator/virtual_iter.hpp similarity index 100% rename from include/utils/iterator/virtual_iter.hpp rename to src/utils/iterator/virtual_iter.hpp diff --git a/include/utils/likely.hpp b/src/utils/likely.hpp similarity index 100% rename from include/utils/likely.hpp rename to src/utils/likely.hpp diff --git a/include/utils/linux.hpp b/src/utils/linux.hpp similarity index 100% rename from include/utils/linux.hpp rename to src/utils/linux.hpp diff --git a/include/utils/mark_ref.hpp b/src/utils/mark_ref.hpp similarity index 100% rename from include/utils/mark_ref.hpp rename to src/utils/mark_ref.hpp diff --git a/include/utils/memory/allocator.hpp b/src/utils/memory/allocator.hpp similarity index 100% rename from include/utils/memory/allocator.hpp rename to src/utils/memory/allocator.hpp diff --git a/include/utils/memory/atomic_shared_ptr.hpp b/src/utils/memory/atomic_shared_ptr.hpp similarity index 100% rename from include/utils/memory/atomic_shared_ptr.hpp rename to src/utils/memory/atomic_shared_ptr.hpp diff --git a/include/utils/memory/block_allocator.hpp b/src/utils/memory/block_allocator.hpp similarity index 100% rename from include/utils/memory/block_allocator.hpp rename to src/utils/memory/block_allocator.hpp diff --git a/include/utils/memory/maker.hpp b/src/utils/memory/maker.hpp similarity index 100% rename from include/utils/memory/maker.hpp rename to src/utils/memory/maker.hpp diff --git a/include/utils/memory/stack_allocator.hpp b/src/utils/memory/stack_allocator.hpp similarity index 100% rename from include/utils/memory/stack_allocator.hpp rename to src/utils/memory/stack_allocator.hpp diff --git a/include/utils/numerics/ceil.hpp b/src/utils/numerics/ceil.hpp similarity index 100% rename from include/utils/numerics/ceil.hpp rename to src/utils/numerics/ceil.hpp diff --git a/include/utils/numerics/log2.hpp b/src/utils/numerics/log2.hpp similarity index 100% rename from include/utils/numerics/log2.hpp rename to src/utils/numerics/log2.hpp diff --git a/include/utils/numerics/saturate.hpp b/src/utils/numerics/saturate.hpp similarity index 100% rename from include/utils/numerics/saturate.hpp rename to src/utils/numerics/saturate.hpp diff --git a/include/utils/option.hpp b/src/utils/option.hpp similarity index 100% rename from include/utils/option.hpp rename to src/utils/option.hpp diff --git a/include/utils/option_ptr.hpp b/src/utils/option_ptr.hpp similarity index 100% rename from include/utils/option_ptr.hpp rename to src/utils/option_ptr.hpp diff --git a/include/utils/order.hpp b/src/utils/order.hpp similarity index 100% rename from include/utils/order.hpp rename to src/utils/order.hpp diff --git a/include/utils/pass_key.hpp b/src/utils/pass_key.hpp similarity index 100% rename from include/utils/pass_key.hpp rename to src/utils/pass_key.hpp diff --git a/include/utils/placeholder.hpp b/src/utils/placeholder.hpp similarity index 100% rename from include/utils/placeholder.hpp rename to src/utils/placeholder.hpp diff --git a/include/utils/platform.hpp b/src/utils/platform.hpp similarity index 100% rename from include/utils/platform.hpp rename to src/utils/platform.hpp diff --git a/include/utils/random/fast_binomial.hpp b/src/utils/random/fast_binomial.hpp similarity index 100% rename from include/utils/random/fast_binomial.hpp rename to src/utils/random/fast_binomial.hpp diff --git a/include/utils/random/generator.h b/src/utils/random/generator.h similarity index 100% rename from include/utils/random/generator.h rename to src/utils/random/generator.h diff --git a/include/utils/random/xorshift128plus.hpp b/src/utils/random/xorshift128plus.hpp similarity index 100% rename from include/utils/random/xorshift128plus.hpp rename to src/utils/random/xorshift128plus.hpp diff --git a/include/utils/reference_wrapper.hpp b/src/utils/reference_wrapper.hpp similarity index 100% rename from include/utils/reference_wrapper.hpp rename to src/utils/reference_wrapper.hpp diff --git a/include/utils/signals/handler.hpp b/src/utils/signals/handler.hpp similarity index 100% rename from include/utils/signals/handler.hpp rename to src/utils/signals/handler.hpp diff --git a/include/utils/stacktrace/log.hpp b/src/utils/stacktrace/log.hpp similarity index 100% rename from include/utils/stacktrace/log.hpp rename to src/utils/stacktrace/log.hpp diff --git a/include/utils/stacktrace/stacktrace.hpp b/src/utils/stacktrace/stacktrace.hpp similarity index 100% rename from include/utils/stacktrace/stacktrace.hpp rename to src/utils/stacktrace/stacktrace.hpp diff --git a/include/utils/stream_wrapper.hpp b/src/utils/stream_wrapper.hpp similarity index 100% rename from include/utils/stream_wrapper.hpp rename to src/utils/stream_wrapper.hpp diff --git a/include/utils/string/all.hpp b/src/utils/string/all.hpp similarity index 100% rename from include/utils/string/all.hpp rename to src/utils/string/all.hpp diff --git a/include/utils/string/file.hpp b/src/utils/string/file.hpp similarity index 100% rename from include/utils/string/file.hpp rename to src/utils/string/file.hpp diff --git a/include/utils/string/intercalate.hpp b/src/utils/string/intercalate.hpp similarity index 100% rename from include/utils/string/intercalate.hpp rename to src/utils/string/intercalate.hpp diff --git a/include/utils/string/join.hpp b/src/utils/string/join.hpp similarity index 100% rename from include/utils/string/join.hpp rename to src/utils/string/join.hpp diff --git a/include/utils/string/linereader.hpp b/src/utils/string/linereader.hpp similarity index 100% rename from include/utils/string/linereader.hpp rename to src/utils/string/linereader.hpp diff --git a/include/utils/string/replace.hpp b/src/utils/string/replace.hpp similarity index 100% rename from include/utils/string/replace.hpp rename to src/utils/string/replace.hpp diff --git a/include/utils/string/split.hpp b/src/utils/string/split.hpp similarity index 100% rename from include/utils/string/split.hpp rename to src/utils/string/split.hpp diff --git a/include/utils/string/streq.hpp b/src/utils/string/streq.hpp similarity index 100% rename from include/utils/string/streq.hpp rename to src/utils/string/streq.hpp diff --git a/include/utils/string/transform.hpp b/src/utils/string/transform.hpp similarity index 100% rename from include/utils/string/transform.hpp rename to src/utils/string/transform.hpp diff --git a/include/utils/string/trim.hpp b/src/utils/string/trim.hpp similarity index 100% rename from include/utils/string/trim.hpp rename to src/utils/string/trim.hpp diff --git a/include/utils/string/weak_string.hpp b/src/utils/string/weak_string.hpp similarity index 100% rename from include/utils/string/weak_string.hpp rename to src/utils/string/weak_string.hpp diff --git a/include/utils/string_buffer.hpp b/src/utils/string_buffer.hpp similarity index 100% rename from include/utils/string_buffer.hpp rename to src/utils/string_buffer.hpp diff --git a/include/utils/sys.hpp b/src/utils/sys.hpp similarity index 100% rename from include/utils/sys.hpp rename to src/utils/sys.hpp diff --git a/include/utils/sysinfo/memory.hpp b/src/utils/sysinfo/memory.hpp similarity index 100% rename from include/utils/sysinfo/memory.hpp rename to src/utils/sysinfo/memory.hpp diff --git a/include/utils/terminate_handler.hpp b/src/utils/terminate_handler.hpp similarity index 100% rename from include/utils/terminate_handler.hpp rename to src/utils/terminate_handler.hpp diff --git a/include/utils/time/time.hpp b/src/utils/time/time.hpp similarity index 100% rename from include/utils/time/time.hpp rename to src/utils/time/time.hpp diff --git a/include/utils/time/timer.hpp b/src/utils/time/timer.hpp similarity index 100% rename from include/utils/time/timer.hpp rename to src/utils/time/timer.hpp diff --git a/include/utils/timer/timer.hpp b/src/utils/timer/timer.hpp similarity index 100% rename from include/utils/timer/timer.hpp rename to src/utils/timer/timer.hpp diff --git a/include/utils/total_ordering.hpp b/src/utils/total_ordering.hpp similarity index 100% rename from include/utils/total_ordering.hpp rename to src/utils/total_ordering.hpp diff --git a/include/utils/total_ordering_with.hpp b/src/utils/total_ordering_with.hpp similarity index 100% rename from include/utils/total_ordering_with.hpp rename to src/utils/total_ordering_with.hpp diff --git a/include/utils/type_discovery.hpp b/src/utils/type_discovery.hpp similarity index 100% rename from include/utils/type_discovery.hpp rename to src/utils/type_discovery.hpp diff --git a/include/utils/types/byte.hpp b/src/utils/types/byte.hpp similarity index 100% rename from include/utils/types/byte.hpp rename to src/utils/types/byte.hpp diff --git a/include/utils/underlying_cast.hpp b/src/utils/underlying_cast.hpp similarity index 100% rename from include/utils/underlying_cast.hpp rename to src/utils/underlying_cast.hpp diff --git a/include/utils/variadic/variadic.hpp b/src/utils/variadic/variadic.hpp similarity index 100% rename from include/utils/variadic/variadic.hpp rename to src/utils/variadic/variadic.hpp diff --git a/include/utils/visitor/visitable.hpp b/src/utils/visitor/visitable.hpp similarity index 100% rename from include/utils/visitor/visitable.hpp rename to src/utils/visitor/visitable.hpp diff --git a/include/utils/visitor/visitor.hpp b/src/utils/visitor/visitor.hpp similarity index 100% rename from include/utils/visitor/visitor.hpp rename to src/utils/visitor/visitor.hpp diff --git a/include/utils/void.hpp b/src/utils/void.hpp similarity index 100% rename from include/utils/void.hpp rename to src/utils/void.hpp diff --git a/tests/benchmark/CMakeLists.txt b/tests/benchmark/CMakeLists.txt index 799f68212..9e8c7cd45 100644 --- a/tests/benchmark/CMakeLists.txt +++ b/tests/benchmark/CMakeLists.txt @@ -36,6 +36,8 @@ foreach(test_cpp ${test_type_cpps}) target_link_libraries(${target_name} ${fmt_static_lib}) # yaml parser lib target_link_libraries(${target_name} ${yaml_static_lib}) + # antlr + target_link_libraries(${target_name} antlr_opencypher_parser_lib) # register test set(output_path diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index 15a860548..6f7e329aa 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -27,7 +27,6 @@ foreach(test_cpp ${test_type_cpps}) # link libraries target_link_libraries(${target_name} dl) - target_link_libraries(${target_name} cypher_lib) # filesystem target_link_libraries(${target_name} stdc++fs) # threads (cross-platform) @@ -38,6 +37,8 @@ foreach(test_cpp ${test_type_cpps}) target_link_libraries(${target_name} ${fmt_static_lib}) # yaml parser lib target_link_libraries(${target_name} ${yaml_static_lib}) + # antlr + target_link_libraries(${target_name} antlr_opencypher_parser_lib) # register test add_test(${target_name} ${exec_name}) diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt index be4adc650..f1522cff9 100644 --- a/tests/manual/CMakeLists.txt +++ b/tests/manual/CMakeLists.txt @@ -36,8 +36,8 @@ foreach(test_cpp ${test_type_cpps}) target_link_libraries(${target_name} ${fmt_static_lib}) # yaml parser lib target_link_libraries(${target_name} ${yaml_static_lib}) - # cypher lib - target_link_libraries(${target_name} cypher_lib) + # antlr + target_link_libraries(${target_name} antlr_opencypher_parser_lib) # dynamic lib target_link_libraries(${target_name} dl) diff --git a/tests/manual/antlr_parser.cpp b/tests/manual/antlr_parser.cpp new file mode 100644 index 000000000..1c01e2289 --- /dev/null +++ b/tests/manual/antlr_parser.cpp @@ -0,0 +1,33 @@ +#include + +#include "antlr4-runtime.h" +#include "query/frontend/opencypher/generated/CypherLexer.h" +#include "query/frontend/opencypher/generated/CypherParser.h" + +using namespace antlrcpptest; +using namespace antlr4; + +int main(int, const char **a) +{ + const char *query = a[1]; + + ANTLRInputStream input(query); + CypherLexer lexer(&input); + CommonTokenStream tokens(&lexer); + + tokens.fill(); + for (auto token : tokens.getTokens()) + { + std::cout << "TYPE: " << token->getType() << + "; TEXT: " << token->getText() << + "; STRING: " << token->toString() << std::endl; + } + + CypherParser parser(&tokens); + tree::ParseTree *tree = parser.cypher(); + + std::cout << tree->toStringTree(&parser) << std::endl << std::endl; + + return 0; +} + diff --git a/tests/manual/cypher_ast.cpp b/tests/manual/cypher_ast.cpp deleted file mode 100644 index a8aa62e7e..000000000 --- a/tests/manual/cypher_ast.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/** - * DEPRICATED! - * - * TODO: print AST (just for one query) using Antlr's visitor or listener - * the new file name should be opencypher_ast.cpp - */ - -#include -#include -#include - -#include "query/language/cypher/common.hpp" -#include "query/language/cypher/compiler.hpp" -#include "query/language/cypher/debug/tree_print.hpp" -#include "utils/command_line/arguments.hpp" -#include "utils/terminate_handler.hpp" -#include "utils/variadic/variadic.hpp" - -using utils::println; -using std::cout; - -int main(int argc, char *argv[]) -{ - std::set_terminate(&terminate_handler); - - // // arguments parsing - auto arguments = all_arguments(argc, argv); - - // // query extraction - auto queries = extract_queries(arguments); - - for (auto &query : queries) - { - println("QUERY: ", query); - auto print_visitor = new PrintVisitor(cout); - cypher::Compiler compiler; - auto tree = compiler.syntax_tree(query); - tree.root->accept(*print_visitor); - println(""); - } - - return 0; -} diff --git a/tests/manual/cypher_traversal.cpp b/tests/manual/cypher_traversal.cpp deleted file mode 100644 index b4597d701..000000000 --- a/tests/manual/cypher_traversal.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** - * DEPRICATED! - * - * TODO: remove once when Antlr will be integrated - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "query/language/cypher/compiler.hpp" -#include "query/language/cypher/debug/tree_print.hpp" - -namespace fs = std::experimental::filesystem; - -using std::cout; -using std::endl; - -auto load_queries() -{ - std::vector queries; - - fs::path queries_path = "../data/queries/cypher"; - std::string query_file_extension = "cypher"; - - for (auto& directory_entry : - fs::recursive_directory_iterator(queries_path)) { - - auto path = directory_entry.path().string(); - - // skip directories - if (!fs::is_regular_file(directory_entry)) - continue; - - // skip non cypher files - auto file_extension = path.substr(path.find_last_of(".") + 1); - if (file_extension != query_file_extension) - continue; - - // load a cypher query and put the query into queries container - std::ifstream infile(path.c_str()); - if (infile) { - std::string file_text((std::istreambuf_iterator(infile)), - std::istreambuf_iterator()); - queries.emplace_back(file_text); - } - } - - return queries; -} - -int main() -{ - auto queries = load_queries(); - std::string comment = "#"; - - int counter = 0; - for (auto& query : queries) { - if (query.substr(0, comment.size()) == comment) { - cout << "Query is commented out: " << query << endl; - continue; - } - cout << "QUERY IS: " << query << endl; - auto print_visitor = new PrintVisitor(cout); - cypher::Compiler compiler; - auto tree = compiler.syntax_tree(query); - tree.root->accept(*print_visitor); - cout << endl << "Test ok: " << query << endl; - counter++; - delete print_visitor; - } - cout << endl << endl << counter << " tests passed"; - - return 0; -} diff --git a/tests/manual/query_hash.cpp b/tests/manual/query_hash.cpp index 96bd797f5..59e92da36 100644 --- a/tests/manual/query_hash.cpp +++ b/tests/manual/query_hash.cpp @@ -1,7 +1,8 @@ #include #include -#include "query/language/cypher/common.hpp" +#include "logging/default.hpp" +#include "logging/streams/stdout.hpp" #include "query/preprocessor.hpp" #include "utils/command_line/arguments.hpp" #include "utils/type_discovery.hpp" @@ -18,6 +19,9 @@ using utils::println; */ int main(int argc, char **argv) { + logging::init_sync(); + logging::log->pipe(std::make_unique()); + // init args REGISTER_ARGS(argc, argv); diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index e41bcc681..a464cb870 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -38,8 +38,8 @@ foreach(test_cpp ${test_type_cpps}) target_link_libraries(${target_name} ${fmt_static_lib}) # yaml parser lib target_link_libraries(${target_name} ${yaml_static_lib}) - # cypher lib - target_link_libraries(${target_name} cypher_lib) + # antlr + target_link_libraries(${target_name} antlr_opencypher_parser_lib) # dynamic lib target_link_libraries(${target_name} dl)