The out of orderness was actually the fault of the dot graphing program, not Kraken, so that's good news. DOT generation has also been modified so that it properly inserts \n's (actually \n's) where line returns are so that dot can parse the \n and not the line return.
This commit is contained in:
@@ -78,7 +78,7 @@ NodeTree<Symbol*>* RNGLRParser::parseInput(std::string inputString) {
|
||||
std::cout << "Checking if frontier " << i << " is empty" << std::endl;
|
||||
if (gss.frontierIsEmpty(i)) {
|
||||
std::cout << "Frontier " << i << " is empty." << std::endl;
|
||||
std::cout << "Failed on " << input[i]->toString() << " next: " << input[i+1]->toString() << std::endl;
|
||||
std::cout << "Failed on " << input[i]->toString() << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
15
src/util.cpp
15
src/util.cpp
@@ -19,4 +19,17 @@ std::string removeBeginning(std::string to_remove)
|
||||
for (unsigned int i = 1; i < to_remove.length(); i++)
|
||||
to_return = to_return + to_remove[i];
|
||||
return to_return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string replace(std::string first, std::string search, std::string replace) {
|
||||
size_t pos = 0;
|
||||
while (pos < first.size()-search.size()) {
|
||||
pos = first.find(search, pos);
|
||||
if (pos == std::string::npos)
|
||||
break;
|
||||
//std::cout << "Position is " << pos << " size of first is " << first.size() << " size of replace is " << replace.size() << std::endl;
|
||||
first = first.replace(pos, search.size(), replace);
|
||||
pos++;
|
||||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user