36 namespace functionEntries
76 const string& keyword,
80 if (keyword[0] ==
'$')
82 word varName = keyword(1, keyword.size()-1);
93 return token(ePtr->stream());
98 string expanded(keyword);
148 const bool eqType = (t1.
type() == t2.
type());
275 skipUntil(stack, parentDict,
"#endif", is);
306 execute(stack, parentDict, is);
311 ifEntry::execute(stack, parentDict, is);
321 skipUntil(stack, parentDict,
"#endif", is);
354 evaluate(
true, stack, parentDict, is);
370 skipUntil(stack, parentDict,
"#endif", is);
383 dynamic_cast<ISstream&
>(is).getLine(line);
406 evaluate(
false, stack, parentDict, is);
411 evaluate(
true, stack, parentDict, is);
431 cond1 =
expand(parentDict, cond1);
435 cond2 =
expand(parentDict, cond2);
437 const bool equal = equalToken(cond1, cond2);
446 if (stack.
size() != nNested)
449 <<
"Did not find matching #endif for condition starting" 450 <<
" at line " << stack.
last().second()
467 return execute(stack, parentDict, is);
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping.
punctuationToken pToken() const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool bad() const
Return true if stream is corrupted.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 2-tuple for storing two objects of different types.
static bool equalToken(const token &t1, const token &t2)
const word & wordToken() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
void putBack(const token &)
Put back token.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
label lineNumber() const
Return current stream line number.
scalar scalarToken() const
static void skipUntil(DynamicList< filePos > &stack, const dictionary &parentDict, const word &endWord, Istream &is)
Consume tokens until reached a specific word.
const entry * lookupScopedEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
floatScalar floatScalarToken() const
virtual Istream & read(token &)=0
Return next token from stream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
virtual const fileName & name() const
Return the name of the stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
static token expand(const dictionary &dict, const string &keyword, const token &t)
Expand a variable (string/word/var starting with '$')
addNamedToMemberFunctionSelectionTable(functionEntry, ifEntry, execute, dictionaryIstream, if)
ITstream & stream() const
Return token stream if this entry is a primitive entry.
bool eof() const
Return true if end of input seen.
const string & stringToken() const
longDoubleScalar longDoubleScalarToken() const
T remove()
Remove and return the top element.
bool equal(const T &s1, const T &s2)
string & inplaceExpand(string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Inplace expand occurrences of variables according to the mapping.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Input from memory buffer stream.
static bool evaluate(const bool doIf, DynamicList< filePos > &stack, dictionary &parentDict, Istream &is)
Macros for easy insertion into member function selection tables.
const doubleScalar e
Elementary charge.
T & last()
Return the last element of the list.
doubleScalar doubleScalarToken() const
static void readToken(token &t, Istream &is)
Read tokens. Skip dummy tokens.
static bool execute(const bool equal, DynamicList< filePos > &stack, dictionary &parentDict, Istream &is)
Main driver: depending on 'equal' starts evaluating or.
defineTypeNameAndDebug(calcEntry, 0)
A keyword and a list of tokens is an 'entry'.