Qt 4.8
Public Types | Public Functions | List of all members
QPatternist::StaticContext Class Referenceabstract

Carries information and facilities used at compilation time. More...

#include <qstaticcontext_p.h>

Inheritance diagram for QPatternist::StaticContext:
QPatternist::ReportContext QSharedData QPatternist::DelegatingStaticContext QPatternist::GenericStaticContext QPatternist::StaticBaseURIContext QPatternist::StaticCompatibilityContext QPatternist::StaticCurrentContext QPatternist::StaticFocusContext QPatternist::StaticNamespaceContext

Public Types

enum  BoundarySpacePolicy { BSPPreserve, BSPStrip }
 
enum  ConstructionMode { CMPreserve, CMStrip }
 
enum  InheritMode { Inherit, NoInherit }
 
enum  OrderingEmptySequence { Greatest, Least }
 
enum  OrderingMode { Ordered, Unordered }
 
enum  PreserveMode { Preserve, NoPreserve }
 
typedef QExplicitlySharedDataPointer< StaticContextPtr
 
- Public Types inherited from QPatternist::ReportContext
enum  ErrorCode {
  XSDError, XPST0001, XPDY0002, XPST0003,
  XPTY0004, XPST0005, XPTY0006, XPTY0007,
  XPST0008, XQST0009, XPST0010, XQST0012,
  XQST0013, XQST0014, XQST0015, XQST0016,
  XPST0017, XPTY0018, XPTY0019, XPTY0020,
  XPDY0021, XQST0022, XQTY0023, XQTY0024,
  XQDY0025, XQDY0026, XQDY0027, XQTY0028,
  XQDY0029, XQTY0030, XQST0031, XQST0032,
  XQST0033, XQST0034, XQST0035, XQST0036,
  XQST0037, XQST0038, XQST0039, XQST0040,
  XQDY0041, XQST0042, XQST0043, XQDY0044,
  XQST0045, XQST0046, XQST0047, XQST0048,
  XQST0049, XPDY0050, XPST0051, XQDY0052,
  XQST0053, XQST0054, XQST0055, XQST0056,
  XQST0057, XQST0058, XQST0059, XQST0060,
  XQDY0061, XQDY0062, XQST0063, XQDY0064,
  XQST0065, XQST0066, XQST0067, XQST0068,
  XQST0069, XQST0070, XQST0071, XQDY0072,
  XQST0073, XQDY0074, XQST0075, XQST0076,
  XQST0077, XQST0078, XQST0079, XPST0080,
  XPST0081, XQST0082, XPST0083, XQDY0084,
  XQST0085, XQTY0086, XQST0087, XQST0088,
  XQST0089, XQST0090, XQDY0091, XQDY0092,
  XQST0093, FOER0000, FOAR0001, FOAR0002,
  FOCA0001, FOCA0002, FOCA0003, FOCA0005,
  FOCA0006, FOCH0001, FOCH0002, FOCH0003,
  FOCH0004, FODC0001, FODC0002, FODC0003,
  FODC0004, FODC0005, FODT0001, FODT0002,
  FODT0003, FONS0004, FONS0005, FORG0001,
  FORG0002, FORG0003, FORG0004, FORG0005,
  FORG0006, FORG0008, FORG0009, FORX0001,
  FORX0002, FORX0003, FORX0004, FOTY0012,
  SENR0001, SERE0003, SEPM0004, SERE0005,
  SERE0006, SESU0007, SERE0008, SEPM0009,
  SEPM0010, SESU0011, SERE0012, SESU0013,
  SERE0014, SERE0015, SEPM0016, XTSE0010,
  XTSE0020, XTSE0080, XTSE0090, XTSE0110,
  XTSE0120, XTSE0125, XTSE0130, XTSE0150,
  XTSE0165, XTSE0170, XTSE0180, XTSE0190,
  XTSE0200, XTSE0210, XTSE0215, XTSE0220,
  XTSE0260, XTSE0265, XTSE0280, XTSE0340,
  XTSE0350, XTSE0370, XTSE0500, XTSE0530,
  XTSE0550, XTSE0580, XTSE0620, XTSE0630,
  XTSE0650, XTSE0660, XTSE0670, XTSE0680,
  XTSE0690, XTSE0710, XTSE0720, XTSE0740,
  XTSE0760, XTSE0770, XTSE0805, XTSE0808,
  XTSE0809, XTSE0810, XTSE0812, XTSE0840,
  XTSE0870, XTSE0880, XTSE0910, XTSE0940,
  XTTE0950, XTSE0975, XTSE1015, XTSE1017,
  XTSE1040, XTSE1060, XTSE1070, XTSE1080,
  XTSE1090, XTSE1130, XTSE1205, XTSE1210,
  XTSE1220, XTSE1290, XTSE1295, XTSE1300,
  XTSE1430, XTSE1505, XTSE1520, XTSE1530,
  XTSE1560, XTSE1570, XTSE1580, XTSE1590,
  XTSE1600, XTSE1650, XTSE1660, XTTE0505,
  XTTE0510, XTTE0520, XTTE0570, XTTE0590,
  XTTE0600, XTTE0780, XTTE0790, XTTE0990,
  XTTE1000, XTTE1020, XTTE1100, XTTE1120,
  XTTE1510, XTTE1512, XTTE1515, XTTE1540,
  XTTE1545, XTTE1550, XTTE1555, XTDE0030,
  XTDE0040, XTDE0045, XTDE0047, XTDE0050,
  XTDE0060, XTDE0160, XTRE0270, XTDE0290,
  XTDE0410, XTDE0420, XTDE0430, XTDE0440,
  XTDE0485, XTRE0540, XTDE0560, XTDE0610,
  XTDE0640, XTDE0700, XTRE0795, XTDE0820,
  XTDE0830, XTDE0835, XTDE0850, XTDE0855,
  XTDE0860, XTDE0865, XTDE0890, XTDE0905,
  XTDE0920, XTDE0925, XTDE0930, XTDE0980,
  XTDE1030, XTDE1035, XTDE1110, XTDE1140,
  XTDE1145, XTDE1150, XTRE1160, XTDE1170,
  XTDE1190, XTDE1200, XTDE1260, XTDE1270,
  XTDE1280, XTDE1310, XTDE1340, XTDE1350,
  XTDE1360, XTDE1370, XTDE1380, XTDE1390,
  XTMM9000, XTDE1400, XTDE1420, XTDE1425,
  XTDE1428, XTDE1440, XTDE1450, XTDE1460,
  XTDE1480, XTDE1490, XTRE1495, XTRE1500,
  XTRE1620, XTRE1630, XTDE1665
}
 
typedef QHash< const SourceLocationReflection *, QSourceLocationLocationHash
 
typedef QExplicitlySharedDataPointer< ReportContextPtr
 

Public Functions

virtual void addLocation (const SourceLocationReflection *const reflection, const QSourceLocation &location)=0
 Adds location for reflection. More...
 
virtual VariableSlotID allocateRangeSlot ()=0
 
virtual QUrl baseURI () const =0
 
virtual BoundarySpacePolicy boundarySpacePolicy () const =0
 
virtual bool compatModeEnabled () const =0
 
virtual ConstructionMode constructionMode () const =0
 
virtual ItemType::Ptr contextItemType () const =0
 The static type of the context item. More...
 
virtual StaticContext::Ptr copy () const =0
 
virtual ItemType::Ptr currentItemType () const =0
 The static type of the current item, as returned by fn:current(). More...
 
virtual VariableSlotID currentRangeSlot () const =0
 
virtual QUrl defaultCollation () const =0
 
virtual QString defaultElementNamespace () const =0
 
virtual QString defaultFunctionNamespace () const =0
 
virtual QExplicitlySharedDataPointer< DynamicContextdynamicContext () const =0
 
virtual ExternalVariableLoader::Ptr externalVariableLoader () const =0
 
virtual QExplicitlySharedDataPointer< FunctionFactoryfunctionSignatures () const =0
 
virtual InheritMode inheritMode () const =0
 
virtual NamePool::Ptr namePool () const =0
 
virtual NamespaceResolver::Ptr namespaceBindings () const =0
 
virtual OrderingEmptySequence orderingEmptySequence () const =0
 
virtual OrderingMode orderingMode () const =0
 
virtual PreserveMode preserveMode () const =0
 
virtual ResourceLoader::Ptr resourceLoader () const =0
 
virtual QExplicitlySharedDataPointer< SchemaTypeFactoryschemaDefinitions () const =0
 
virtual void setBaseURI (const QUrl &uri)=0
 
virtual void setBoundarySpacePolicy (const BoundarySpacePolicy policy)=0
 
virtual void setCompatModeEnabled (const bool newVal)=0
 
virtual void setConstructionMode (const ConstructionMode mode)=0
 
virtual void setDefaultCollation (const QUrl &uri)=0
 
virtual void setDefaultElementNamespace (const QString &ns)=0
 
virtual void setDefaultFunctionNamespace (const QString &ns)=0
 
virtual void setInheritMode (const InheritMode mode)=0
 
virtual void setNamespaceBindings (const NamespaceResolver::Ptr &)=0
 
virtual void setOrderingEmptySequence (const OrderingEmptySequence ordering)=0
 
virtual void setOrderingMode (const OrderingMode mode)=0
 
virtual void setPreserveMode (const PreserveMode mode)=0
 
virtual LocationHash sourceLocations () const =0
 Returns a hash of the contained locations. More...
 
 StaticContext ()
 
void wrapExpressionWith (const SourceLocationReflection *const existingNode, const QExplicitlySharedDataPointer< Expression > &newNode)
 Ensures source locations are handled in such a manner that existingNode wraps newNode. More...
 
virtual ~StaticContext ()
 
- Public Functions inherited from QPatternist::ReportContext
void error (const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
 
void error (const QString &message, const ReportContext::ErrorCode errorCode, const SourceLocationReflection *const reflection)
 
void error (const QString &message, const QXmlName qName, const SourceLocationReflection *const r)
 
virtual QSourceLocation locationFor (const SourceLocationReflection *const reflection) const =0
 Returns the source location applying for reflection. More...
 
virtual QAbstractMessageHandlermessageHandler () const =0
 
 ReportContext ()
 Default constructors. More...
 
QUrl resolveURI (const QUrl &relative, const QUrl &baseURI) const
 
virtual const QAbstractUriResolveruriResolver () const =0
 The URI resolver in use. More...
 
void warning (const QString &message, const QSourceLocation &sourceLocation=QSourceLocation())
 
virtual ~ReportContext ()
 
- 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...
 

Additional Inherited Members

- Static Public Functions inherited from QPatternist::ReportContext
static QString codeFromURI (const QString &typeURI, QString &uri)
 
static QString codeToString (const ReportContext::ErrorCode errorCode)
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Carries information and facilities used at compilation time.

A representation of the Static Context in XPath 2.0. The Static Context contains information which doesn't change and is the "outer scope" of the expression. It provides for example a base URI the expression can relate to and what functions and variables that are available for the expression.

See also
XML Path Language (XPath) 2.0, 2.1.1 Static Context
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 88 of file qstaticcontext_p.h.

Typedefs

◆ Ptr

A smart pointer wrapping StaticContext instances.

Definition at line 94 of file qstaticcontext_p.h.

Enumerations

◆ BoundarySpacePolicy

◆ ConstructionMode

◆ InheritMode

Enumerator
Inherit 
NoInherit 

Definition at line 144 of file qstaticcontext_p.h.

◆ OrderingEmptySequence

◆ OrderingMode

◆ PreserveMode

Enumerator
Preserve 
NoPreserve 

Definition at line 150 of file qstaticcontext_p.h.

Constructors and Destructors

◆ StaticContext()

QPatternist::StaticContext::StaticContext ( )
inline

Definition at line 156 of file qstaticcontext_p.h.

157  {
158  }

◆ ~StaticContext()

StaticContext::~StaticContext ( )
virtual

Definition at line 51 of file qstaticcontext.cpp.

Referenced by StaticContext().

52 {
53 }

Functions

◆ addLocation()

virtual void QPatternist::StaticContext::addLocation ( const SourceLocationReflection *const  reflection,
const QSourceLocation location 
)
pure virtual

◆ allocateRangeSlot()

virtual VariableSlotID QPatternist::StaticContext::allocateRangeSlot ( )
pure virtual

◆ baseURI()

virtual QUrl QPatternist::StaticContext::baseURI ( ) const
pure virtual

◆ boundarySpacePolicy()

virtual BoundarySpacePolicy QPatternist::StaticContext::boundarySpacePolicy ( ) const
pure virtual

◆ compatModeEnabled()

virtual bool QPatternist::StaticContext::compatModeEnabled ( ) const
pure virtual

◆ constructionMode()

virtual ConstructionMode QPatternist::StaticContext::constructionMode ( ) const
pure virtual

◆ contextItemType()

virtual ItemType::Ptr QPatternist::StaticContext::contextItemType ( ) const
pure virtual

◆ copy()

virtual StaticContext::Ptr QPatternist::StaticContext::copy ( ) const
pure virtual

Copies this StaticContext and returns the copy.

The copy and original must not be independent. Since the StaticContext is modified during the compilation process, the copy must be independent from the original to the degree that is required for the subclass in question.

Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.

Referenced by QPatternist::DelegatingStaticContext::copy(), and StaticContext().

◆ currentItemType()

virtual ItemType::Ptr QPatternist::StaticContext::currentItemType ( ) const
pure virtual

◆ currentRangeSlot()

virtual VariableSlotID QPatternist::StaticContext::currentRangeSlot ( ) const
pure virtual

◆ defaultCollation()

virtual QUrl QPatternist::StaticContext::defaultCollation ( ) const
pure virtual
Returns
the URI identifying the default collation. The function is responsible for ensuring a collation is always returned. If a collation is not provided by the user or the host language in the context, the Unicode codepoint URI should be returned.

Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.

Referenced by QPatternist::DelegatingStaticContext::defaultCollation(), StaticContext(), and QPatternist::DefaultCollationFN::typeCheck().

◆ defaultElementNamespace()

virtual QString QPatternist::StaticContext::defaultElementNamespace ( ) const
pure virtual

◆ defaultFunctionNamespace()

virtual QString QPatternist::StaticContext::defaultFunctionNamespace ( ) const
pure virtual

◆ dynamicContext()

virtual QExplicitlySharedDataPointer<DynamicContext> QPatternist::StaticContext::dynamicContext ( ) const
pure virtual

◆ externalVariableLoader()

virtual ExternalVariableLoader::Ptr QPatternist::StaticContext::externalVariableLoader ( ) const
pure virtual

◆ functionSignatures()

virtual QExplicitlySharedDataPointer<FunctionFactory> QPatternist::StaticContext::functionSignatures ( ) const
pure virtual

◆ inheritMode()

virtual InheritMode QPatternist::StaticContext::inheritMode ( ) const
pure virtual

◆ namePool()

virtual NamePool::Ptr QPatternist::StaticContext::namePool ( ) const
pure virtual

◆ namespaceBindings()

virtual NamespaceResolver::Ptr QPatternist::StaticContext::namespaceBindings ( ) const
pure virtual

◆ orderingEmptySequence()

virtual OrderingEmptySequence QPatternist::StaticContext::orderingEmptySequence ( ) const
pure virtual

◆ orderingMode()

virtual OrderingMode QPatternist::StaticContext::orderingMode ( ) const
pure virtual

◆ preserveMode()

virtual PreserveMode QPatternist::StaticContext::preserveMode ( ) const
pure virtual

◆ resourceLoader()

virtual ResourceLoader::Ptr QPatternist::StaticContext::resourceLoader ( ) const
pure virtual

◆ schemaDefinitions()

virtual QExplicitlySharedDataPointer<SchemaTypeFactory> QPatternist::StaticContext::schemaDefinitions ( ) const
pure virtual

◆ setBaseURI()

virtual void QPatternist::StaticContext::setBaseURI ( const QUrl uri)
pure virtual

◆ setBoundarySpacePolicy()

virtual void QPatternist::StaticContext::setBoundarySpacePolicy ( const BoundarySpacePolicy  policy)
pure virtual

◆ setCompatModeEnabled()

virtual void QPatternist::StaticContext::setCompatModeEnabled ( const bool  newVal)
pure virtual

◆ setConstructionMode()

virtual void QPatternist::StaticContext::setConstructionMode ( const ConstructionMode  mode)
pure virtual

◆ setDefaultCollation()

virtual void QPatternist::StaticContext::setDefaultCollation ( const QUrl uri)
pure virtual

◆ setDefaultElementNamespace()

virtual void QPatternist::StaticContext::setDefaultElementNamespace ( const QString ns)
pure virtual

◆ setDefaultFunctionNamespace()

virtual void QPatternist::StaticContext::setDefaultFunctionNamespace ( const QString ns)
pure virtual

◆ setInheritMode()

virtual void QPatternist::StaticContext::setInheritMode ( const InheritMode  mode)
pure virtual

◆ setNamespaceBindings()

virtual void QPatternist::StaticContext::setNamespaceBindings ( const NamespaceResolver::Ptr )
pure virtual

◆ setOrderingEmptySequence()

virtual void QPatternist::StaticContext::setOrderingEmptySequence ( const OrderingEmptySequence  ordering)
pure virtual

◆ setOrderingMode()

virtual void QPatternist::StaticContext::setOrderingMode ( const OrderingMode  mode)
pure virtual

◆ setPreserveMode()

virtual void QPatternist::StaticContext::setPreserveMode ( const PreserveMode  mode)
pure virtual

◆ sourceLocations()

virtual LocationHash QPatternist::StaticContext::sourceLocations ( ) const
pure virtual

Returns a hash of the contained locations.

The key is the address for the expression, and the value is its location. Note that the key cannot be dereferenced, there's no guarantee the Expression is in scope. The key is merely an identifier.

Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.

Referenced by QPatternist::DelegatingStaticContext::sourceLocations(), and StaticContext().

◆ wrapExpressionWith()

void StaticContext::wrapExpressionWith ( const SourceLocationReflection *const  existingNode,
const QExplicitlySharedDataPointer< Expression > &  newNode 
)

Ensures source locations are handled in such a manner that existingNode wraps newNode.

Ensures that the source locations for existingNode, applies to newNode.

Definition at line 55 of file qstaticcontext.cpp.

Referenced by QPatternist::EmptySequence::create(), QPatternist::ByIDCreator::create(), StaticContext(), QPatternist::FunctionCall::typeCheck(), QPatternist::IdFN::typeCheck(), QPatternist::TypeChecker::verifyType(), and QPatternist::NodeSortExpression::wrapAround().

57 {
58  addLocation(newNode.data(), locationFor(existingNode));
59 }
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
virtual QSourceLocation locationFor(const SourceLocationReflection *const reflection) const =0
Returns the source location applying for reflection.
virtual void addLocation(const SourceLocationReflection *const reflection, const QSourceLocation &location)=0
Adds location for reflection.

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