本文整理汇总了C++中ASTNode::staticResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTNode::staticResolution方法的具体用法?C++ ASTNode::staticResolution怎么用?C++ ASTNode::staticResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTNode
的用法示例。
在下文中一共展示了ASTNode::staticResolution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: staticResolution
ASTNode* Intersect::staticResolution(StaticContext *context)
{
XPath2MemoryManager *mm = context->getMemoryManager();
if(!sortAdded_) {
sortAdded_ = true;
// Wrap ourselves in a document order sort
ASTNode *result = new (mm) XQDocumentOrder(this, mm);
result->setLocationInfo(this);
return result->staticResolution(context);
}
for(VectorOfASTNodes::iterator i = _args.begin(); i != _args.end(); ++i) {
SequenceType *seqType = new (mm) SequenceType(new (mm) SequenceType::ItemType(SequenceType::ItemType::TEST_NODE),
SequenceType::STAR);
seqType->setLocationInfo(this);
*i = new (mm) XQTreatAs(*i, seqType, mm);
(*i)->setLocationInfo(this);
*i = (*i)->staticResolution(context);
}
return this;
}
示例2: staticResolution
ASTNode* XQFunctionCall::staticResolution(StaticContext *context)
{
if(uri_ == 0) {
if(prefix_ == 0 || *prefix_ == 0) {
uri_ = context->getDefaultFuncNS();
}
else {
uri_ = context->getUriBoundToPrefix(prefix_, this);
}
}
ASTNode *result = context->lookUpFunction(uri_, name_, *args_, this);
if(result == 0) {
XMLBuffer buf;
buf.set(X("A function called {"));
buf.append(uri_);
buf.append(X("}"));
buf.append(name_);
buf.append(X(" with "));
XPath2Utils::numToBuf(args_ ? (unsigned int)args_->size() : 0, buf);
buf.append(X(" arguments is not defined [err:XPST0017]"));
XQThrow(StaticErrorException, X("XQFunctionCall::staticResolution"), buf.getRawBuffer());
}
// Our arguments don't belong to us anymore
for(VectorOfASTNodes::iterator i = args_->begin(); i != args_->end(); ++i) {
*i = 0;
}
// Release this object
this->release();
return result->staticResolution(context);
}
示例3: staticResolution
ASTNode* FunctionZeroOrOne::staticResolution(StaticContext *context)
{
XPath2MemoryManager *mm = context->getMemoryManager();
SequenceType *seqType = new (mm) SequenceType(new (mm) SequenceType::ItemType(SequenceType::ItemType::TEST_ANYTHING),
SequenceType::QUESTION_MARK);
seqType->setLocationInfo(this);
ASTNode *result = new (mm) XQTreatAs(_args.front(), seqType, mm, err_FORG0003);
result->setLocationInfo(this);
return result->staticResolution(context);
}