Qt 4.8
|
A step in a path expression that with an axis and a node test evaluates to a sequence of nodes from the context item. More...
#include <qaxisstep_p.h>
Static Public Functions | |
static QString | axisName (const QXmlNodeModelIndex::Axis axis) |
Prints the EBNF name corresponding to axis . More... | |
Static Public Functions inherited from QPatternist::Expression | |
static void | rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context) |
Private Types | |
typedef QExplicitlySharedDataPointer< const AxisStep > | ConstPtr |
Static Private Functions | |
static bool | isAlwaysEmpty (const QXmlNodeModelIndex::Axis axis, const QXmlNodeModelIndex::NodeKind nodeKind) |
Properties | |
QXmlNodeModelIndex::Axis | m_axis |
ItemType::Ptr | m_nodeTest |
Static Private Attributes | |
static const QXmlNodeModelIndex::NodeKind | s_whenAxisNodeKindEmpty [] |
A step in a path expression that with an axis and a node test evaluates to a sequence of nodes from the context item.
Definition at line 71 of file qaxisstep_p.h.
|
private |
Definition at line 137 of file qaxisstep_p.h.
AxisStep::AxisStep | ( | const QXmlNodeModelIndex::Axis | axis, |
const ItemType::Ptr & | nodeTest | ||
) |
Definition at line 91 of file qaxisstep.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 199 of file qaxisstep.cpp.
QXmlNodeModelIndex::Axis AxisStep::axis | ( | ) | const |
Definition at line 204 of file qaxisstep.cpp.
Referenced by QPatternist::changeToTopAxis().
|
static |
Prints the EBNF name corresponding to axis
.
For instance, for QXmlNodeModelIndex::Child, "child" is returned.
Apart from being used in this class, it is used in the SDK.
Definition at line 209 of file qaxisstep.cpp.
Referenced by QPatternist::yyparse().
|
virtual |
Evaluate this Expression by iterating over it. This is a central function for evaluating expressions.
Expressions must always always return a valid QAbstractXmlForwardIterator and may never return 0. If an empty result is of interest to be returned, the EmptyIterator should be returned.
The default implementation returns a SingletonIterator over the item returned from evaluateSingleton().
Reimplemented from QPatternist::Expression.
Definition at line 114 of file qaxisstep.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 128 of file qaxisstep.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 194 of file qaxisstep.cpp.
|
virtual |
Reimplemented from QPatternist::EmptyContainer.
Definition at line 182 of file qaxisstep.cpp.
|
virtual |
This property, which has no setter, returns an enum value that uniquely identifies this Expression. Patternist makes no use of C++'s dynamic_cast feature, but uses this polymorphic function instead.
Reimplemented from QPatternist::Expression.
Definition at line 242 of file qaxisstep.cpp.
|
staticprivate |
true
when the axis axis
and a node test testing node of type nodeKind
always produces an empty sequence. One such example is attribute::comment()
. Definition at line 86 of file qaxisstep.cpp.
|
inline |
Returns node
if it matches the node test this step is using, otherwise null
.
Definition at line 100 of file qaxisstep.cpp.
Referenced by evaluateSingleton().
|
inline |
Definition at line 112 of file qaxisstep_p.h.
Referenced by QPatternist::yyparse().
|
virtual |
By default 0.5 is returned.
Reimplemented from QPatternist::Expression.
Definition at line 237 of file qaxisstep.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 189 of file qaxisstep.cpp.
|
inline |
Definition at line 157 of file qaxisstep_p.h.
Referenced by QPatternist::changeToTopAxis(), QPatternist::createPatternPath(), and QPatternist::yyparse().
|
inline |
|
virtual |
Implements QPatternist::Expression.
Definition at line 169 of file qaxisstep.cpp.
|
virtual |
Rewrites to ParentNodeAxis, if possible.
Reimplemented from QPatternist::Expression.
Definition at line 153 of file qaxisstep.cpp.
|
private |
The reason this variable is mutable, is that in the case of XSL-T patterns, we do quite some reordering.
Definition at line 153 of file qaxisstep_p.h.
Referenced by axis(), evaluateSequence(), evaluateSingleton(), staticType(), and typeCheck().
|
private |
Definition at line 154 of file qaxisstep_p.h.
Referenced by AxisStep(), mapToItem(), patternPriority(), staticType(), and typeCheck().
|
staticprivate |
Definition at line 139 of file qaxisstep_p.h.
Referenced by isAlwaysEmpty(), and QPatternist::operator|().