Qt 4.8
|
Implements the function fn:id()
.
More...
#include <qsequencegeneratingfns_p.h>
Private Types | |
typedef QExplicitlySharedDataPointer< const IdFN > | ConstPtr |
Properties | |
bool | m_hasCreatedSorter |
Additional Inherited Members | |
Static Public Functions inherited from QPatternist::Expression | |
static void | rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context) |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Protected Functions inherited from QPatternist::ContextNodeChecker | |
void | checkTargetNode (const QXmlNodeModelIndex &node, const DynamicContext::Ptr &context, const ReportContext::ErrorCode) const |
Checks that the root node of node is a document node, and otherwise issues an error. More... | |
Protected Functions inherited from QPatternist::UnlimitedContainer | |
template<CardinalityComputation suppliedCard> | |
SequenceType::Ptr | operandsUnionType () const |
Protected Functions inherited from QPatternist::Expression | |
void | typeCheckOperands (const StaticContext::Ptr &context) |
Protected Functions inherited from QPatternist::CppCastingHelper< Expression > | |
CppCastingHelper () | |
Protected Variables inherited from QPatternist::UnlimitedContainer | |
Expression::List | m_operands |
Implements the function fn:id()
.
Definition at line 80 of file qsequencegeneratingfns_p.h.
|
private |
Definition at line 95 of file qsequencegeneratingfns_p.h.
typedef QPair<DynamicContext::Ptr, const QAbstractXmlNodeModel *> QPatternist::IdFN::IDContext |
Definition at line 84 of file qsequencegeneratingfns_p.h.
IdFN::IdFN | ( | ) |
Definition at line 62 of file qsequencegeneratingfns.cpp.
|
virtual |
Evaluate this Expression by iterating over it. This is a central function for evaluating expressions.
Expressions must always always return a valid QAbstractXmlForwardIterator and may never return 0. If an empty result is of interest to be returned, the EmptyIterator should be returned.
The default implementation returns a SingletonIterator over the item returned from evaluateSingleton().
Reimplemented from QPatternist::Expression.
Definition at line 168 of file qsequencegeneratingfns.cpp.
Definition at line 66 of file qsequencegeneratingfns.cpp.
|
virtual |
This implementation guarantees to never rewrite away this Expression, but at most rewrite it as a child of another expression(that presumably have a type checking role). It is therefore always safe to override this function and call this implementation and not worry about that this Expression becomes deleted.
Many Expressions override typeCheck() and performs optimizations, as opposed to doing it in the compress() stage. This is due to that the design of those Expressions often are tied to that certain simplifications are done at the typeCheck() stage of the compilation process or that it in some other way is related to what the typeCheck() do. Also, the earlier the AST can be simplified, the better the chances are for subsequent optimizations.
It is important that the super class's typeCheck() is called before doing any custom type checking, since the call can change the children(notably, the childrens' static types). For example, if the Expression, MyExpression in the example, does not match the required type, typeCheck returns the Expression wrapped in for example ItemVerifier, CardinalityVerifier, or both.
typeCheck() may be called many times. typeCheck() must either raise an error if this Expression is an invalid expression. Thus, it is guaranteed that an Expression is valid after typeCheck() is called.
context | supplies information, such as namespace bindings and available function signatures, that can be needed at compilation time. context is guaranteed by the caller to never null. |
reqType | the static type that this Expression must match when evaluated. reqType is guaranteed by the caller to never null. |
reqType
Reimplemented from QPatternist::FunctionCall.
Definition at line 183 of file qsequencegeneratingfns.cpp.
|
private |
Definition at line 96 of file qsequencegeneratingfns_p.h.