Qt 4.8
|
Implements the node comparison operators >>
, <<
, and is
.
More...
#include <qnodecomparison_p.h>
Static Public Functions | |
static QString | displayName (const QXmlNodeModelIndex::DocumentOrder op) |
Static Public Functions inherited from QPatternist::Expression | |
static void | rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context) |
Private Types | |
enum | Result { Empty, True, False } |
Private Functions | |
Result | evaluate (const DynamicContext::Ptr &context) const |
Properties | |
const QXmlNodeModelIndex::DocumentOrder | m_op |
Implements the node comparison operators >>
, <<
, and is
.
Definition at line 72 of file qnodecomparison_p.h.
|
private |
NodeComparison::NodeComparison | ( | const Expression::Ptr & | operand1, |
const QXmlNodeModelIndex::DocumentOrder | op, | ||
const Expression::Ptr & | operand2 | ||
) |
Definition at line 55 of file qnodecomparison.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 179 of file qnodecomparison.cpp.
|
virtual |
If any operator is the empty sequence, the NodeComparison rewrites into that, since the empty sequence is always the result in that case.
Reimplemented from QPatternist::Expression.
Definition at line 129 of file qnodecomparison.cpp.
|
static |
Determines the string representation for a node comparison operator.
op
is Precedesop
is Followsop
is Is Definition at line 149 of file qnodecomparison.cpp.
|
inlineprivate |
Definition at line 91 of file qnodecomparison.cpp.
Referenced by evaluateEBV(), and evaluateSingleton().
|
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 79 of file qnodecomparison.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 66 of file qnodecomparison.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 121 of file qnodecomparison.cpp.
|
virtual |
Definition at line 174 of file qnodecomparison.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 165 of file qnodecomparison.cpp.
|
private |
Definition at line 118 of file qnodecomparison_p.h.
Referenced by evaluate(), and operatorID().