本文整理汇总了C++中expression::List::at方法的典型用法代码示例。如果您正苦于以下问题:C++ List::at方法的具体用法?C++ List::at怎么用?C++ List::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类expression::List
的用法示例。
在下文中一共展示了List::at方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typeCheck
Expression::Ptr ElementConstructor::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
/* What does this code do? When type checking our children, our namespace
* bindings, which are also children of the form of NamespaceConstructor
* instances, must be statically in-scope for them, so find them and
* shuffle their bindings into the StaticContext. */
m_staticBaseURI = context->baseURI();
/* Namespace declarations changes the in-scope bindings, so let's
* first lookup our child NamespaceConstructors. */
const ID operandID = m_operand2->id();
NamespaceResolver::Bindings overrides;
if(operandID == IDExpressionSequence)
{
const Expression::List operands(m_operand2->operands());
const int len = operands.count();
for(int i = 0; i < len; ++i)
{
if(operands.at(i)->is(IDNamespaceConstructor))
{
const QXmlName &nb = operands.at(i)->as<NamespaceConstructor>()->namespaceBinding();
overrides.insert(nb.prefix(), nb.namespaceURI());
}
}
}
const NamespaceResolver::Ptr newResolver(new DelegatingNamespaceResolver(context->namespaceBindings(), overrides));
const StaticContext::Ptr augmented(new StaticNamespaceContext(newResolver, context));
return PairContainer::typeCheck(augmented, reqType);
}
示例2: typeCheck
Expression::Ptr ElementConstructor::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
m_staticBaseURI = context->baseURI();
/* Namespace declarations changes the in-scope bindings, so let's
* first lookup our child NamespaceConstructors. */
const ID operandID = m_operand2->id();
NamespaceResolver::Bindings overrides;
if(operandID == IDExpressionSequence)
{
const Expression::List operands(m_operand2->operands());
const int len = operands.count();
for(int i = 0; i < len; ++i)
{
if(operands.at(i)->is(IDNamespaceConstructor))
{
const QXmlName &nb = operands.at(i)->as<NamespaceConstructor>()->namespaceBinding();
overrides.insert(nb.prefix(), nb.namespaceURI());
}
}
}
const NamespaceResolver::Ptr newResolver(new DelegatingNamespaceResolver(context->namespaceBindings(), overrides));
const StaticContext::Ptr augmented(new StaticNamespaceContext(newResolver, context));
return PairContainer::typeCheck(augmented, reqType);
}
示例3: typeCheck
Expression::Ptr OrderBy::typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType)
{
m_returnOrderBy->setStay(true);
/* It's important we do the typeCheck() before calling OrderSpec::prepare(), since
* atomizers must first be inserted. */
const Expression::Ptr me(SingleContainer::typeCheck(context, reqType));
const Expression::List ops(m_returnOrderBy->operands());
const int len = ops.count();
Q_ASSERT(ops.count() > 1);
Q_ASSERT(m_orderSpecs.count() == ops.count() - 1);
for(int i = 1; i < len; ++i)
m_orderSpecs[i - 1].prepare(ops.at(i), context);
return me;
/* It's not meaningful to sort a single item or less, so rewrite ourselves
* away if that is the case. This is an optimization. */
/* TODO: How do we remove ReturnOrderBy?
if(Cardinality::zeroOrOne().isMatch(m_operand->staticType()->cardinality()))
return m_operand->typeCheck(context, reqType);
else
return SingleContainer::typeCheck(context, reqType);
*/
}
示例4: setOperands
void TripleContainer::setOperands(const Expression::List &ops)
{
Q_ASSERT(ops.count() == 3);
m_operand1 = ops.first();
m_operand2 = ops.at(1);
m_operand3 = ops.at(2);
}