Fixed infinite loop bug- Was attempting to see if a non-closured state and a closured state were equal, almost never were.

This commit is contained in:
Nathan Braswell
2013-06-21 14:46:15 -04:00
parent 20b059ca45
commit 17dd186373
3 changed files with 20 additions and 5 deletions

View File

@@ -32,6 +32,18 @@ const bool State::operator!=(const State &other) {
return !(this->operator==(other));
}
const bool State::basisEquals(const State &other) {
//return (basis == other.basis && remaining == other.remaining);
if (basis.size() != other.basis.size())
return false;
for (std::vector< ParseRule* >::size_type i = 0; i < basis.size(); i++) {
if (*(basis[i]) != *(other.basis[i]))
return false;
}
return true;
}
std::vector<ParseRule*>* State::getTotal() {
total.clear();
for (std::vector<ParseRule*>::size_type i = 0; i < basis.size(); i++) {