diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-16 22:55:29 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-16 22:55:29 -0400 |
| commit | f94d32242380b23b361f66eb021cad17c35acd8c (patch) | |
| tree | 5c018dceebec89073a98d9f35fc26a3d2906dcd1 /lib | |
| parent | 0910864ce3be8bc8a34f53c5633d79dc6702a92b (diff) | |
| download | verbly-f94d32242380b23b361f66eb021cad17c35acd8c.tar.gz verbly-f94d32242380b23b361f66eb021cad17c35acd8c.tar.bz2 verbly-f94d32242380b23b361f66eb021cad17c35acd8c.zip | |
Added debug print method for token type
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/token.cpp | 15 | ||||
| -rw-r--r-- | lib/token.h | 2 |
2 files changed, 17 insertions, 0 deletions
| diff --git a/lib/token.cpp b/lib/token.cpp index b794ff8..3cc77e5 100644 --- a/lib/token.cpp +++ b/lib/token.cpp | |||
| @@ -627,4 +627,19 @@ namespace verbly { | |||
| 627 | _string._str = _str; | 627 | _string._str = _str; |
| 628 | } | 628 | } |
| 629 | 629 | ||
| 630 | std::ostream& operator<<(std::ostream& os, token::type _type) | ||
| 631 | { | ||
| 632 | switch (_type) | ||
| 633 | { | ||
| 634 | case token::type::verb: return os << "verb"; | ||
| 635 | case token::type::noun: return os << "noun"; | ||
| 636 | case token::type::adjective: return os << "adjective"; | ||
| 637 | case token::type::adverb: return os << "adverb"; | ||
| 638 | case token::type::preposition: return os << "preposition"; | ||
| 639 | case token::type::fillin: return os << "fillin"; | ||
| 640 | case token::type::utterance: return os << "utterance"; | ||
| 641 | case token::type::string: return os << "string"; | ||
| 642 | } | ||
| 643 | } | ||
| 644 | |||
| 630 | }; | 645 | }; |
| diff --git a/lib/token.h b/lib/token.h index 788a106..ff3c37b 100644 --- a/lib/token.h +++ b/lib/token.h | |||
| @@ -163,6 +163,8 @@ namespace verbly { | |||
| 163 | } _utterance; | 163 | } _utterance; |
| 164 | }; | 164 | }; |
| 165 | }; | 165 | }; |
| 166 | |||
| 167 | std::ostream& operator<<(std::ostream& os, token::type _type); | ||
| 166 | 168 | ||
| 167 | }; | 169 | }; |
| 168 | 170 | ||
