45 case token::tokenType::UNDEFINED:
46 os <<
"undefined token";
49 case token::tokenType::BOOL:
50 os <<
"bool '" << (tok.
boolToken() ?
"true" :
"false") <<
'\'';
53 case token::tokenType::FLAG:
57 case token::tokenType::PUNCTUATION:
58 os <<
"punctuation '" << tok.
pToken() <<
'\'';
61 case token::tokenType::LABEL:
65 case token::tokenType::FLOAT:
69 case token::tokenType::DOUBLE:
73 case token::tokenType::WORD:
77 case token::tokenType::DIRECTIVE:
81 case token::tokenType::STRING:
85 case token::tokenType::EXPRESSION:
89 case token::tokenType::VARIABLE:
93 case token::tokenType::VERBATIM:
97 case token::tokenType::COMPOUND:
103 os <<
"compound of type "
108 case token::tokenType::ERROR:
113 os <<
"unknown token type '" << int(tok.
type()) <<
'\'';
138 case token::tokenType::UNDEFINED:
return "undefined";
139 case token::tokenType::BOOL:
return "bool";
140 case token::tokenType::FLAG:
return "flag";
141 case token::tokenType::PUNCTUATION:
return "punctuation";
142 case token::tokenType::LABEL:
return "label";
143 case token::tokenType::FLOAT:
return "float";
144 case token::tokenType::DOUBLE:
return "double";
145 case token::tokenType::WORD:
return "word";
146 case token::tokenType::DIRECTIVE:
return "directive";
147 case token::tokenType::STRING:
return "string";
148 case token::tokenType::EXPRESSION:
return "expression";
149 case token::tokenType::VERBATIM:
return "verbatim";
150 case token::tokenType::VARIABLE:
return "variable";
151 case token::tokenType::COMPOUND:
return "compound";
152 case token::tokenType::ERROR:
return "error";
158 return "unknown(" + std::to_string(
int(type_)) +
")";
175 case token::tokenType::UNDEFINED:
178 <<
"Undefined token" <<
endl;
181 case token::tokenType::FLAG:
185 case token::tokenType::PUNCTUATION:
186 os << tok.data_.punctuationVal;
189 case token::tokenType::BOOL:
190 case token::tokenType::LABEL:
191 os << tok.data_.labelVal;
194 case token::tokenType::FLOAT:
195 os << tok.data_.floatVal;
198 case token::tokenType::DOUBLE:
199 os << tok.data_.doubleVal;
204 case token::tokenType::DIRECTIVE:
205 case token::tokenType::EXPRESSION:
206 case token::tokenType::VARIABLE:
207 case token::tokenType::VERBATIMSTRING:
211 case token::tokenType::WORD:
212 os << *tok.data_.wordPtr;
215 case token::tokenType::STRING:
216 os << *tok.data_.stringPtr;
219 case token::tokenType::COMPOUND:
220 os << *tok.data_.compoundPtr;
223 case token::tokenType::ERROR:
226 <<
"Error token" <<
endl;
232 <<
"Unknown token" <<
endl;
242 return os << char(pt);
248 return os << char(pt);