Small cleanup
This commit is contained in:
parent
3d59a970f8
commit
23d0857100
|
@ -1,6 +1,10 @@
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
add_library(Lexesis-backends
|
||||||
|
backends/cpp.cpp
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(Lexesis
|
add_executable(Lexesis
|
||||||
main.cpp
|
main.cpp
|
||||||
automata.cpp
|
automata.cpp
|
||||||
|
@ -9,7 +13,7 @@ add_executable(Lexesis
|
||||||
inputparser.cpp
|
inputparser.cpp
|
||||||
template.cpp
|
template.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(Lexesis mstch::mstch)
|
target_link_libraries(Lexesis Lexesis-backends mstch::mstch)
|
||||||
|
|
||||||
install(TARGETS Lexesis
|
install(TARGETS Lexesis
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace lxs { namespace backends {
|
||||||
topLevel["trans_idx"] = transformTransitionIndices(transition_indices.first);
|
topLevel["trans_idx"] = transformTransitionIndices(transition_indices.first);
|
||||||
topLevel["num_transitions_per_state"] = templ::make_string(std::to_string(transition_indices.second));
|
topLevel["num_transitions_per_state"] = templ::make_string(std::to_string(transition_indices.second));
|
||||||
|
|
||||||
topLevel["table"] = buildTable(dfa, transition_indices.first);
|
topLevel["table"] = buildTable(dfa, transition_indices.first, transition_indices.second);
|
||||||
|
|
||||||
topLevel["token_types"] = buildTokenList(dfa);
|
topLevel["token_types"] = buildTokenList(dfa);
|
||||||
|
|
||||||
|
|
|
@ -12,17 +12,12 @@ namespace templ {
|
||||||
return mstch::node(_string);
|
return mstch::node(_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
TemplateContext make_map(std::map<std::string, TemplateContext> _map) {
|
TemplateContext make_map(std::map<const std::string, TemplateContext> _map) {
|
||||||
// return mstch::node(_map); -> g++ goes mental..
|
return mstch::map(_map);
|
||||||
mstch::map result;
|
|
||||||
for(auto& item: _map) {
|
|
||||||
result[item.first] = item.second;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TemplateContext make_array(std::vector<TemplateContext> _array) {
|
TemplateContext make_array(std::vector<TemplateContext> _array) {
|
||||||
return mstch::node(_array);
|
return mstch::array(_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue