Go to the documentation of this file.
38 case token::tokenType::UNDEFINED:
41 <<
"Undefined token" <<
endl;
44 case token::tokenType::FLAG:
48 case token::tokenType::PUNCTUATION:
52 case token::tokenType::BOOL:
53 case token::tokenType::INT64:
57 case token::tokenType::FLOAT:
61 case token::tokenType::DOUBLE:
66 case token::tokenType::DIRECTIVE:
67 case token::tokenType::VARIABLE:
72 case token::tokenType::WORD:
76 case token::tokenType::STRING:
80 case token::tokenType::ERROR:
83 <<
"Error token" <<
endl;
89 <<
"Unknown token" <<
endl;
114 case token::tokenType::UNDEFINED:
return "undefined";
115 case token::tokenType::BOOL:
return "bool";
116 case token::tokenType::FLAG:
return "flag";
117 case token::tokenType::PUNCTUATION:
return "punctuation";
118 case token::tokenType::INT64:
return "int64/int32";
119 case token::tokenType::FLOAT:
return "float";
120 case token::tokenType::DOUBLE:
return "double";
121 case token::tokenType::WORD:
return "word";
122 case token::tokenType::DIRECTIVE:
return "directive";
123 case token::tokenType::STRING:
return "string";
125 case token::tokenType::VARIABLE:
return "variable";
127 case token::tokenType::ERROR:
return "error";
133 return "unknown(" + std::to_string(
int(type_)) +
")";
150 case token::tokenType::UNDEFINED:
153 <<
"Undefined token" <<
endl;
156 case token::tokenType::FLAG:
160 case token::tokenType::PUNCTUATION:
164 case token::tokenType::BOOL:
165 case token::tokenType::INT64:
169 case token::tokenType::FLOAT:
173 case token::tokenType::DOUBLE:
178 case token::tokenType::DIRECTIVE:
179 case token::tokenType::VARIABLE:
184 case token::tokenType::WORD:
188 case token::tokenType::STRING:
192 case token::tokenType::ERROR:
195 <<
"Error token" <<
endl;
201 <<
"Unknown token" <<
endl;
210 return os << char(pt);
215 return os << char(pt);
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
tokenType type() const
Return the token type.
virtual iIstream & read(token &)=0
Return next token from stream.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
punctuationToken pToken() const
Return punctuation character.
static OS & printTokenInfo(OS &os, const token &tok)
#define warningInFunction
Report a warning.
punctuationToken
Standard punctuation tokens (a character)
const word & stringToken() const
Return const reference to the string contents.
int64 int64Token() const
Return int64 value.
iOstream & endl(iOstream &os)
Add newline and flush stream.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
constexpr token() noexcept
Default construct, initialized to an UNDEFINED token.
double doubleToken() const
Return double value.
Interface class for any input stream
iOstream & printInfo(iOstream &os) const
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
float floatToken() const
Return float value.
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
word name() const
Return the name of the token type.
tokenType type_
The token type.
Interface class for any output stream.
const word & wordToken() const
Return const reference to the word contents.
int32 lineNumber() const
The line number for the token.