mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Grammar: Added debug mode
This commit is contained in:
parent
980dda147f
commit
2d594c33dc
2 changed files with 9 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Grammar::Grammar ()
|
Grammar::Grammar ()
|
||||||
|
: _debug (false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,6 +186,12 @@ std::vector <std::vector <std::string>> Grammar::augmented () const
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void Grammar::debug (bool value)
|
||||||
|
{
|
||||||
|
_debug = value;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::string Grammar::dump () const
|
std::string Grammar::dump () const
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,6 +42,7 @@ public:
|
||||||
std::vector <std::string> rules () const;
|
std::vector <std::string> rules () const;
|
||||||
std::vector <std::string> terminals () const;
|
std::vector <std::string> terminals () const;
|
||||||
std::vector <std::vector <std::string>> augmented () const;
|
std::vector <std::vector <std::string>> augmented () const;
|
||||||
|
void debug (bool);
|
||||||
std::string dump () const;
|
std::string dump () const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -69,6 +70,7 @@ private:
|
||||||
private:
|
private:
|
||||||
std::string _start;
|
std::string _start;
|
||||||
std::map <std::string, Grammar::Rule> _rules;
|
std::map <std::string, Grammar::Rule> _rules;
|
||||||
|
bool _debug;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue