Qt 4.8
Public Types | Public Functions | List of all members
QPatternist::PositionalVariableReference Class Reference

A reference to an at variable, declared with the for-part in XQuery's FLWOR expression. More...

#include <qpositionalvariablereference_p.h>

Inheritance diagram for QPatternist::PositionalVariableReference:
QPatternist::VariableReference QPatternist::EmptyContainer QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection

Public Types

typedef QExplicitlySharedDataPointer< PositionalVariableReferencePtr
 
- Public Types inherited from QPatternist::VariableReference
typedef QList< VariableReference::PtrList
 
typedef QExplicitlySharedDataPointer< VariableReferencePtr
 
- Public Types inherited from QPatternist::Expression
typedef QExplicitlySharedDataPointer< const ExpressionConstPtr
 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::PtrList
 
typedef QFlags< PropertyProperties
 
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< ExpressionPtr
 A smart pointer wrapping mutable Expression instances. More...
 
typedef ::QAbstractXmlForwardIterator< Expression::PtrQAbstractXmlForwardIterator
 
typedef QVector< Expression::PtrVector
 

Public Functions

virtual ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const
 
virtual bool evaluateEBV (const DynamicContext::Ptr &context) const
 
virtual Item evaluateSingleton (const DynamicContext::Ptr &context) const
 
 PositionalVariableReference (const VariableSlotID slot)
 
virtual Properties properties () const
 
virtual SequenceType::Ptr staticType () const
 
- Public Functions inherited from QPatternist::VariableReference
VariableSlotID slot () const
 
 VariableReference (const VariableSlotID slot)
 
- Public Functions inherited from QPatternist::EmptyContainer
virtual Expression::List operands () const
 
virtual void setOperands (const Expression::List &)
 
- Public Functions inherited from QPatternist::Expression
virtual const SourceLocationReflectionactualReflection () 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 Item::Iterator::Ptr evaluateSequence (const DynamicContext::Ptr &context) const
 
virtual void evaluateToSequenceReceiver (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::Ptrrewrite (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 ()
 

Additional Inherited Members

- Static Public Functions inherited from QPatternist::Expression
static void rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::EmptyContainer
virtual bool compressOperands (const StaticContext::Ptr &context)
 
virtual SequenceType::List expectedOperandTypes () const
 
- Protected Functions inherited from QPatternist::Expression
void typeCheckOperands (const StaticContext::Ptr &context)
 
- Protected Functions inherited from QPatternist::CppCastingHelper< Expression >
 CppCastingHelper ()
 

Detailed Description

A reference to an at variable, declared with the for-part in XQuery's FLWOR expression.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 70 of file qpositionalvariablereference_p.h.

Typedefs

◆ Ptr

Definition at line 73 of file qpositionalvariablereference_p.h.

Constructors and Destructors

◆ PositionalVariableReference()

PositionalVariableReference::PositionalVariableReference ( const VariableSlotID  slot)

Definition at line 51 of file qpositionalvariablereference.cpp.

52 {
53 }
VariableReference(const VariableSlotID slot)

Functions

◆ accept()

ExpressionVisitorResult::Ptr PositionalVariableReference::accept ( const ExpressionVisitor::Ptr visitor) const
virtual

Implements QPatternist::Expression.

Definition at line 79 of file qpositionalvariablereference.cpp.

80 {
81  return visitor->visit(this);
82 }

◆ evaluateEBV()

bool PositionalVariableReference::evaluateEBV ( const DynamicContext::Ptr context) const
virtual

Returns always true, since a positional variable is always one or more, and the Effective Boolean Value for that range is always true.

Returns
always true

Reimplemented from QPatternist::Expression.

Definition at line 62 of file qpositionalvariablereference.cpp.

63 {
64  return true;
65 }

◆ evaluateSingleton()

Item PositionalVariableReference::evaluateSingleton ( const DynamicContext::Ptr context) const
virtual

Reimplemented from QPatternist::Expression.

Definition at line 55 of file qpositionalvariablereference.cpp.

56 {
57  Q_ASSERT(context);
58  Q_ASSERT(context->positionIterator(slot()));
59  return Integer::fromValue(context->positionIterator(slot())->position());
60 }
virtual Item::Iterator::Ptr positionIterator(const VariableSlotID slot) const =0
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static Item fromValue(const xsInteger num)
Definition: qinteger.cpp:52

◆ properties()

Expression::Properties PositionalVariableReference::properties ( ) const
virtual
Returns
DisableElimination

Reimplemented from QPatternist::VariableReference.

Definition at line 72 of file qpositionalvariablereference.cpp.

◆ staticType()

SequenceType::Ptr PositionalVariableReference::staticType ( ) const
virtual
Returns
always CommonSequenceTypes::ExactlyOneInteger

Implements QPatternist::Expression.

Definition at line 67 of file qpositionalvariablereference.cpp.

68 {
70 }
static const SequenceType::Ptr ExactlyOneInteger

The documentation for this class was generated from the following files: