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:
@@ -1,8 +1,20 @@
|
||||
#include "ParseAction.h"
|
||||
|
||||
ParseAction::ParseAction(ActionType action, ParseRule* reduceRule, int shiftState) {
|
||||
ParseAction::ParseAction(ActionType action) {
|
||||
this->action = action;
|
||||
this->reduceRule = NULL;
|
||||
this->shiftState = -1;
|
||||
}
|
||||
|
||||
ParseAction::ParseAction(ActionType action, ParseRule* reduceRule) {
|
||||
this->action = action;
|
||||
this->reduceRule = reduceRule;
|
||||
this->shiftState = -1;
|
||||
}
|
||||
|
||||
ParseAction::ParseAction(ActionType action, int shiftState) {
|
||||
this->action = action;
|
||||
this->reduceRule = NULL;
|
||||
this->shiftState = shiftState;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user