removed cout in inputparser + added different kinds of whitespace in find_first_not_of

This commit is contained in:
Thomas Ave 2016-05-25 18:32:47 +02:00
parent 2b66d58138
commit a1220fee64
1 changed files with 2 additions and 9 deletions

View File

@ -12,14 +12,7 @@ namespace lxs {
auto enfavect = parseLines(is);
auto enfas = linesToEnfa(enfavect);
auto enfa = merge(enfas);
for(auto tokens: enfa.acceptingToken) {
std::cout << tokens.first << "\t" << tokens.second << std::endl;
}
for(auto tokens: enfa.priority) {
std::cout << tokens.first << "\t" << tokens.second << std::endl;
}
auto dfa = mssc(enfa);
dfa = minimize(dfa);
return dfa;
}
@ -28,9 +21,9 @@ namespace lxs {
std::vector<std::pair<std::string,std::string> > result;
while(std::getline(is,line)) {
int loc = line.find_first_of('=');
int start = line.find_first_not_of(" ");
int start = line.find_first_not_of(" \t\v\f\r");
std::string tokenname = line.substr(start, loc);
int end = tokenname.find_last_not_of(" ");
int end = tokenname.find_last_not_of(" \t\v\f\r");
tokenname = tokenname.substr(0,end + 1);
std::string regex = line.substr(loc+1);
start = regex.find_first_not_of(" ");