Go to the documentation of this file.
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:
54 os <<
"flag '" << int(tok.
flagToken()) <<
'\'';
57 case token::tokenType::PUNCTUATION:
58 os <<
"punctuation '" << tok.
pToken() <<
'\'';
61 case token::tokenType::LABEL:
65 case token::tokenType::FLOAT_SCALAR:
69 case token::tokenType::DOUBLE_SCALAR:
73 case token::tokenType::WORD:
74 os <<
"word '" << tok.
wordToken() <<
'\'';
77 case token::tokenType::STRING:
81 case token::tokenType::VARIABLE:
85 case token::tokenType::VERBATIMSTRING:
89 case token::tokenType::COMPOUND:
95 os <<
"compound of type "
100 case token::tokenType::ERROR:
105 os <<
"unknown token type '" << int(tok.
type()) <<
'\'';
130 case token::tokenType::UNDEFINED:
return "undefined";
131 case token::tokenType::BOOL:
return "bool";
132 case token::tokenType::FLAG:
return "flag";
133 case token::tokenType::PUNCTUATION:
return "punctuation";
134 case token::tokenType::LABEL:
return "label";
135 case token::tokenType::FLOAT_SCALAR:
return "float";
136 case token::tokenType::DOUBLE_SCALAR:
return "double";
137 case token::tokenType::WORD:
return "word";
138 case token::tokenType::STRING:
return "string";
139 case token::tokenType::VERBATIMSTRING:
return "verbatim";
140 case token::tokenType::VARIABLE:
return "variable";
141 case token::tokenType::COMPOUND:
return "compound";
142 case token::tokenType::ERROR:
return "error";
148 return "unknown(" + std::to_string(
int(type_)) +
")";
165 case token::tokenType::UNDEFINED:
168 <<
"Undefined token" <<
endl;
171 case token::tokenType::FLAG:
175 case token::tokenType::PUNCTUATION:
176 os << tok.data_.punctuationVal;
179 case token::tokenType::BOOL:
180 case token::tokenType::LABEL:
181 os << tok.data_.labelVal;
184 case token::tokenType::FLOAT_SCALAR:
185 os << tok.data_.floatVal;
188 case token::tokenType::DOUBLE_SCALAR:
189 os << tok.data_.doubleVal;
192 case token::tokenType::WORD:
193 os << *tok.data_.wordPtr;
196 case token::tokenType::STRING:
197 case token::tokenType::VERBATIMSTRING:
198 os << *tok.data_.stringPtr;
201 case token::tokenType::VARIABLE:
206 case token::tokenType::COMPOUND:
207 os << *tok.data_.compoundPtr;
210 case token::tokenType::ERROR:
213 <<
"Error token" <<
endl;
219 <<
"Unknown token" <<
endl;
229 return os << char(pt);
235 return os << char(pt);
label labelToken() const
Return label value.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Abstract base class for complex tokens.
A class for handling words, derived from Foam::string.
A helper class for outputting values to Ostream.
const string & stringToken() const
Return const reference to the string contents.
static OS & printTokenInfo(OS &os, const token &tok)
bool boolToken() const
Return boolean token value.
Istream & operator>>(Istream &, directionInfo &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
virtual void write(Ostream &os) const =0
const compound & compoundToken() const
Read access for compound token.
punctuationToken pToken() const
Return punctuation character.
floatScalar floatScalarToken() const
Return float value.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void reset()
Reset token to UNDEFINED and clear any allocated storage.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
const word & wordToken() const
Return const reference to the word contents.
tokenType type() const
Return the token type.
word name() const
Return the name of the token type.
doubleScalar doubleScalarToken() const
Return double value.
constexpr token() noexcept
Construct null, initialized to an UNDEFINED token.
int flagToken() const
Return flag bitmask value.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label lineNumber() const
The line number for the token.
#define WarningInFunction
Report a warning using Foam::Warning.
Ostream & operator<<(Ostream &, const boundaryPatch &)
punctuationToken
Standard punctuation tokens (a character)
virtual Istream & read(token &)=0
Return next token from stream.