|
typedef QExplicitlySharedDataPointer< FunctionCall > | Ptr |
|
enum | CardinalityComputation { ProductOfCardinality,
UnionOfCardinality
} |
|
typedef QExplicitlySharedDataPointer< const Expression > | ConstPtr |
| A smart pointer wrapping const Expression instances. More...
|
|
enum | ID {
IDBooleanValue = 1,
IDCountFN,
IDEmptyFN,
IDExistsFN,
IDExpressionSequence,
IDGeneralComparison,
IDIfThenClause,
IDIgnorableExpression,
IDIntegerValue,
IDPositionFN,
IDStringValue,
IDValueComparison,
IDRangeVariableReference,
IDContextItem,
IDUserFunctionCallsite,
IDExpressionVariableReference,
IDAttributeConstructor,
IDUpperCaseFN,
IDLowerCaseFN,
IDFirstItemPredicate,
IDEmptySequence,
IDReturnOrderBy,
IDLetClause,
IDForClause,
IDPath,
IDNamespaceConstructor,
IDArgumentReference,
IDGenericPredicate,
IDAxisStep,
IDFloat,
IDCombineNodes,
IDUnresolvedVariableReference,
IDCardinalityVerifier
} |
|
typedef QList< Expression::Ptr > | List |
|
typedef QFlags< Property > | Properties |
|
enum | Property {
UseContextItem = 1,
DisableElimination = 1 << 1,
IsEvaluated = 1 << 2,
DisableTypingDeduction = 1 << 3,
EmptynessFollowsChild = 1 << 4,
RewriteToEmptyOnEmpty = 1 << 5,
RequiresFocus = 1 << 6,
AffectsOrderOnly = 1 << 7,
RequiresContextItem = (1 << 8) | RequiresFocus,
CreatesFocusForLast = 1 << 9,
LastOperandIsCollation = 1 << 10,
DependsOnLocalVariable = (1 << 11) | DisableElimination,
EvaluationCacheRedundant = (1 << 12),
IsNodeConstructor = 1 << 13,
RequiresCurrentItem = 1 << 14
} |
|
typedef QExplicitlySharedDataPointer< Expression > | Ptr |
| A smart pointer wrapping mutable Expression instances. More...
|
|
typedef ::QAbstractXmlForwardIterator< Expression::Ptr > | QAbstractXmlForwardIterator |
|
typedef QVector< Expression::Ptr > | Vector |
|
static void | rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context) |
|
QAtomicInt | ref |
|
template<CardinalityComputation suppliedCard> |
SequenceType::Ptr | operandsUnionType () const |
|
void | typeCheckOperands (const StaticContext::Ptr &context) |
|
| CppCastingHelper () |
|
const AtomicComparator::Ptr & | comparator () const |
|
bool | compare (const Item &i1, const Item &i2, const AtomicComparator::Ptr &comp, const AtomicComparator::Operator op) const |
| Compares i1 and i2 with operator op , using comparator comp . All input arguments must be valid, and not null . More...
|
|
| ComparisonPlatform () |
|
AtomicComparator::ComparisonResult | detailedFlexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const |
| like flexibleCompare(), but returns the result as an AtomicComparator::Operator instead of bool . More...
|
|
AtomicComparator::Ptr | fetchComparator (const ItemType::Ptr &type1, const ItemType::Ptr &type2, const ReportContext::Ptr &context) const |
|
bool | flexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const |
| Compares it1 against it2 , using comparator() and operatorID(). More...
|
|
void | prepareComparison (const AtomicComparator::Ptr &comparator) |
|
void | useCaseInsensitiveComparator () |
|
Item | cast (const Item &sourceValue, const ReportContext::Ptr &context) const |
|
| CastingPlatform (const ReportContext::ErrorCode code=ReportContext::FORG0001) |
|
void | checkTargetType (const ReportContext::Ptr &context) const |
|
bool | prepareCasting (const ReportContext::Ptr &context, const ItemType::Ptr &sourceType) |
|
Expression::List | m_operands |
|
template<AtomicComparator::Operator oper, AtomicComparator::ComparisonResult result>
class QPatternist::ComparingAggregator< oper, result >
Base class for the implementations of the fn:min()
and fn:max()
function.
What function that more specifically is followed, depends on how the constructor is called.
- See also
- MaxFN
-
MinFN
- Author
- Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com
Definition at line 88 of file qcomparingaggregator_p.h.
template<AtomicComparator::Operator oper, AtomicComparator::ComparisonResult result>
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.
- Parameters
-
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. |
- Returns
- an Expression that can be this Expression, or another expression, which somehow is necessary for making this Expression conforming to
reqType
Reimplemented from QPatternist::FunctionCall.
Definition at line 169 of file qcomparingaggregator.cpp.
197 context->error(QtXmlPatterns::tr(
"The first argument to %1 cannot be of type %2.")
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
Expression::List m_operands
static const AtomicType::Ptr xsDayTimeDuration
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
static Expression::Ptr create(const Expression *const replacementFor, const StaticContext::Ptr &context)
Creates an EmptySequence that is a replacement for replacementFor.
static const AtomicType::Ptr xsYearMonthDuration
static const AtomicType::Ptr xsString
static QString formatFunction(const NamePool::Ptr &np, const FunctionSignature::Ptr &func)
Formats FunctionSignature.
static const AtomicType::Ptr xsDateTime
static const AtomicType::Ptr xsDouble
virtual FunctionSignature::Ptr signature() const
void replace(int i, const T &t)
Replaces the item at index position i with value.
static const AtomicType::Ptr xsUntypedAtomic
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
static const EmptySequenceType::Ptr Empty
static const AtomicType::Ptr numeric
static const AtomicType::Ptr xsTime
static const AtomicType::Ptr xsAnyAtomicType
static const AtomicType::Ptr xsDate
static const AtomicType::Ptr xsAnyURI