Modifed set creation to use a State object. Set creation works

This commit is contained in:
Nathan Braswell
2013-05-26 22:12:47 -04:00
parent 858daa30ee
commit 315dc55409
7 changed files with 185 additions and 56 deletions

View File

@@ -8,13 +8,13 @@
#include "ParseRule.h"
#include "ParseAction.h"
#include "Symbol.h"
#include "State.h"
#include "StringReader.h"
#include <map>
#include <vector>
#include <stack>
#include <string>
#include <sstream>
#include <iostream>
class Parser {
@@ -22,12 +22,10 @@ class Parser {
Parser();
~Parser();
std::string intToString(int theInt);
void loadGrammer(std::string grammerInputString);
void createStateSet();
void closure(std::vector<ParseRule*>* state);
void addState(std::vector< std::vector<ParseRule*>* >* stateSets, std::vector<ParseRule*>* state, Symbol*);
void closure(State* state);
void addState(std::vector< State* >* stateSets, State* state, Symbol*);
std::string stateSetToString();
int gotoTable(int state, Symbol* token);
ParseAction* actionTable(int state, Symbol* token);
@@ -40,7 +38,7 @@ class Parser {
std::map<std::string, Symbol*> symbols;
std::vector<ParseRule*> loadedGrammer;
std::vector< std::vector<ParseRule*>* > stateSets;
std::vector< State* > stateSets;
std::stack<int> stateStack;
std::stack<Symbol*> symbolStack;