本文整理汇总了C++中ExprVector::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ExprVector::end方法的具体用法?C++ ExprVector::end怎么用?C++ ExprVector::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExprVector
的用法示例。
在下文中一共展示了ExprVector::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceAll
bool Expression::ReplaceAll(const ExprVector &rules, Calculator *calculator, bool *changed)
{
for(ExprVector::const_iterator rule = rules.begin(); rule != rules.end(); ++rule)
if(Replace(*rule, calculator, changed))
return true;
for(ExprVector::const_iterator leaf = leaves.begin(); leaf != leaves.end(); ++leaf)
if((*leaf)->ReplaceAll(rules, calculator, changed))
return true;
return false;
}
示例2: SubstituteSlots
void Expression::SubstituteSlots(const ExprVector &slots)
{
string functionName = FunctionName();
if(functionName == "Slot")
{
IntegerType index;
if(leaves.empty())
index = 1;
else
{
//MachineInteger *indexInt = leaves.at(0)->MachineIntegerHead();
Integer *indexInt(dynamic_cast<Integer*>(leaves.at(0)->NumberHead()));
if(indexInt)
index = indexInt->IntValue();
else
throw EvaluateException("Slot expected to have an Integer argument.");
}
Expression *slot;
if(index > 0 && index-1 < slots.size())
slot = slots.at(static_cast<ExprVector::size_type>(index-1));
else
throw EvaluateException("Slot not given.");
AssignCloned(slot);
}
else if(functionName == "SlotSequence")
{
delete head;
head = new Expression("Sequence");
DeleteLeaves();
leaves.reserve(slots.size());
for(ExprVector::const_iterator leaf = slots.begin(); leaf != slots.end(); ++leaf)
AppendLeaf((*leaf)->Clone());
}
else if(functionName != "Function")
{
if(head)
head->SubstituteSlots(slots);
for(ExprVector::const_iterator leaf = leaves.begin(); leaf != leaves.end(); ++leaf)
(*leaf)->SubstituteSlots(slots);
}
}
示例3: handleOneVarDecl
void RemoveUnusedStructField::handleOneVarDecl(const VarDecl *VD)
{
const Type *Ty = VD->getType().getTypePtr();
const RecordDecl *RD = getBaseRecordDef(Ty);
if (!RD)
return;
IndexVector *IdxVec = RecordDeclToField[RD];
if (!IdxVec)
return;
const Expr *InitE = VD->getInit();
TransAssert(InitE && "Need initializer!");
ExprVector InitExprs;
getInitExprs(Ty, InitE, IdxVec, InitExprs);
for (ExprVector::iterator I = InitExprs.begin(),
E = InitExprs.end(); I != E; ++I) {
removeOneInitExpr(*I);
}
}