Added first go at creating stateSets. This is a commit to save work, as it still segfaults.:

This commit is contained in:
Nathan Braswell
2013-05-24 00:00:41 -04:00
parent e4f83cbb67
commit 1aec4ee6a7
5 changed files with 115 additions and 0 deletions

View File

@@ -15,6 +15,10 @@ ParseRule::~ParseRule() {
}
const bool ParseRule::operator==(const ParseRule &other) {
return( leftHandle == other.leftHandle && rightSide == other.rightSide && pointerIndex == other.pointerIndex );
}
ParseRule* ParseRule::clone() {
return( new ParseRule(leftHandle, pointerIndex, rightSide) );
}
@@ -35,6 +39,10 @@ std::vector<Symbol*> ParseRule::getRightSide() {
return rightSide;
}
int ParseRule::getIndex() {
return pointerIndex;
}
bool ParseRule::advancePointer() {
if (pointerIndex < rightSide.size()) {
pointerIndex++;