Qt 4.8
|
Together with OrderBy, it implements XQuery 1.0's order by
expression.
More...
#include <qreturnorderby_p.h>
Properties | |
bool | m_flyAway |
OrderBy::OrderSpec::Vector | m_orderSpecs |
const OrderBy::Stability | m_stability |
Together with OrderBy, it implements XQuery 1.0's order by
expression.
ReturnOrderBy evaluates the sort keys and values, and hands it over to OrderBy, which is an AST ancestor, using SortTuples.
Definition at line 73 of file qreturnorderby_p.h.
ReturnOrderBy::ReturnOrderBy | ( | const OrderBy::Stability | stability, |
const OrderBy::OrderSpec::Vector & | oSpecs, | ||
const Expression::List & | operands | ||
) |
In operands
the first item is the return expression, and the rest, which is at least one, are the sort keys.
Definition at line 52 of file qreturnorderby.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 110 of file qreturnorderby.cpp.
|
virtual |
compress() is the last stage performs in compiling an expression, done after the initial AST build and calling typeCheck(). compress() performs crucial simplifications, either by having drastic performance implications or that some expressions depend on it for proper behavior.
The default implementation performs a sparse conditional constant propagation. In short, a recursive process is performed in the AST which examines if the Expression's operands are constant values, and if so, performs a const fold(AST rewrite) into the result of evaluating the expression in question. This default behavior can be disabled by letting properties() return DisableElimination.
This compress() stage can be relative effective due to the design of XPath, in part because intrinsic functions are heavily used. Many Expressions override compress() and do optimizations specific to what they do. Also, many Expressions performs optimizations in their typeCheck().
context | the static context. Supplies compile time information, and is the channel for communicating error messages. |
Reimplemented from QPatternist::Expression.
Definition at line 86 of file qreturnorderby.cpp.
|
virtual |
Determines the Effective Boolean Value of the expression.
The Effective Boolean Value of a value is not necessarily the same as converting the value to a new value of type xs:boolean.
Note that this function cannot return the empty sequence, evaluateSingleton() must be overridden in order to be able to do that.
The default implementation results in a type error. Hence, this function must be overridden if such behavior is not of interest.
Reimplemented from QPatternist::Expression.
Definition at line 80 of file qreturnorderby.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 64 of file qreturnorderby.cpp.
|
virtual |
Returns a list of Sequence Types, describing the type of each of the expression's operands. Hence, this function has a relationship to the operands() function:
- The lengths of the lists returned by expectedOperandTypes() and operands() should always be equal in length, since one cannot describe the type of a non-existent operand(and all operands must have type information). - A significant difference between the two functions is that while the type of objects in the list returned by operands() may vary between compilations/static context, simply because the particular Expression is part of different XPath expressions, the types in the list returned by expectedOperandTypes is always the same since the function/operator signature never changes.
This function should not be confused with staticType(), which returns the static type of the expression itself, not its operands. The function call is an expression where this is clear: the type of the return value is not the same as the arguments' types. The static type of the operands supplied to the expression can be determined via the staticType() function of the instances returned by operands().
If the expression has no operands, an empty list should be returned.
Implements QPatternist::Expression.
Definition at line 120 of file qreturnorderby.cpp.
|
virtual |
This property, which has no setter, returns an enum value that uniquely identifies this Expression. Patternist makes no use of C++'s dynamic_cast feature, but uses this polymorphic function instead.
Reimplemented from QPatternist::Expression.
Definition at line 128 of file qreturnorderby.cpp.
|
inline |
Definition at line 92 of file qreturnorderby_p.h.
Referenced by QPatternist::yyparse().
|
virtual |
The default implementation returns 0. Override and let the function return a different value, if that's of interest.
An important decision when re-implementing properties() is whether to OR in the properties() of ones operands. For instance, if an operand has RequiresFocus set, that flag nost likely applies to the apparent as well, since it depends on its operand.
Reimplemented from QPatternist::Expression.
Definition at line 104 of file qreturnorderby.cpp.
Referenced by setStay().
|
inline |
In the case of that we don't have a for-expression beloning us, but only a let clause, this ReturnOrderBy breaks if it stays in the AST. So, by default we assume that we should write ourselves away, unless this function is called. The associated ForClause will call it during typeCheck(), if it exists.
Definition at line 109 of file qreturnorderby_p.h.
Referenced by QPatternist::OrderBy::compress(), and QPatternist::OrderBy::typeCheck().
|
inline |
Definition at line 97 of file qreturnorderby_p.h.
Referenced by QPatternist::yyparse().
|
virtual |
Implements QPatternist::Expression.
Definition at line 115 of file qreturnorderby.cpp.
|
private |
Definition at line 128 of file qreturnorderby_p.h.
Referenced by compress(), and setStay().
|
private |
Definition at line 123 of file qreturnorderby_p.h.
Referenced by compress(), orderSpecs(), and ReturnOrderBy().
|
private |
This variable is unfortunately only used at compile time. However, it's tricky to get rid of it due to how QueryTransformParser would have to be adapted.
Definition at line 121 of file qreturnorderby_p.h.
Referenced by stability().