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:
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);
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.
label lineNumber() const noexcept
The line number for the token.
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
Redirect write to underlying content.
const compound & compoundToken() const
Read access for compound token.
virtual Ostream & write(const char c)
Write character.
punctuationToken pToken() const
Return punctuation character.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
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.
bool moved() const noexcept
Get compound transferred status.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
OBJstream os(runTime.globalPath()/outputName)
floatScalar floatToken() const
Return float value.
doubleScalar doubleToken() const
Return double value.
const word & wordToken() const
Return const reference to the word contents.
tokenType type() const noexcept
Return the token type.
word name() const
Return the name of the token type.
constexpr token() noexcept
Default construct, 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,...
#define WarningInFunction
Report a warning using Foam::Warning.
punctuationToken
Standard punctuation tokens (a character)
virtual Istream & read(token &)=0
Return next token from stream.