mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Grammar: Added ::rules
This commit is contained in:
parent
459bf183dc
commit
35d246aa32
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue