Added caching of the RNGLR table. It is automatically regenerated whenever the grammer changes. Right now it has dropped compiling the test file from 30 seconds to less than one second.
This commit is contained in:
@@ -32,6 +32,8 @@ class Parser {
|
||||
virtual std::string grammerToDOT();
|
||||
|
||||
std::string tableToString();
|
||||
void exportTable(std::ofstream &file);
|
||||
void importTable(char* tableData);
|
||||
|
||||
protected:
|
||||
std::vector<Symbol>* firstSet(Symbol token);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <fstream>
|
||||
|
||||
#include "util.h"
|
||||
#include "ParseRule.h"
|
||||
#include "ParseAction.h"
|
||||
@@ -11,6 +13,8 @@ class Table {
|
||||
public:
|
||||
Table();
|
||||
~Table();
|
||||
void exportTable(std::ofstream &file);
|
||||
void importTable(char* tableData);
|
||||
void setSymbols(Symbol EOFSymbol, Symbol nullSymbol);
|
||||
void add(int stateNum, Symbol tranSymbol, ParseAction* action);
|
||||
void remove(int stateNum, Symbol tranSymbol);
|
||||
|
||||
Reference in New Issue
Block a user