Grammar: Implemented ::loadFromFile and ::loadFromString

This commit is contained in:
Paul Beckingham 2015-12-21 00:08:26 -05:00
parent 3c13aa8490
commit 8991a3c87b
2 changed files with 117 additions and 1 deletions

View file

@ -29,6 +29,8 @@
#include <FS.h>
#include <string>
#include <vector>
#include <map>
class Grammar
{
@ -36,6 +38,20 @@ public:
Grammar ();
void loadFromFile (File&);
void loadFromString (const std::string&);
std::string dump () const;
protected:
class Production : public std::vector <std::string>
{
};
class Rule : public std::vector <Production>
{
};
private:
std::string _start;
std::map <std::string, Grammar::Rule> _rules;
};
#endif