<commit_before>cmake_minimum_required(VERSION 2.8)
project(sea_lang)

set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")

find_package(BISON)
find_package(FLEX)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

bison_target(SeaParser
    ${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.y
    ${CMAKE_CURRENT_BINARY_DIR}/grammar.c
)
flex_target(SeaLexer
    ${CMAKE_CURRENT_SOURCE_DIR}/src/flex_parser.l
    ${CMAKE_CURRENT_BINARY_DIR}/flex_parser.c
)

add_flex_bison_dependency(SeaLexer SeaParser)


add_library(libsea
    src/ast/ast.c
    src/ast/render_ast.c
    src/compile.c
    src/dict/dict.c
    src/dict/dict_entry.c
    src/dict/primes.c
    src/eval.c
    src/object/none.c
    src/grammar_handlers.c
    src/sea.c
    src/stack.c

    ${BISON_SeaParser_OUTPUTS}
    ${FLEX_SeaLexer_OUTPUTS}
)
set_target_properties(libsea PROPERTIES PREFIX "")

add_executable(test_dict src/dict/test_dict.c)
target_link_libraries(test_dict libsea)

add_executable(main src/main.c)
target_link_libraries(main libsea)

add_executable(stack_machine
    src/stack_machine.c
    src/stack_machine/program.c
    src/stack_machine/instruction.c
)
target_link_libraries(stack_machine libsea)<commit_msg>Split out libdict<commit_after>cmake_minimum_required(VERSION 2.8)
project(sea_lang)

set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")

find_package(BISON)
find_package(FLEX)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

bison_target(SeaParser
    ${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.y
    ${CMAKE_CURRENT_BINARY_DIR}/grammar.c
)
flex_target(SeaLexer
    ${CMAKE_CURRENT_SOURCE_DIR}/src/flex_parser.l
    ${CMAKE_CURRENT_BINARY_DIR}/flex_parser.c
)

add_flex_bison_dependency(SeaLexer SeaParser)

add_library(libdict
    src/dict/dict.c
    src/dict/dict_entry.c
    src/dict/primes.c
    src/object/none.c
)
set_target_properties(libdict PROPERTIES PREFIX "")

add_library(libsea
    src/ast/ast.c
    src/ast/render_ast.c
    src/compile.c
    src/eval.c
    src/object/none.c
    src/grammar_handlers.c
    src/sea.c
    src/stack.c

    ${BISON_SeaParser_OUTPUTS}
    ${FLEX_SeaLexer_OUTPUTS}
)
set_target_properties(libsea PROPERTIES PREFIX "")

add_executable(test_dict src/dict/test_dict.c)
target_link_libraries(test_dict libsea)

add_executable(main src/main.c)
target_link_libraries(main libsea)

add_executable(stack_machine
    src/stack_machine.c
    src/stack_machine/program.c
    src/stack_machine/instruction.c
)
target_link_libraries(stack_machine libsea)
{'fraction_non_alphanumeric': 0.10008169934640523, 'fraction_numerical': 0.0016339869281045752, 'mean_word_length': 4.987775061124695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1013216', 'n_tokens_mistral': 1002, 'n_tokens_neox': 950, 'n_words': 102}