Qt 4.8
|
Carries information and facilities used at compilation time. More...
#include <qstaticcontext_p.h>
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< DynamicContext > | dynamicContext () const =0 |
virtual ExternalVariableLoader::Ptr | externalVariableLoader () const =0 |
virtual QExplicitlySharedDataPointer< FunctionFactory > | functionSignatures () 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< SchemaTypeFactory > | schemaDefinitions () 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 QAbstractMessageHandler * | messageHandler () const =0 |
ReportContext () | |
Default constructors. More... | |
QUrl | resolveURI (const QUrl &relative, const QUrl &baseURI) const |
virtual const QAbstractUriResolver * | uriResolver () 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 |
Related Functions inherited from QPatternist::ReportContext | |
typedef bool | Exception |
This is the class type that is being thrown when a query error occur. More... | |
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.
Definition at line 88 of file qstaticcontext_p.h.
A smart pointer wrapping StaticContext instances.
Definition at line 94 of file qstaticcontext_p.h.
Enumerator | |
---|---|
BSPPreserve | |
BSPStrip |
Definition at line 102 of file qstaticcontext_p.h.
Enumerator | |
---|---|
CMPreserve | |
CMStrip |
Definition at line 114 of file qstaticcontext_p.h.
Enumerator | |
---|---|
Greatest | |
Least |
Definition at line 138 of file qstaticcontext_p.h.
Enumerator | |
---|---|
Ordered | |
Unordered |
Definition at line 126 of file qstaticcontext_p.h.
|
inline |
Definition at line 156 of file qstaticcontext_p.h.
|
virtual |
|
pure virtual |
Adds location
for reflection
.
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::addLocation(), StaticContext(), QPatternist::DocumentFN::typeCheck(), and wrapExpressionWith().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::allocateRangeSlot(), StaticContext(), and QPatternist::DocumentFN::typeCheck().
|
pure virtual |
The base URI of the context. Typically, this is the base URI if of the element that contained the expression.
The base URI is in this implementation is never undefined, but is always valid.
Implemented in QPatternist::GenericStaticContext, QPatternist::DelegatingStaticContext, and QPatternist::StaticBaseURIContext.
Referenced by QPatternist::DelegatingStaticContext::baseURI(), StaticContext(), QPatternist::ResolveURIFN::typeCheck(), QPatternist::StaticBaseURIStore::typeCheck(), QPatternist::DocumentConstructor::typeCheck(), QPatternist::ElementConstructor::typeCheck(), and QPatternist::StaticBaseURIFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::boundarySpacePolicy(), and StaticContext().
|
pure virtual |
Determine whether Backwards Compatible Mode is used.
Implemented in QPatternist::GenericStaticContext, QPatternist::DelegatingStaticContext, and QPatternist::StaticCompatibilityContext.
Referenced by QPatternist::DelegatingStaticContext::compatModeEnabled(), StaticContext(), QPatternist::ArithmeticExpression::typeCheck(), QPatternist::CardinalityVerifier::verifyCardinality(), and QPatternist::TypeChecker::verifyType().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::constructionMode(), and StaticContext().
|
pure virtual |
The static type of the context item.
Different StaticContext instances are used for different nodes in the AST to properly reflect the type of the focus. If the focus is undefined, this function must return null
.
Implemented in QPatternist::GenericStaticContext, QPatternist::DelegatingStaticContext, and QPatternist::StaticFocusContext.
Referenced by QPatternist::ContextItem::compress(), QPatternist::DelegatingStaticContext::contextItemType(), QPatternist::CurrentItemStore::newStaticContext(), StaticContext(), QPatternist::ContextItem::typeCheck(), and QPatternist::TypeChecker::verifyType().
|
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().
|
pure virtual |
The static type of the current item, as returned by fn:current()
.
Implemented in QPatternist::GenericStaticContext, QPatternist::DelegatingStaticContext, and QPatternist::StaticCurrentContext.
Referenced by QPatternist::CurrentFN::compress(), QPatternist::DelegatingStaticContext::currentItemType(), StaticContext(), and QPatternist::CurrentFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::currentRangeSlot(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::defaultCollation(), StaticContext(), and QPatternist::DefaultCollationFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::defaultElementNamespace(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::defaultFunctionNamespace(), StaticContext(), and QPatternist::FunctionAvailableFN::typeCheck().
|
pure virtual |
This is the DynamicContext that is used for pre-evaluation at compilation time, const-folding at the static stage.
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::OrExpression::compress(), QPatternist::IfThenClause::compress(), QPatternist::AndExpression::compress(), QPatternist::ReplaceFN::compress(), QPatternist::PatternPlatform::compress(), QPatternist::NormalizeUnicodeFN::compress(), QPatternist::Expression::constantPropagate(), QPatternist::DelegatingStaticContext::dynamicContext(), StaticContext(), and QPatternist::DocFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::externalVariableLoader(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::ByIDCreator::create(), QPatternist::DelegatingStaticContext::functionSignatures(), StaticContext(), QPatternist::FunctionAvailableFN::typeCheck(), QPatternist::DocumentFN::typeCheck(), and QPatternist::TypeChecker::verifyType().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::inheritMode(), and StaticContext().
|
pure virtual |
Implements QPatternist::ReportContext.
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::CastAs::castToQName(), QPatternist::GenericPredicate::create(), QPatternist::AbstractFunctionFactory::createFunctionCall(), QPatternist::ParserContext::finalizePushedVariable(), QPatternist::DelegatingStaticContext::namePool(), QPatternist::QNameConstructor::namespaceForPrefix(), QPatternist::TypeChecker::promotionPossible(), StaticContext(), QPatternist::FunctionAvailableFN::typeCheck(), QPatternist::AddingAggregate::typeCheck(), QPatternist::CastAs::typeCheck(), QPatternist::AvgFN::typeCheck(), QPatternist::SumFN::typeCheck(), QPatternist::AbstractFunctionFactory::verifyArity(), and QPatternist::TypeChecker::verifyType().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, QPatternist::StaticNamespaceContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::CastAs::castToQName(), QPatternist::DelegatingStaticContext::namespaceBindings(), QPatternist::QNameConstructor::namespaceForPrefix(), QPatternist::ParserContext::ParserContext(), StaticContext(), QPatternist::StaticNamespacesContainer::typeCheck(), and QPatternist::ElementConstructor::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::orderingEmptySequence(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::orderingMode(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::preserveMode(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::resourceLoader(), StaticContext(), and QPatternist::DocFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::schemaDefinitions(), StaticContext(), and QPatternist::TypeAvailableFN::typeCheck().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setBaseURI(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setBoundarySpacePolicy(), and StaticContext().
|
pure virtual |
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setConstructionMode(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setDefaultCollation(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setDefaultElementNamespace(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setDefaultFunctionNamespace(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setInheritMode(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::GenericStaticContext, and QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setNamespaceBindings(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setOrderingEmptySequence(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setOrderingMode(), and StaticContext().
|
pure virtual |
Implemented in QPatternist::DelegatingStaticContext.
Referenced by QPatternist::DelegatingStaticContext::setPreserveMode(), and StaticContext().
|
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().
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().