mirror of
https://github.com/Jaxan/hybrid-ads.git
synced 2025-04-26 22:47:45 +02:00
Removes the boost dependency
This commit is contained in:
parent
44f4cb3b76
commit
08d940224b
4 changed files with 18 additions and 13 deletions
0
.gitmodules
vendored
0
.gitmodules
vendored
|
@ -4,13 +4,7 @@ cmake_minimum_required(VERSION 2.8)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||
|
||||
find_package (Threads)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS)
|
||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||
set(libs ${libs} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
set(libs ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
add_subdirectory("lib")
|
||||
add_subdirectory("src")
|
||||
|
||||
# file(GLOB resources "resources/*")
|
||||
# file(COPY ${resources} DESTINATION ${CMAKE_BINARY_DIR})
|
||||
|
|
|
@ -46,8 +46,8 @@ at the provided example to get started.
|
|||
|
||||
## Building
|
||||
|
||||
Currently there is still one dependency: Boost. Assuming boost is installed on
|
||||
your system, we can build the tool with cmake:
|
||||
There are no dependencies to install.
|
||||
You can build the tool with `cmake`:
|
||||
|
||||
```
|
||||
mkdir build
|
||||
|
@ -82,7 +82,6 @@ prefixes. However, this can quickly grow in size. Be warned!
|
|||
## TODO
|
||||
|
||||
* Implement a proper radix tree (or Patricia tree) to reduce memory usage.
|
||||
* Remove the dependency on boost.
|
||||
* Implement the SPY method for finding smarter prefixes.
|
||||
* Compute independent structures in parallel (this was done in the first
|
||||
version of the tool).
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#include "read_mealy.hpp"
|
||||
#include "mealy.hpp"
|
||||
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
@ -15,6 +14,20 @@ static string easy_substr(string const & s, size_t begin, size_t end){
|
|||
return s.substr(begin, end - begin);
|
||||
}
|
||||
|
||||
static string trim_copy(string const & str) {
|
||||
auto it = str.begin();
|
||||
while(it != str.end() && isspace(*it)){
|
||||
it++;
|
||||
}
|
||||
|
||||
auto e = str.end();
|
||||
while(it != e && isspace(*(e-1))) {
|
||||
e--;
|
||||
}
|
||||
|
||||
return string(it, e);
|
||||
}
|
||||
|
||||
mealy read_mealy_from_txt(std::istream & in, bool check) {
|
||||
mealy m;
|
||||
|
||||
|
@ -71,7 +84,6 @@ mealy read_mealy_from_dot(std::istream & in, translation & t, bool check){
|
|||
|
||||
string line;
|
||||
while(getline(in, line)){
|
||||
using boost::algorithm::trim_copy;
|
||||
const auto npos = std::string::npos;
|
||||
|
||||
if(line.find("}") != string::npos) break;
|
||||
|
|
Loading…
Add table
Reference in a new issue