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)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_library(Lexesis-backends
|
||||
backends/cpp.cpp
|
||||
)
|
||||
|
||||
add_executable(Lexesis
|
||||
main.cpp
|
||||
automata.cpp
|
||||
|
@ -9,7 +13,7 @@ add_executable(Lexesis
|
|||
inputparser.cpp
|
||||
template.cpp
|
||||
)
|
||||
target_link_libraries(Lexesis mstch::mstch)
|
||||
target_link_libraries(Lexesis Lexesis-backends mstch::mstch)
|
||||
|
||||
install(TARGETS Lexesis
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace lxs { namespace backends {
|
|||
topLevel["trans_idx"] = transformTransitionIndices(transition_indices.first);
|
||||
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);
|
||||
|
||||
|
|
|
@ -12,17 +12,12 @@ namespace templ {
|
|||
return mstch::node(_string);
|
||||
}
|
||||
|
||||
TemplateContext make_map(std::map<std::string, TemplateContext> _map) {
|
||||
// return mstch::node(_map); -> g++ goes mental..
|
||||
mstch::map result;
|
||||
for(auto& item: _map) {
|
||||
result[item.first] = item.second;
|
||||
}
|
||||
return result;
|
||||
TemplateContext make_map(std::map<const std::string, TemplateContext> _map) {
|
||||
return mstch::map(_map);
|
||||
}
|
||||
|
||||
TemplateContext make_array(std::vector<TemplateContext> _array) {
|
||||
return mstch::node(_array);
|
||||
return mstch::array(_array);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue