Modifed set creation to use a State object. Set creation works
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user