Qt 4.8
|
Does node copying in a parameterized way, in order to deal with namespace preservation/inheritance. More...
#include <qcopyof_p.h>
Public Functions | |
virtual ExpressionVisitorResult::Ptr | accept (const ExpressionVisitor::Ptr &visitor) const |
virtual Expression::Ptr | compress (const StaticContext::Ptr &context) |
CopyOf (const Expression::Ptr &operand, const bool inheritNSS, const bool preserveNSS) | |
virtual void | evaluateToSequenceReceiver (const DynamicContext::Ptr &context) const |
virtual ItemType::Ptr | expectedContextItemType () const |
virtual SequenceType::List | expectedOperandTypes () const |
Item | mapToItem (const Item &source, const DynamicContext::Ptr &context) const |
virtual Properties | properties () const |
virtual SequenceType::Ptr | staticType () const |
Public Functions inherited from QPatternist::SingleContainer | |
virtual bool | compressOperands (const StaticContext::Ptr &) |
virtual Expression::List | operands () const |
virtual void | setOperands (const Expression::List &operands) |
Public Functions inherited from QPatternist::Expression | |
virtual const SourceLocationReflection * | actualReflection () const |
Returns this . More... | |
virtual void | announceFocusType (const ItemType::Ptr &itemType) |
Properties | deepProperties () const |
Computes the union of properties for this Expression and all its descending children. More... | |
virtual Properties | dependencies () const |
virtual QString | description () const |
virtual bool | evaluateEBV (const DynamicContext::Ptr &context) const |
virtual Item::Iterator::Ptr | evaluateSequence (const DynamicContext::Ptr &context) const |
virtual Item | evaluateSingleton (const DynamicContext::Ptr &context) const |
Expression () | |
bool | has (const Property prop) const |
bool | hasDependency (const Property prop) const |
virtual ID | id () const |
bool | is (const ID id) const |
bool | isEvaluated () const |
virtual ItemType::Ptr | newFocusType () const |
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > | optimizationPasses () const |
virtual PatternPriority | patternPriority () const |
const Expression::Ptr & | rewrite (const Expression::Ptr &to, const StaticContext::Ptr &context) const |
Rewrites this Expression to to , and return to . More... | |
virtual Expression::Ptr | typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType) |
virtual | ~Expression () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Public Functions inherited from QPatternist::CppCastingHelper< Expression > | |
const TCastTarget * | as () const |
TCastTarget * | as () |
Public Functions inherited from QPatternist::SourceLocationReflection | |
virtual QSourceLocation | sourceLocation () const |
SourceLocationReflection () | |
virtual | ~SourceLocationReflection () |
Private Types | |
typedef QExplicitlySharedDataPointer< const CopyOf > | ConstPtr |
Properties | |
const bool | m_inheritNamespaces |
const bool | m_preserveNamespaces |
const QAbstractXmlNodeModel::NodeCopySettings | m_settings |
Does node copying in a parameterized way, in order to deal with namespace preservation/inheritance.
If someone tries to call evaluateEBV(), evaluateSingleton() or evaluateSequence() on us, we will infinitely loop. But apparently that's not possible because we're always a child of ElementConstructor, currently.
Definition at line 75 of file qcopyof_p.h.
|
private |
Definition at line 110 of file qcopyof_p.h.
CopyOf::CopyOf | ( | const Expression::Ptr & | operand, |
const bool | inheritNSS, | ||
const bool | preserveNSS | ||
) |
Creats a CopyOf where it is checked that the expression operand
conforms to the type reqType
.
Definition at line 52 of file qcopyof.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 103 of file qcopyof.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 62 of file qcopyof.cpp.
|
virtual |
Evaluates this Expression by sending its output to DynamicContext::outputReceiver().
Reimplemented from QPatternist::Expression.
Definition at line 79 of file qcopyof.cpp.
|
virtual |
Returns the required type the context item must be an instance of.
If this Expression requires a focus, meaning its properties() function returns RequiresContextItem, it must return a type from this function. If any type is ok, BuiltinTypes::item should be returned.
In other words, this function must only be re-implemented if the focus is used. The default implementation performs an assert crash.
Reimplemented from QPatternist::Expression.
Definition at line 129 of file qcopyof.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 113 of file qcopyof.cpp.
|
inline |
|
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 120 of file qcopyof.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 108 of file qcopyof.cpp.
|
private |
Definition at line 111 of file qcopyof_p.h.
Referenced by compress().
|
private |
Definition at line 112 of file qcopyof_p.h.
Referenced by compress().
|
private |
Definition at line 113 of file qcopyof_p.h.
Referenced by evaluateToSequenceReceiver().