RNGLR Recognizer now works for grammers without null rules.

This commit is contained in:
Nathan Braswell
2013-08-02 02:47:01 -04:00
parent 9887555dd5
commit 49d149bc1f
8 changed files with 96 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ class ParseRule {
int getRightSize();
int getIndex();
std::vector<NodeTree<Symbol*>*>* nullReductions();
bool advancePointer();
bool isAtEnd();

View File

@@ -10,6 +10,7 @@ class RNGLRParser: public Parser {
NodeTree<Symbol*>* parseInput(std::string inputString);
void reducer(int i);
void shifter(int i);
void addStates(std::vector< State* >* stateSets, State* state);
private:
std::vector<Symbol*> input;
GraphStructuredStack gss;

View File

@@ -13,6 +13,7 @@ class Table {
~Table();
void setSymbols(Symbol* EOFSymbol, Symbol* nullSymbol);
void add(int stateNum, Symbol* tranSymbol, ParseAction* action);
void remove(int stateNum, Symbol* tranSymbol);
std::vector<ParseAction*>* get(int state, Symbol* token);
ParseAction* getShift(int state, Symbol* token);
std::string toString();