Qt 4.8
|
Constructs an element node. This covers both computed and directly constructed element nodes. More...
#include <qelementconstructor_p.h>
Public Functions | |
virtual ExpressionVisitorResult::Ptr | accept (const ExpressionVisitor::Ptr &visitor) const |
ElementConstructor (const Expression::Ptr &operand1, const Expression::Ptr &operand2, const bool isXSLT) | |
virtual Item | evaluateSingleton (const DynamicContext::Ptr &context) const |
virtual void | evaluateToSequenceReceiver (const DynamicContext::Ptr &context) const |
virtual SequenceType::List | expectedOperandTypes () const |
virtual Properties | properties () const |
virtual SequenceType::Ptr | staticType () const |
virtual Expression::Ptr | typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType) |
Public Functions inherited from QPatternist::PairContainer | |
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) |
virtual Expression::Ptr | compress (const StaticContext::Ptr &context) |
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 ItemType::Ptr | expectedContextItemType () 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 () |
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 () |
Properties | |
const bool | m_isXSLT |
QUrl | m_staticBaseURI |
Constructs an element node. This covers both computed and directly constructed element nodes.
Definition at line 74 of file qelementconstructor_p.h.
ElementConstructor::ElementConstructor | ( | const Expression::Ptr & | operand1, |
const Expression::Ptr & | operand2, | ||
const bool | isXSLT | ||
) |
Definition at line 56 of file qelementconstructor.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 155 of file qelementconstructor.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 63 of file qelementconstructor.cpp.
|
virtual |
Evaluates this Expression by sending its output to DynamicContext::outputReceiver().
Reimplemented from QPatternist::Expression.
Definition at line 82 of file qelementconstructor.cpp.
|
virtual |
The first operand must be exactly one xs:QName
, and the second argument can be zero or more items.
Implements QPatternist::Expression.
Definition at line 141 of file qelementconstructor.cpp.
|
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 149 of file qelementconstructor.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 136 of file qelementconstructor.cpp.
|
virtual |
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.
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. |
reqType
Reimplemented from QPatternist::Expression.
Definition at line 100 of file qelementconstructor.cpp.
|
private |
Definition at line 99 of file qelementconstructor_p.h.
Referenced by evaluateSingleton(), and evaluateToSequenceReceiver().
|
private |
Definition at line 98 of file qelementconstructor_p.h.
Referenced by evaluateSingleton(), and typeCheck().