Implements XPath 2.0's logical expression or
.
More...
#include <qorexpression_p.h>
|
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 |
|
| PairContainer (const Expression::Ptr &operand1, const Expression::Ptr &operand2) |
|
void | typeCheckOperands (const StaticContext::Ptr &context) |
|
| CppCastingHelper () |
|
Expression::Ptr | m_operand1 |
|
Expression::Ptr | m_operand2 |
|
◆ OrExpression()
Definition at line 52 of file qorexpression.cpp.
AndExpression(const Expression::Ptr &operand1, const Expression::Ptr &operand2)
◆ accept()
◆ compress()
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().
- Parameters
-
context | the static context. Supplies compile time information, and is the channel for communicating error messages. |
- See also
- Wikipedia, the free encyclopedia, Sparse conditional constant propagation
-
Wikipedia, the free encyclopedia, Intrinsic function
-
Wikipedia, the free encyclopedia, Compiler optimization
Reimplemented from QPatternist::AndExpression.
Definition at line 62 of file qorexpression.cpp.
static const AtomicValue::Ptr BooleanTrue
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
QExplicitlySharedDataPointer< Expression > Ptr
A smart pointer wrapping mutable Expression instances.
virtual QExplicitlySharedDataPointer< DynamicContext > dynamicContext() const =0
Expression::Ptr m_operand1
Expression::Ptr m_operand2
◆ evaluateEBV()
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.
- See also
- XML Path Language (XPath) 2.0, 2.4.3 Effective Boolean Value
Reimplemented from QPatternist::AndExpression.
Definition at line 57 of file qorexpression.cpp.
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const
Expression::Ptr m_operand1
Expression::Ptr m_operand2
The documentation for this class was generated from the following files: