Qt 4.8
|
Implements the function fn:subsequence()
.
More...
#include <qsequencefns_p.h>
Properties | |
bool | m_hasTypeChecked |
Implements the function fn:subsequence()
.
Definition at line 310 of file qsequencefns_p.h.
SubsequenceFN::SubsequenceFN | ( | ) |
Definition at line 216 of file qsequencefns.cpp.
|
virtual |
This function implements rewrites the SubsequenceFN instance into an empty sequence if its third argument, the sequence length argument, is evaluated and is effectively equal or less than zero.
Reimplemented from QPatternist::Expression.
Definition at line 257 of file qsequencefns.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 227 of file qsequencefns.cpp.
Referenced by evaluateSingleton().
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 252 of file qsequencefns.cpp.
|
virtual |
Partially implements the static type inference rules.
Reimplemented from QPatternist::FunctionCall.
Definition at line 275 of file qsequencefns.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 220 of file qsequencefns.cpp.
|
private |
Definition at line 336 of file qsequencefns_p.h.
Referenced by staticType(), and typeCheck().