48void Foam::token::parseError(
const char* expected)
const
51 <<
"Parse error, expected a " << expected
60 const word& compoundType
63 auto* ctorPtr = emptyConstructorTable(compoundType);
71 *emptyConstructorTablePtr_
81 const word& compoundType,
83 const bool readContent
86 auto* ctorPtr = emptyConstructorTable(compoundType);
95 *emptyConstructorTablePtr_
99 autoPtr<token::compound> aptr(ctorPtr());
126 emptyConstructorTablePtr_
127 && emptyConstructorTablePtr_->contains(compoundType)
134 const word& compoundType,
136 const bool readContent
142 auto* ctorPtr = token::compound::emptyConstructorTable(compoundType);
149 autoPtr<token::compound> aptr(ctorPtr());
158 (*this) = std::move(aptr);
166 if (type_ != tokenType::COMPOUND)
168 parseError(
"compound");
171 if (data_.compoundPtr->moved())
176 <<
"compound has already been transferred from token\n "
182 <<
"compound has already been transferred from token\n "
205 data_.compoundPtr->moved(
true);
208 return *data_.compoundPtr;
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Abstract base class for complex tokens.
static bool isCompound(const word &compoundType)
True if a known (registered) compound type.
static autoPtr< compound > New(const word &compoundType)
Default construct specified compound type.
A token holds an item read from Istream.
@ COMPOUND
Compound type such as List<label> etc.
bool readCompoundToken(const word &compoundType, Istream &is, const bool readContent=true)
Default construct the specified compound type and read from stream.
compound & transferCompoundToken(const Istream *is=nullptr)
Return reference to compound and mark internally as released.
static const token undefinedToken
An undefined token.
InfoProxy< token > info() const noexcept
Return info proxy, for printing token information to a stream.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
token::compound tokenCompound
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.