Go to the documentation of this file.
220 bool moved() const noexcept
226 void moved(
bool b) noexcept
232 virtual label
size()
const = 0;
281 virtual label
size()
const
289 operator<<(os, static_cast<const T&>(*
this));
336 inline void setUndefined() noexcept;
339 void parseError(const
char* expected) const;
353 inline constexpr
token() noexcept;
365 inline explicit
token(const label val, label lineNum=0) noexcept;
374 inline explicit
token(const
word& w, label lineNum=0);
377 inline explicit
token(const
string& str, label lineNum=0);
380 inline explicit
token(
word&& w, label lineNum=0);
383 inline explicit
token(
string&& str, label lineNum=0);
399 inline static
token boolean(
bool on) noexcept;
404 inline static
token flag(
int bitmask) noexcept;
438 inline label
lineNumber(const label lineNum) noexcept;
441 inline
bool good() const noexcept;
447 inline
bool error() const noexcept;
450 inline
bool isBool() const noexcept;
453 inline
bool isFlag() const noexcept;
465 inline
bool isLabel() const noexcept;
468 inline
bool isLabel(const label val) const noexcept;
471 inline
bool isFloat() const noexcept;
474 inline
bool isDouble() const noexcept;
477 inline
bool isScalar() const noexcept;
480 inline
bool isNumber() const noexcept;
483 inline
bool isWord() const noexcept;
486 inline
bool isWord(const std::
string&
s) const;
495 inline
bool isString() const noexcept;
548 inline scalar
number() const;
619 inline void operator=(
const string& str);
638 inline bool operator==(
const label val)
const noexcept;
641 inline bool operator==(
const std::string&
s)
const;
648 inline bool operator!=(
const label val)
const noexcept;
651 inline bool operator!=(
const std::string&
s)
const;
668 label&
lineNumber() noexcept {
return line_; }
702 Ostream&
operator<<(Ostream&
os,
const token::compound& ct);
704 ostream&
operator<<(ostream&
os,
const InfoProxy<token>& ip);
707 Ostream&
operator<<(Ostream&
os,
const InfoProxy<token>& ip);
713 #define defineCompoundTypeName(Type, UnusedTag) \
714 defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Type, 0);
717 #define defineNamedCompoundTypeName(Type, Name) \
718 defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Name, 0);
721 #define addCompoundToRunTimeSelectionTable(Type, Tag) \
722 token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
723 add##Tag##IstreamConstructorToTable_;
726 #define addNamedCompoundToRunTimeSelectionTable(Type, Tag, Name) \
727 token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
728 add##Tag##IstreamConstructorToTable_(#Name);
Subtract or start of negative number.
Right square bracket [isseparator].
bool isDoubleScalar() const
Token is DOUBLE.
Assignment/equals [isseparator].
Compound(Istream &is)
Read construct from Istream.
flagType
Stream or output control flags (1-byte width)
label labelToken() const
Return label value.
double doubleScalar
A typedef for double.
Left brace [isseparator].
double (double-precision) type
bool isLabel() const noexcept
Token is LABEL.
Abstract base class for complex tokens.
Compound type such as List<label> etc.
A class for handling words, derived from Foam::string.
A templated class for holding compound tokens.
A helper class for outputting values to Ostream.
bool isBool() const noexcept
Token is BOOL.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool isDouble() const noexcept
Token is DOUBLE.
Reference counter for various OpenFOAM components.
label lineNumber() const noexcept
The line number for the token.
Right parenthesis [isseparator].
virtual void write(Ostream &os) const
Redirect write to underlying content.
const string & stringToken() const
Return const reference to the string contents.
virtual ~compound() noexcept=default
Destructor.
bool isFloatScalar() const
Token is FLOAT.
float floatScalar
A typedef for float.
bool isStringType() const noexcept
bool isExpression() const noexcept
Token is EXPRESSION (string variant)
End string with double quote.
bool boolToken() const
Return boolean token value.
static bool isseparator(int c) noexcept
True if the character is a punctuation separator (eg, in ISstream).
Istream & operator>>(Istream &, directionInfo &)
A token holds an item read from Istream.
virtual void write(Ostream &os) const =0
Redirect write to underlying content.
bool isFloat() const noexcept
Token is FLOAT.
bool isQuotedString() const noexcept
Token is (quoted) STRING (string variant)
const compound & compoundToken() const
Read access for compound token.
declareRunTimeSelectionTable(autoPtr, compound, Istream,(Istream &is),(is))
Declare run-time constructor selection table.
TypeName("compound")
Declare type-name, virtual type (with debug switch)
punctuationToken pToken() const
Return punctuation character.
bool isVariable() const noexcept
Token is VARIABLE (string variant)
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
Foam::string (usually double-quoted)
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
Subtract or start of negative number.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
scalar number() const
Return label, float or double value.
Right brace [isseparator].
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
single character punctuation
Begin dimensions [isseparator].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool operator!=(const token &tok) const
virtual label size() const
The size of the underlying content.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
Compound(T &&val)
Move construct.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
floatScalar floatScalarToken() const
Return float value.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
bool isFlag() const noexcept
Token is FLAG.
friend Ostream & operator<<(Ostream &os, const token &tok)
bool moved() const noexcept
Get compound transferred status.
static bool isCompound(const word &name)
Test if name is a known (registered) compound type.
bool isSeparator() const noexcept
Token is PUNCTUATION and isseparator.
static const token undefinedToken
An undefined token.
Dollar - start variable or expression.
End dimensions [isseparator].
OBJstream os(runTime.globalPath()/outputName)
Hash - directive or start verbatim string.
Question mark (eg, ternary)
bool isScalar() const noexcept
Token is FLOAT or DOUBLE.
bool operator==(const token &tok) const
floatScalar floatToken() const
Return float value.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
Begin block [isseparator].
doubleScalar doubleToken() const
Return double value.
const word & wordToken() const
Return const reference to the word contents.
bool isDirective() const noexcept
Token is DIRECTIVE (word variant)
virtual label size() const =0
The size of the underlying content.
static constexpr const char *const typeName
The type name is "token".
friend Ostream & operator<<(Ostream &os, const compound &ct)
Output operator.
Left parenthesis [isseparator].
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
void swap(token &tok)
Swap token contents: type, data, line-number.
bool isVerbatim() const noexcept
Token is VERBATIM string (string variant)
tokenType type() const noexcept
Return the token type.
TypeName("Compound<T>")
Declare type-name, virtual type (with debug switch)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Compound(const T &val)
Copy construct.
Left square bracket [isseparator].
scalar scalarToken() const
Return float or double value.
word name() const
Return the name of the token type.
Macros to ease declaration of run-time selection tables.
static token flag(int bitmask) noexcept
Create a token with stream flags, no sanity check.
bool undefined() const noexcept
Token is UNDEFINED.
constexpr compound() noexcept
Default construct.
tokenType
Enumeration defining the types of token.
stream flag (1-byte bitmask)
bool isString() const noexcept
Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM)
doubleScalar doubleScalarToken() const
Return double value.
bool isCompound() const noexcept
Token is COMPOUND.
float (single-precision) type
const dimensionedScalar c
Speed of light in a vacuum.
int flagToken() const
Return flag bitmask value.
static autoPtr< compound > New(const word &type, Istream &is)
Construct compound from Istream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
Begin list [isseparator].
bool setType(const tokenType tokType) noexcept
Change the token type, for similar types.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Begin string with double quote.
punctuationToken
Standard punctuation tokens (a character)
void moved(bool b) noexcept
Set compound transferred status.
void operator=(const token &tok)
Copy assign.
void setBad()
Clear token and set to be ERROR.