Redid lookahead in a much much saner way. Now should be a legitimate parser somewhere between LALR(1) and LR(1).

This commit is contained in:
Nathan Braswell
2013-06-26 14:27:28 -04:00
parent ee9b8b8c39
commit 6a2977d12a
5 changed files with 78 additions and 109 deletions

View File

@@ -25,9 +25,7 @@ class Parser {
void loadGrammer(std::string grammerInputString);
std::vector<Symbol*>* firstSet(Symbol* token);
void printFirstSets();
//std::vector<Symbol*>* followSet(int stateNum, Symbol* token);
std::vector<Symbol*>* gramFollowSet(State* state, Symbol* token);
std::vector<Symbol*>* gramFollowSetAvoid(State* state, Symbol* token, std::vector<Symbol*>* avoidList);
std::vector<Symbol*>* incrementiveFollowSet(ParseRule* rule);
void createStateSet();
void closure(State* state);
void addStates(std::vector< State* >* stateSets, State* state);