Fixed some problems with grammer loading of null rules and rules non-terminals and terminals that had the same name

This commit is contained in:
Nathan Braswell
2013-08-04 14:24:20 -04:00
parent d5b33efb22
commit 9460bacf1c
3 changed files with 23 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ class Parser {
protected:
std::vector<Symbol*>* firstSet(Symbol* token);
std::vector<Symbol*>* firstSet(Symbol* token, std::vector<Symbol*> &avoidList);
std::vector<Symbol*>* firstSet(Symbol* token, std::vector<Symbol*> avoidList);
std::vector<Symbol*>* incrementiveFollowSet(ParseRule* rule);
virtual void closure(State* state);
virtual void addStates(std::vector< State* >* stateSets, State* state);
@@ -43,7 +43,7 @@ class Parser {
StringReader reader;
Lexer lexer;
std::map<std::string, Symbol*> symbols;
std::map<std::pair<std::string, bool>, Symbol*> symbols;
std::vector<ParseRule*> loadedGrammer;
std::vector< State* > stateSets;