From f94d32242380b23b361f66eb021cad17c35acd8c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 16 May 2016 22:55:29 -0400 Subject: Added debug print method for token type --- lib/token.cpp | 15 +++++++++++++++ lib/token.h | 2 ++ 2 files changed, 17 insertions(+) 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 { _string._str = _str; } + std::ostream& operator<<(std::ostream& os, token::type _type) + { + switch (_type) + { + case token::type::verb: return os << "verb"; + case token::type::noun: return os << "noun"; + case token::type::adjective: return os << "adjective"; + case token::type::adverb: return os << "adverb"; + case token::type::preposition: return os << "preposition"; + case token::type::fillin: return os << "fillin"; + case token::type::utterance: return os << "utterance"; + case token::type::string: return os << "string"; + } + } + }; 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 { } _utterance; }; }; + + std::ostream& operator<<(std::ostream& os, token::type _type); }; -- cgit 1.4.1