mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Grammar: Implemented ::loadFromFile and ::loadFromString
This commit is contained in:
parent
3c13aa8490
commit
8991a3c87b
2 changed files with 117 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue