107 if(reqType != typeEnd)
114 result.
append((*it)->typeCheck(context, t));
142 for(; passIt != passEnd; ++passIt)
147 if(pass->startIdentifier && !pass->startIdentifier->matches(expr))
160 switch(pass->operandsMatchMethod)
164 for(; opIt != opEnd; ++opIt)
168 if(opIdentifier && !opIdentifier->matches(operand))
188 "AnyOrder is currently only supported for Expressions with two operands.");
189 if(pass->operandIdentifiers.first()->matches(ops.first()) &&
190 pass->operandIdentifiers.last()->matches(ops.last()))
194 else if(pass->operandIdentifiers.first()->matches(ops.last()) &&
195 pass->operandIdentifiers.last()->matches(ops.first()))
197 sourceMarker.
first() = 1;
216 for(; mIt != mEnd; ++mIt)
219 sourceExpr = sourceExpr->operands().at(*mIt);
222 operands.
append(sourceExpr);
230 else if(pass->resultCreator)
231 return pass->resultCreator->create(operands, context, expr.
data())->
compress(context);
271 Item item(it->next());
279 switch(result.
count())
305 return makeSingletonIterator(item);
324 Item next(it->next());
328 receiver->
item(next);
336 "expectedContextItemType() must be overridden when RequiresContextItem is set.");
354 dependencies |= next->dependencies();
364 const int len = ops.
count();
366 for(
int i = 0; i < len; ++i)
374 const int len = ops.
count();
376 for(
int i = 0; i < len; ++i)
395 "This function must be overridden when CreatesFocusForLast is set.");
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual SequenceType::List expectedOperandTypes() const =0
virtual void setOperands(const Expression::List &operands)=0
A push interface for the XPath Data Model. Similar to SAX's ContentHandler.
#define QT_END_NAMESPACE
This macro expands to.
A StaticContext that carries a specified static type for the context item, but otherwise delegates to...
#define it(className, varName)
virtual PatternPriority patternPriority() const
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
static Expression::Ptr invokeOptimizers(const Expression::Ptr &expr, const StaticContext::Ptr &context)
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
int count(const T &t) const
Returns the number of occurrences of value in the list.
static bool evaluateEBV(const Item::Iterator::Ptr &e, const QExplicitlySharedDataPointer< DynamicContext > &)
The QString class provides a Unicode character string.
virtual ItemType::Ptr expectedContextItemType() const
static Expression::Ptr create(const Expression *const replacementFor, const StaticContext::Ptr &context)
Creates an EmptySequence that is a replacement for replacementFor.
bool hasDependency(const Property prop) const
static const EmptyIterator< Item >::Ptr emptyIterator
bool has(const Property prop) const
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > optimizationPasses() const
Expression::Ptr next()
Returns the current Expression and advances the iterator.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
virtual const SourceLocationReflection * actualReflection() const
Returns this.
QList< OptimizationPass::Ptr > List
friend class const_iterator
T * data() const
Returns a pointer to the shared data object.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void typeCheckOperands(const StaticContext::Ptr &context)
StaticContext::Ptr finalizeStaticContext(const StaticContext::Ptr &context) const
static void rewrite(Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)
const T & at(int i) const
Returns the item at index position i in the list.
The namespace for the internal API of QtXmlPatterns.
virtual void item(const Item &item)=0
Sends an Item to this QAbstractXmlReceiver that may be a QXmlNodeModelIndex or an AtomicValue...
static Boolean::Ptr fromValue(const bool value)
virtual Expression::List operands() const =0
Houses an AtomicValue, making it available as an Expression.
T & first()
Returns a reference to the first item in the list.
QExplicitlySharedDataPointer< Expression > Ptr
A smart pointer wrapping mutable Expression instances.
QExplicitlySharedDataPointer< ItemType > Ptr
virtual SequenceType::Ptr staticType() const =0
#define Q_ASSERT_X(cond, where, what)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
QFlags< Property > Properties
Represents an item in the XPath 2.0 Data Model.
virtual bool compressOperands(const StaticContext::Ptr &)=0
static Expression::Ptr applyFunctionConversion(const Expression::Ptr &operand, const SequenceType::Ptr &reqType, const StaticContext::Ptr &context, const ReportContext::ErrorCode code=ReportContext::XPTY0004, const Options=Options(AutomaticallyConvert|CheckFocus))
Builds a pipeline of artificial AST nodes that ensures operand conforms to the type reqType by applyi...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
virtual QExplicitlySharedDataPointer< DynamicContext > dynamicContext() const =0
Properties deepProperties() const
Computes the union of properties for this Expression and all its descending children.
T & last()
Returns a reference to the last item in the list.
virtual Properties properties() const
virtual QString description() const
Expression::Ptr constantPropagate(const StaticContext::Ptr &context) const
Performs constant propagation, also called constant folding, on this expression.
Houses a sequence of atomic values, making it available as an Expression.
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
virtual QAbstractXmlReceiver * outputReceiver() const =0
QExplicitlySharedDataPointer< StaticContext > Ptr
static const KeyPair *const end
virtual void evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
virtual void announceFocusType(const ItemType::Ptr &itemType)
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const
virtual ItemType::Ptr newFocusType() const
Base class for all instances that represents something at a certain location.
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const
virtual Properties dependencies() const
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
A helper class that iterates a tree of Expression instances. It is not a sub-class of QAbstractXmlFor...