diff options
author | Patrick Simianer <p@simianer.de> | 2014-07-24 10:06:27 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-07-24 10:06:27 +0200 |
commit | a27e2c529ddb7dc1be0c6bcc44e3ab558126d15d (patch) | |
tree | 5132a8149d115857b27a17fb40f359f50b325a89 /fast/grammar.hh | |
parent | 931401b65f5a06bdb1569c33044679694d35fe41 (diff) |
arg
Diffstat (limited to 'fast/grammar.hh')
-rw-r--r-- | fast/grammar.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fast/grammar.hh b/fast/grammar.hh index 76b96a6..51501cf 100644 --- a/fast/grammar.hh +++ b/fast/grammar.hh @@ -12,6 +12,8 @@ using namespace std; +string esc_str(const string& s); // FIXME + namespace G { struct NT { @@ -21,6 +23,7 @@ struct NT { NT() {}; NT(string& s); string repr() const; + string escaped() const; friend ostream& operator<<(ostream& os, const NT& t); }; @@ -29,6 +32,7 @@ struct T { T(string& s); string repr() const; + string escaped() const { return esc_str(word); } friend ostream& operator<<(ostream& os, const NT& nt); }; @@ -44,6 +48,7 @@ struct Item { Item(string& s); string repr() const; + string escaped() const; friend ostream& operator<<(ostream& os, const Item& i); }; @@ -58,7 +63,10 @@ struct Rule { Rule() {}; Rule(string& s); string repr() const; + string escaped() const; friend ostream& operator<<(ostream& os, const Rule& r); + + MSGPACK_DEFINE(); }; struct Grammar { |