From a27e2c529ddb7dc1be0c6bcc44e3ab558126d15d Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 24 Jul 2014 10:06:27 +0200 Subject: arg --- fast/grammar.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fast/grammar.hh') 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 { -- cgit v1.2.3