LR0: Renamed ::createParseTables to ::initialize

This commit is contained in:
Paul Beckingham 2015-12-28 09:20:55 -05:00
parent ec9b63b438
commit 7205cfe1f1
4 changed files with 6 additions and 5 deletions

View file

@ -35,7 +35,7 @@ LR0::LR0 ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void LR0::createParseTables (const Grammar& grammar) void LR0::initialize (const Grammar& grammar)
{ {
// Obtain the augmented grammar. // Obtain the augmented grammar.
auto augmented = grammar.augmented (); auto augmented = grammar.augmented ();

View file

@ -35,7 +35,7 @@ class LR0
{ {
public: public:
LR0 (); LR0 ();
void createParseTables (const Grammar&); void initialize (const Grammar&);
void parse (const std::string&); void parse (const std::string&);
void debug (bool); void debug (bool);
std::string dump () const; std::string dump () const;

View file

@ -96,7 +96,7 @@ int main (int argc, char** argv)
{ {
LR0 lr0; LR0 lr0;
lr0.debug (debug); lr0.debug (debug);
lr0.createParseTables (grammar); lr0.initialize (grammar);
// TODO Run the parser. // TODO Run the parser.
} }

View file

@ -48,6 +48,7 @@ int main (int argc, const char** argv)
{ {
// TODO Load configuration ~/.timewrc || $TIMEWRC. // TODO Load configuration ~/.timewrc || $TIMEWRC.
// TODO Arrange the following to minimize memory use.
// TODO Load CLI grammar. // TODO Load CLI grammar.
// TODO Load from string, else file on config override. // TODO Load from string, else file on config override.
// TODO Migrate from loading a grammar from file, to a default string. // TODO Migrate from loading a grammar from file, to a default string.
@ -59,7 +60,7 @@ int main (int argc, const char** argv)
// Instantiate the parser. // Instantiate the parser.
LR0 cliParser; LR0 cliParser;
cliParser.debug (debug); cliParser.debug (debug);
cliParser.createParseTables (cliGrammar); cliParser.initialize (cliGrammar);
// TODO Parse CLI. // TODO Parse CLI.
@ -72,7 +73,7 @@ int main (int argc, const char** argv)
// Instantiate the parser. // Instantiate the parser.
LR0 ruleParser; LR0 ruleParser;
ruleParser.debug (debug); ruleParser.debug (debug);
ruleParser.createParseTables (ruleGrammar); ruleParser.initialize (ruleGrammar);
// TODO Load rules. // TODO Load rules.
// TODO Parse rules. // TODO Parse rules.