Added support for null rules, works well.

This commit is contained in:
Nathan Braswell
2013-07-09 02:45:59 -04:00
parent 4c2fd967f0
commit 1c85e3693e
5 changed files with 90 additions and 38 deletions

View File

@@ -26,6 +26,7 @@ class ParseRule {
void appendToRight(Symbol* appendee);
Symbol* getLeftSide();
void setRightSide(std::vector<Symbol*> &rightSide);
std::vector<Symbol*> getRightSide();
Symbol* getAtNextIndex();
Symbol* getAtIndex();

View File

@@ -47,6 +47,11 @@ class Parser {
std::vector< State* > stateSets;
//The EOFSymbol, a pointer because of use in table, etc
Symbol* EOFSymbol;
//The nullSymbol, ditto with above. Also used in comparisons
Symbol* nullSymbol;
std::vector< std::vector<ParseAction*>* > table;
std::vector<Symbol*> symbolIndexVec;