本文整理汇总了C++中ScalarExpressionPtr::isQuoted方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarExpressionPtr::isQuoted方法的具体用法?C++ ScalarExpressionPtr::isQuoted怎么用?C++ ScalarExpressionPtr::isQuoted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarExpressionPtr
的用法示例。
在下文中一共展示了ScalarExpressionPtr::isQuoted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: outputCPPImpl
//.........这里部分代码省略.........
cg_printf(" - ");
break;
case '*':
cg_printf(" * ");
break;
case T_SL:
cg_printf(" << ");
break;
case T_SR:
cg_printf(" >> ");
break;
default:
cg_printf(", ");
break;
}
break;
}
switch (m_op) {
case '+':
case '-':
case '*':
case '/':
if (!second->outputCPPArithArg(cg, ar, m_op == '+')) {
TypePtr argType = second->hasCPPTemp() ?
second->getType() : second->getActualType();
bool flag = castIfNeeded(getActualType(), argType, cg, ar, getScope());
second->outputCPP(cg, ar);
if (flag) {
cg_printf(")");
}
}
break;
case T_INSTANCEOF:
{
if (second->isScalar()) {
ScalarExpressionPtr scalar =
dynamic_pointer_cast<ScalarExpression>(second);
bool notQuoted = scalar && !scalar->isQuoted();
std::string s = second->getLiteralString();
if (s == "static" && notQuoted) {
cg_printf("FrameInjection::GetStaticClassName(fi.getThreadInfo())");
} else if (s != "") {
if (s == "self" && notQuoted) {
ClassScopeRawPtr cls = getOriginalClass();
if (cls) {
s = cls->getOriginalName();
}
} else if (s == "parent" && notQuoted) {
ClassScopeRawPtr cls = getOriginalClass();
if (cls && !cls->getParent().empty()) {
s = cls->getParent();
}
}
cg_printString(s, ar, shared_from_this());
} else {
second->outputCPP(cg, ar);
}
} else {
second->outputCPP(cg, ar);
}
break;
}
case T_PLUS_EQUAL:
case T_MINUS_EQUAL:
case T_MUL_EQUAL:
{
TypePtr t1 = first->getCPPType();
TypePtr t2 = second->getType();
if (t1 && !t1->is(Type::KindOfArray) &&
t2 && Type::IsCastNeeded(ar, t2, t1)) {
t1->outputCPPCast(cg, ar, getScope());
cg_printf("(");
second->outputCPP(cg, ar);
cg_printf(")");
} else {
second->outputCPP(cg, ar);
}
break;
}
case T_BOOLEAN_OR:
case T_BOOLEAN_AND:
case T_LOGICAL_AND:
case T_LOGICAL_OR:
if (isUnused()) {
cg_printf("(");
if (second->outputCPPUnneeded(cg, ar)) {
cg_printf(",");
}
cg_printf("false)");
} else {
second->outputCPP(cg, ar);
}
break;
default:
second->outputCPP(cg, ar);
}
if (wrapped) cg_printf(")");
}