Actually parses LR(0) grammers and sentences\! Only two problems is very inefficint gotoTable() and actionTable(), and it REJECTS the sentence after completing the Goal->Sentence(*) production. However, need to go to bed now. Does practially work though\! Yay\!
This commit is contained in:
@@ -71,6 +71,10 @@ bool ParseRule::advancePointer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ParseRule::isAtEnd() {
|
||||
return pointerIndex == rightSide.size();
|
||||
}
|
||||
|
||||
std::string ParseRule::toString() {
|
||||
std::string concat = leftHandle->toString() + " -> ";
|
||||
for (int i = 0; i < rightSide.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user