<commit_before># Copyright 2006-2008 The FLWOR Foundation.
# 
# 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.
SET(RUNTIME_SRCS)

#STRING(LENGTH "${CMAKE_SOURCE_DIR}/src/runtime/spec/" RUNTIME_SPEC_LENGTH)

SET(RUNTIME_HEADER_GENERATOR "${CMAKE_SOURCE_DIR}/src/runtime/spec/iterator_h.xq")
SET(RUNTIME_CPP_GENERATOR    "${CMAKE_SOURCE_DIR}/src/runtime/spec/iterator_cpp.xq")
SET(PRINTER_VISITOR_HEADER_GENERATOR      "${CMAKE_SOURCE_DIR}/src/runtime/spec/printer_visitor_h.xq")
SET(PRINTER_VISITOR_CPP_VISITOR_GENERATOR "${CMAKE_SOURCE_DIR}/src/runtime/spec/printer_visitor_cpp.xq")
SET(PLANINTER_VISITOR_HEADER_GENERATOR    "${CMAKE_SOURCE_DIR}/src/runtime/spec/plan_iter_visitor_h.xq")

FOREACH(SPEC_FILE ${SPEC_FILES})
  STRING(LENGTH ${SPEC_FILE} SPEC_FILE_NAME_LENGTH)
  MATH(EXPR SPEC_PREFIX_LENGTH "${SPEC_FILE_NAME_LENGTH} - 4")
  STRING(SUBSTRING ${SPEC_FILE} 0 ${SPEC_PREFIX_LENGTH} SPEC_PREFIX)
  STRING(REPLACE "/" "_" SPEC_PREFIX_NAME ${SPEC_PREFIX} )

  SET(ABSOLUTE_SPEC_FILE_NAME "${CMAKE_SOURCE_DIR}/src/runtime/spec/${SPEC_FILE}")

  RUNTIME_GENERATOR(${RUNTIME_CPP_GENERATOR}
                    ${RUNTIME_HEADER_GENERATOR}
                    "${ABSOLUTE_SPEC_FILE_NAME}"
                    "src/runtime/${SPEC_PREFIX}"
                    "name:=runtime_${SPEC_PREFIX_NAME}"
                    "input=${ABSOLUTE_SPEC_FILE_NAME}"
                    ${ZORBA_WORKS})

  LIST(APPEND RUNTIME_SRCS 
              "${SPEC_PREFIX}.cpp"
              "${SPEC_PREFIX}_impl.cpp")
ENDFOREACH(SPEC_FILE)

# generate the printer_visitor.h and printer_visitor.cpp
# given all the spec files as a list
# the printer_visitor.cpp and printer_visitor_impl.cpp are added to the RUNTIME_SRCS
# the printer_visitor.h depends on the planiter_visitor.h file
PRINTER_VISITOR_GENERATOR(${PRINTER_VISITOR_CPP_VISITOR_GENERATOR}
                          ${PRINTER_VISITOR_HEADER_GENERATOR}
                          "${ABSOLUTE_SPEC_FILES}"
                          "src/runtime/visitors/printer_visitor"
                          "files:=${ABSOLUTE_SPEC_FILES}"
                          ${ZORBA_WORKS})

LIST(APPEND RUNTIME_SRCS
    visitors/printer_visitor.cpp
    visitors/printer_visitor_impl.cpp
)

PLANINTER_VISITOR_GENERATOR(${PLANINTER_VISITOR_HEADER_GENERATOR}
                            "${ABSOLUTE_SPEC_FILES}"
                            "src/runtime/visitors/planiter_visitor"
                            "files:=${SPEC_FILES}"
                            ${ZORBA_WORKS})


LIST(APPEND RUNTIME_SRCS
    accessors/AccessorsImpl.cpp
    visitors/printer_visitor_api.cpp
    api/plan_iterator_wrapper.cpp
    api/plan_wrapper.cpp
    base/plan_iterator.cpp
    booleans/BooleanImpl.cpp
    collections/CollectionsImpl.cpp
    core/arithmetic_impl.cpp
    core/constructors.cpp
    core/flwor_iterator.cpp
    core/fncall_iterator.cpp
    core/item_iterator.cpp
    core/nodeid_iterators.cpp
    core/path_iterators.cpp
    core/sequencetypes.cpp
    core/trycatch.cpp
    core/var_iterators.cpp
    core/gflwor/common.cpp
    core/gflwor/tuplestream_iterator.cpp
    core/gflwor/for_iterator.cpp
    core/gflwor/let_iterator.cpp
    core/gflwor/where_iterator.cpp
    core/gflwor/count_iterator.cpp
    core/gflwor/groupby_iterator.cpp
    core/gflwor/tuplesource_iterator.cpp
    core/gflwor/window_iterator.cpp
    core/gflwor/orderby_iterator.cpp
    core/gflwor/outerfor_iterator.cpp
    core/tuple_iterators.cpp
    core/internal_operators.cpp
    durations_dates_times/DurationsDatesTimesImpl.cpp
    debug/debug_iterators.cpp
    debug/zorba_debug_iterator.cpp
    eval/FnContextImpl.cpp
    indexing/value_index_impl.cpp
    numerics/NumericsImpl.cpp
    qnames/QNamesImpl.cpp
    strings/StringsImpl.cpp
    sequences/SequencesImpl.cpp
    visitors/iterprinter.cpp
    update/update.cpp
    misc/MiscImpl.cpp
    nodes/NodesImpl.cpp
    util/item_iterator.cpp
    util/UtilImpl.cpp
    util/timeout.cpp
    util/flowctl_exception.cpp
    fnput/fnput.cpp
)

HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS debug)

IF (ZORBA_WITH_REST)
  SET(RUNTIME_SRCS ${RUNTIME_SRCS} rest/rest.cpp)
  HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS rest)
ENDIF (ZORBA_WITH_REST)

IF (ZORBA_WITH_EMAIL)
  SET(RUNTIME_SRCS ${RUNTIME_SRCS} email/EmailImpl.cpp)
  HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS email)
ENDIF (ZORBA_WITH_EMAIL)
<commit_msg>Removed warning related to fnput that is added twice in libsimplestore. Note: the runtime generated files are added automatically by CMake to RUNTIME_SRCS.<commit_after># Copyright 2006-2008 The FLWOR Foundation.
# 
# 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.
SET(RUNTIME_SRCS)

#STRING(LENGTH "${CMAKE_SOURCE_DIR}/src/runtime/spec/" RUNTIME_SPEC_LENGTH)

SET(RUNTIME_HEADER_GENERATOR "${CMAKE_SOURCE_DIR}/src/runtime/spec/iterator_h.xq")
SET(RUNTIME_CPP_GENERATOR    "${CMAKE_SOURCE_DIR}/src/runtime/spec/iterator_cpp.xq")
SET(PRINTER_VISITOR_HEADER_GENERATOR      "${CMAKE_SOURCE_DIR}/src/runtime/spec/printer_visitor_h.xq")
SET(PRINTER_VISITOR_CPP_VISITOR_GENERATOR "${CMAKE_SOURCE_DIR}/src/runtime/spec/printer_visitor_cpp.xq")
SET(PLANINTER_VISITOR_HEADER_GENERATOR    "${CMAKE_SOURCE_DIR}/src/runtime/spec/plan_iter_visitor_h.xq")

FOREACH(SPEC_FILE ${SPEC_FILES})
  STRING(LENGTH ${SPEC_FILE} SPEC_FILE_NAME_LENGTH)
  MATH(EXPR SPEC_PREFIX_LENGTH "${SPEC_FILE_NAME_LENGTH} - 4")
  STRING(SUBSTRING ${SPEC_FILE} 0 ${SPEC_PREFIX_LENGTH} SPEC_PREFIX)
  STRING(REPLACE "/" "_" SPEC_PREFIX_NAME ${SPEC_PREFIX} )

  SET(ABSOLUTE_SPEC_FILE_NAME "${CMAKE_SOURCE_DIR}/src/runtime/spec/${SPEC_FILE}")

  RUNTIME_GENERATOR(${RUNTIME_CPP_GENERATOR}
                    ${RUNTIME_HEADER_GENERATOR}
                    "${ABSOLUTE_SPEC_FILE_NAME}"
                    "src/runtime/${SPEC_PREFIX}"
                    "name:=runtime_${SPEC_PREFIX_NAME}"
                    "input=${ABSOLUTE_SPEC_FILE_NAME}"
                    ${ZORBA_WORKS})

  LIST(APPEND RUNTIME_SRCS 
              "${SPEC_PREFIX}.cpp"
              "${SPEC_PREFIX}_impl.cpp")
ENDFOREACH(SPEC_FILE)

# generate the printer_visitor.h and printer_visitor.cpp
# given all the spec files as a list
# the printer_visitor.cpp and printer_visitor_impl.cpp are added to the RUNTIME_SRCS
# the printer_visitor.h depends on the planiter_visitor.h file
PRINTER_VISITOR_GENERATOR(${PRINTER_VISITOR_CPP_VISITOR_GENERATOR}
                          ${PRINTER_VISITOR_HEADER_GENERATOR}
                          "${ABSOLUTE_SPEC_FILES}"
                          "src/runtime/visitors/printer_visitor"
                          "files:=${ABSOLUTE_SPEC_FILES}"
                          ${ZORBA_WORKS})

LIST(APPEND RUNTIME_SRCS
    visitors/printer_visitor.cpp
    visitors/printer_visitor_impl.cpp
)

PLANINTER_VISITOR_GENERATOR(${PLANINTER_VISITOR_HEADER_GENERATOR}
                            "${ABSOLUTE_SPEC_FILES}"
                            "src/runtime/visitors/planiter_visitor"
                            "files:=${SPEC_FILES}"
                            ${ZORBA_WORKS})


LIST(APPEND RUNTIME_SRCS
    accessors/AccessorsImpl.cpp
    visitors/printer_visitor_api.cpp
    api/plan_iterator_wrapper.cpp
    api/plan_wrapper.cpp
    base/plan_iterator.cpp
    booleans/BooleanImpl.cpp
    collections/CollectionsImpl.cpp
    core/arithmetic_impl.cpp
    core/constructors.cpp
    core/flwor_iterator.cpp
    core/fncall_iterator.cpp
    core/item_iterator.cpp
    core/nodeid_iterators.cpp
    core/path_iterators.cpp
    core/sequencetypes.cpp
    core/trycatch.cpp
    core/var_iterators.cpp
    core/gflwor/common.cpp
    core/gflwor/tuplestream_iterator.cpp
    core/gflwor/for_iterator.cpp
    core/gflwor/let_iterator.cpp
    core/gflwor/where_iterator.cpp
    core/gflwor/count_iterator.cpp
    core/gflwor/groupby_iterator.cpp
    core/gflwor/tuplesource_iterator.cpp
    core/gflwor/window_iterator.cpp
    core/gflwor/orderby_iterator.cpp
    core/gflwor/outerfor_iterator.cpp
    core/tuple_iterators.cpp
    core/internal_operators.cpp
    durations_dates_times/DurationsDatesTimesImpl.cpp
    debug/debug_iterators.cpp
    debug/zorba_debug_iterator.cpp
    eval/FnContextImpl.cpp
    indexing/value_index_impl.cpp
    numerics/NumericsImpl.cpp
    qnames/QNamesImpl.cpp
    strings/StringsImpl.cpp
    sequences/SequencesImpl.cpp
    visitors/iterprinter.cpp
    update/update.cpp
    misc/MiscImpl.cpp
    nodes/NodesImpl.cpp
    util/item_iterator.cpp
    util/UtilImpl.cpp
    util/timeout.cpp
    util/flowctl_exception.cpp
)

HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS debug)

IF (ZORBA_WITH_REST)
  SET(RUNTIME_SRCS ${RUNTIME_SRCS} rest/rest.cpp)
  HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS rest)
ENDIF (ZORBA_WITH_REST)

IF (ZORBA_WITH_EMAIL)
  SET(RUNTIME_SRCS ${RUNTIME_SRCS} email/EmailImpl.cpp)
  HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS email)
ENDIF (ZORBA_WITH_EMAIL)

{'fraction_non_alphanumeric': 0.08709478867459992, 'fraction_numerical': 0.002872384078785392, 'mean_word_length': 3.4515981735159817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4981158', 'n_tokens_mistral': 3394, 'n_tokens_neox': 3263, 'n_words': 507}