Make each state a singleton instead of constructing anew each time

This commit is contained in:
Keith Winstein
2011-01-09 04:16:07 -05:00
parent f2ceffc5d9
commit 2f70137df0
4 changed files with 106 additions and 40 deletions
+3 -1
View File
@@ -6,14 +6,16 @@
#include "parsertransition.hpp"
#include "parseraction.hpp"
#include "parserstate.hpp"
#include "parserstatefamily.hpp"
namespace Parser {
class Parser {
private:
StateFamily family;
State *state;
public:
Parser() : state( NULL ) {}
Parser() : family(), state( NULL ) {}
Parser( const Parser & );
bool operator=( const Parser & );
void input( wchar_t c ); /* should return list of actions */