Grammar: Added ::rules

This commit is contained in:
Paul Beckingham 2015-12-22 23:39:50 -05:00
parent 459bf183dc
commit 35d246aa32
2 changed files with 11 additions and 0 deletions

View file

@ -143,6 +143,16 @@ std::string Grammar::start () const
return _start;
}
////////////////////////////////////////////////////////////////////////////////
std::vector <std::string> Grammar::rules () const
{
std::vector <std::string> results;
for (auto& rule : _rules)
results.push_back (rule.first);
return results;
}
////////////////////////////////////////////////////////////////////////////////
std::string Grammar::dump () const
{

View file

@ -39,6 +39,7 @@ public:
void loadFromFile (File&);
void loadFromString (const std::string&);
std::string start () const;
std::vector <std::string> rules () const;
std::string dump () const;
protected: