本文整理汇总了C++中token::wordToken方法的典型用法代码示例。如果您正苦于以下问题:C++ token::wordToken方法的具体用法?C++ token::wordToken怎么用?C++ token::wordToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类token
的用法示例。
在下文中一共展示了token::wordToken方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: expandVariable
void Foam::primitiveEntry::append
(
const token& currToken,
const dictionary& dict,
Istream& is
)
{
if (currToken.isWord())
{
const word& w = currToken.wordToken();
if
(
w.size() == 1
|| (
!(w[0] == '$' && expandVariable(w, dict))
&& !(w[0] == '#' && expandFunction(w, dict, is))
)
)
{
newElmt(tokenIndex()++) = currToken;
}
}
else
{
newElmt(tokenIndex()++) = currToken;
}
}
示例2: if
void Foam::primitiveEntry::append
(
const token& currToken,
const dictionary& dict,
Istream& is
)
{
if (currToken.isWord())
{
const word& w = currToken.wordToken();
if
(
disableFunctionEntries
|| w.size() == 1
|| (
!(w[0] == '$' && expandVariable(w, dict))
&& !(w[0] == '#' && expandFunction(w, dict, is))
)
)
{
newElmt(tokenIndex()++) = currToken;
}
}
else if (currToken.isVariable())
{
const string& w = currToken.stringToken();
if
(
disableFunctionEntries
|| w.size() <= 3
|| !(
w[0] == '$'
&& w[1] == token::BEGIN_BLOCK
&& expandVariable(w, dict)
)
)
{
newElmt(tokenIndex()++) = currToken;
}
}
else
{
newElmt(tokenIndex()++) = currToken;
}
}
示例3: expand
Foam::token Foam::functionEntries::ifeqEntry::expand
(
const dictionary& dict,
const token& t
)
{
if (t.isWord())
{
return expand(dict, t.wordToken(), t);
}
else if (t.isVariable())
{
return expand(dict, t.stringToken(), t);
}
else if (t.isString())
{
return expand(dict, t.stringToken(), t);
}
else
{
return t;
}
}
示例4: if
bool Foam::functionEntries::ifeqEntry::equalToken
(
const token& t1,
const token& t2
)
{
const bool eqType = (t1.type() == t2.type());
switch (t1.type())
{
case token::UNDEFINED:
return eqType;
case token::PUNCTUATION:
return (eqType && t1.pToken() == t2.pToken());
case token::WORD:
if (eqType)
{
return t1.wordToken() == t2.wordToken();
}
else if (t2.isString())
{
return t1.wordToken() == t2.stringToken();
}
else
{
return false;
}
case token::STRING:
case token::VARIABLE:
case token::VERBATIMSTRING:
if (eqType)
{
return t1.stringToken() == t2.stringToken();
}
else if (t2.isWord())
{
return t1.stringToken() == t2.wordToken();
}
else
{
return false;
}
case token::LABEL:
if (eqType)
{
return t1.labelToken() == t2.labelToken();
}
else if (t2.isScalar())
{
return t1.labelToken() == t2.scalarToken();
}
else
{
return false;
}
case token::FLOAT_SCALAR:
if (eqType)
{
return equal(t1.floatScalarToken(), t2.floatScalarToken());
}
else if (t2.isScalar())
{
return t1.scalarToken() == t2.scalarToken();
}
else
{
return false;
}
case token::DOUBLE_SCALAR:
if (eqType)
{
return equal(t1.doubleScalarToken(), t2.doubleScalarToken());
}
else if (t2.isScalar())
{
return t1.scalarToken() == t2.scalarToken();
}
else
{
return false;
}
case token::LONG_DOUBLE_SCALAR:
if (eqType)
{
return equal
(
t1.longDoubleScalarToken(),
t2.longDoubleScalarToken()
);
}
else if (t2.isScalar())
{
return t1.scalarToken() == t2.scalarToken();
//.........这里部分代码省略.........