33 const label lastPrior,
36 const HashTable<Type>&
table
39 Type result(identity);
42 token nextToken(tis.nextToken());
46 bool haveReadSymbol =
false;
50 if (nextToken.isWord())
53 if (!
table.found(nextToken.wordToken()))
56 << nextToken.wordToken() <<
" not found in symbols table."
57 <<
" Valid symbols are:" <<
nl <<
table.toc()
60 result.reset(result*
table[nextToken.wordToken()]);
61 haveReadSymbol =
true;
63 else if (nextToken.isNumber())
69 else if (nextToken.isPunctuation())
83 tis.putBack(nextToken);
89 tis.putBack(nextToken);
102 token t = tis.nextToken();
109 haveReadSymbol =
true;
114 tis.putBack(nextToken);
120 if (nextPrior > lastPrior)
132 tis.putBack(nextToken);
136 haveReadSymbol =
false;
141 if (nextPrior > lastPrior)
151 tis.putBack(nextToken);
155 haveReadSymbol =
false;
157 else if (nextToken.pToken() ==
'^')
160 if (nextPrior > lastPrior)
162 token t = tis.nextToken();
168 result.reset(
pow(result, t.scalarToken()));
172 tis.putBack(nextToken);
176 haveReadSymbol =
true;
195 nextToken = tis.nextToken();
197 if (nextToken.error())
202 if (haveReadSymbol && (nextToken.isWord() || nextToken.isNumber()))
205 tis.putBack(nextToken);
218 const Type& identity,
219 const HashTable<Type>&
table
222 symbols::tokeniser tis(is);
226 is.putBack(tis.nextToken());
static label priority(const token &t)
...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const HashTable< dimensionSet > table
Table of dimensions.
Type parseNoBeginOrEnd(Istream &is, const Type &identity, const HashTable< Type > &table)
Parse tokens into a dimension set or unit conversion, assuming that the '['.
Type parseNoBegin(const label lastPrior, tokeniser &tis, const Type &identity, const HashTable< Type > &table)
Parse tokens into a dimension set or unit conversion, assuming that the '['.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)