本文整理汇总了C++中Exp::isSimpleVar方法的典型用法代码示例。如果您正苦于以下问题:C++ Exp::isSimpleVar方法的具体用法?C++ Exp::isSimpleVar怎么用?C++ Exp::isSimpleVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exp
的用法示例。
在下文中一共展示了Exp::isSimpleVar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InternalError
void RunVisitorT<T>::visitprivate(const CallExp &e)
{
CoverageInstance::invokeAndStartChrono((void*)&e);
types::typed_list outTmp;
types::typed_list inTmp;
std::vector<std::wstring> vectOptName;
std::vector<int> vectNbResult;
int iRetCount = getExpectedSize();
int iSaveExpectedSize = iRetCount;
//get function arguments
exps_t args = e.getArgs();
try
{
for (auto& arg : args)
{
int iSize = getExpectedSize();
if (arg->isAssignExp())
{
AssignExp* pAssign = static_cast<AssignExp*>(arg);
//optional parameter
Exp* pL = &pAssign->getLeftExp();
if (!pL->isSimpleVar())
{
std::wostringstream os;
os << _W("left side of optional parameter must be a variable") << std::endl;
CoverageInstance::stopChrono((void*)&e);
throw ast::InternalError(os.str(), 999, e.getLocation());
}
SimpleVar* pVar = pL->getAs<SimpleVar>();
Exp* pR = &pAssign->getRightExp();
// optional parameter have only one output argument
setExpectedSize(1);
try
{
pR->accept(*this);
}
catch (ScilabException &)
{
CoverageInstance::stopChrono((void*)&e);
throw;
}
setExpectedSize(iSize);
types::InternalType* pITR = getResult();
// IncreaseRef to protect opt argument of scope_end delete
// It will be deleted by clear_opt
pITR->IncreaseRef();
vectOptName.push_back(pVar->getSymbol().getName());
inTmp.push_back(pITR);
vectNbResult.push_back(1);
clearResult();
continue;
}
setExpectedSize(-1);
try
{
arg->accept(*this);
}
catch (ScilabException &)
{
CoverageInstance::stopChrono((void*)&e);
throw;
}
setExpectedSize(iSize);
if (getResult() == NULL)
{
//special case for empty extraction of list ( list()(:) )
vectNbResult.push_back(0);
continue;
}
if (isSingleResult())
{
inTmp.push_back(getResult());
getResult()->IncreaseRef();
}
else
{
for (int i = 0; i < getResultSize(); i++)
{
types::InternalType * pITArg = getResult(i);
pITArg->IncreaseRef();
inTmp.push_back(pITArg);
}
}
vectNbResult.push_back(getResultSize());
clearResult();
}
}
catch (const InternalError& ie)
{
clearResult();
cleanIn(inTmp, outTmp);
//.........这里部分代码省略.........