Qt 4.8
Public Functions | Protected Functions | Properties | List of all members
QPatternist::StaticNamespacesContainer Class Reference

A helper subclass that stores a NamespaceResolver for the static namespaces. More...

#include <qstaticnamespacescontainer_p.h>

Inheritance diagram for QPatternist::StaticNamespacesContainer:
QPatternist::FunctionCall QPatternist::UnlimitedContainer QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection QPatternist::ElementAvailableFN QPatternist::FunctionAvailableFN QPatternist::SystemPropertyFN QPatternist::TypeAvailableFN

Public Functions

virtual Expression::Ptr typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
 
- Public Functions inherited from QPatternist::FunctionCall
virtual ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const
 
virtual SequenceType::List expectedOperandTypes () const
 
virtual ID id () const
 
virtual Expression::Properties properties () const
 
virtual void setSignature (const FunctionSignature::Ptr &sign)
 
virtual FunctionSignature::Ptr signature () const
 
virtual SequenceType::Ptr staticType () const
 
- Public Functions inherited from QPatternist::UnlimitedContainer
virtual bool compressOperands (const StaticContext::Ptr &)
 
virtual Expression::List operands () const
 
virtual void setOperands (const Expression::List &list)
 
 UnlimitedContainer (const Expression::List &operands=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 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
 
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
 
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 ()
 
- 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 ()
 

Protected Functions

const NamespaceResolver::PtrstaticNamespaces () const
 
 StaticNamespacesContainer ()
 
- Protected Functions inherited from QPatternist::UnlimitedContainer
template<CardinalityComputation suppliedCard>
SequenceType::Ptr operandsUnionType () const
 
- Protected Functions inherited from QPatternist::Expression
void typeCheckOperands (const StaticContext::Ptr &context)
 
- Protected Functions inherited from QPatternist::CppCastingHelper< Expression >
 CppCastingHelper ()
 

Properties

NamespaceResolver::Ptr m_resolver
 

Additional Inherited Members

- Public Types inherited from QPatternist::FunctionCall
typedef QExplicitlySharedDataPointer< FunctionCallPtr
 
- Public Types inherited from QPatternist::UnlimitedContainer
enum  CardinalityComputation { ProductOfCardinality, UnionOfCardinality }
 
- 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
 
- 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 Variables inherited from QPatternist::UnlimitedContainer
Expression::List m_operands
 

Detailed Description

A helper subclass that stores a NamespaceResolver for the static namespaces.

This is used by functionality which needs to resolve names against the statically known namespaces, at runtime. A good example of this is function-available().

The resolver is accessed through staticNamespaces(), which will be available after the typeCheck() stage.

This class must be subclassed.

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

Definition at line 79 of file qstaticnamespacescontainer_p.h.

Constructors and Destructors

◆ StaticNamespacesContainer()

QPatternist::StaticNamespacesContainer::StaticNamespacesContainer ( )
inlineprotected

This constructor only exists to ensure this class is subclassed.

Definition at line 102 of file qstaticnamespacescontainer_p.h.

103  {
104  }

Functions

◆ staticNamespaces()

const NamespaceResolver::Ptr& QPatternist::StaticNamespacesContainer::staticNamespaces ( ) const
inlineprotected

Before typeCheck(), behavior of this function is undefined. After typeCheck(), this function guarantees to return a valid pointer.

Definition at line 93 of file qstaticnamespacescontainer_p.h.

Referenced by QPatternist::ElementAvailableFN::evaluateEBV(), QPatternist::SystemPropertyFN::evaluateSingleton(), QPatternist::TypeAvailableFN::evaluateSingleton(), and QPatternist::FunctionAvailableFN::evaluateSingleton().

94  {
96  return m_resolver;
97  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ typeCheck()

Expression::Ptr StaticNamespacesContainer::typeCheck ( const StaticContext::Ptr context,
const SequenceType::Ptr reqType 
)
virtual

Reimplemented to store data from the context.

Reimplemented from QPatternist::FunctionCall.

Reimplemented in QPatternist::FunctionAvailableFN, and QPatternist::TypeAvailableFN.

Definition at line 48 of file qstaticnamespacescontainer.cpp.

Referenced by QPatternist::FunctionAvailableFN::typeCheck(), and QPatternist::TypeAvailableFN::typeCheck().

50 {
53 
54  return FunctionCall::typeCheck(context, reqType);
55 }
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
QExplicitlySharedDataPointer< NamespaceResolver > Ptr
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
virtual NamespaceResolver::Ptr namespaceBindings() const =0

Properties

◆ m_resolver

NamespaceResolver::Ptr QPatternist::StaticNamespacesContainer::m_resolver
private

Definition at line 107 of file qstaticnamespacescontainer_p.h.

Referenced by staticNamespaces(), and typeCheck().


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