Still in progress

This commit is contained in:
Nathan Braswell
2013-08-22 15:41:30 -04:00
parent 2eaf640855
commit 35a0677d07
6 changed files with 33 additions and 8 deletions

View File

@@ -117,6 +117,19 @@ void State::addRuleCombineLookahead(ParseRule* rule) {
basis.push_back(rule);
}
void State::addRuleCombineLookaheadWithLookahead(ParseRule* rule) {
getTotal();
bool alreadyIn = false;
for (std::vector<ParseRule*>::size_type i = 0; i < total.size(); i++) {
if (*rule == (*(total[i]))) {
total[i]->addLookahead(rule->getLookahead());
alreadyIn = true;
}
}
if (!alreadyIn)
basis.push_back(rule);
}
std::string State::toString() {
std::string concat = "";
concat += "State " + intToString(number) + " with " + intToString(parents.size()) + " parents:\n";