Qt 4.8
|
The central entry point for compiling expressions. More...
#include <qexpressionfactory_p.h>
Public Types | |
enum | CompilationStage { QueryBodyInitial = 1, QueryBodyTypeCheck = 1 << 1, QueryBodyCompression = 1 << 2, UserFunctionTypeCheck = 1 << 3, UserFunctionCompression = 1 << 4, GlobalVariableTypeCheck = 1 << 5 } |
typedef QExplicitlySharedDataPointer< ExpressionFactory > | Ptr |
Public Functions | |
virtual Expression::Ptr | createExpression (const QString &expr, const StaticContext::Ptr &context, const QXmlQuery::QueryLanguage lang, const SequenceType::Ptr &requiredType, const QUrl &queryURI, const QXmlName &initialTemplateName) |
virtual Expression::Ptr | createExpression (QIODevice *const device, const StaticContext::Ptr &context, const QXmlQuery::QueryLanguage lang, const SequenceType::Ptr &requiredType, const QUrl &queryURI, const QXmlName &initialTemplateName) |
ExpressionFactory () | |
This constructor cannot be synthesized since we use the Q_DISABLE_COPY macro. More... | |
virtual | ~ExpressionFactory () |
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... | |
Static Public Functions | |
static void | registerLastPath (const Expression::Ptr &operand) |
Protected Types | |
enum | TemplateCompilationStage { TemplateInitial = 1, TemplateTypeCheck = 1 << 1, TemplateCompress = 1 << 2 } |
Protected Functions | |
Expression::Ptr | createExpression (const Tokenizer::Ptr &tokenizer, const StaticContext::Ptr &context, const QXmlQuery::QueryLanguage lang, const SequenceType::Ptr &requiredType, const QUrl &queryURI, const QXmlName &initialTemplateName) |
virtual void | processNamedTemplate (const QXmlName &name, const Expression::Ptr &tree, const TemplateCompilationStage stage) |
virtual void | processTemplateRule (const Expression::Ptr &body, const TemplatePattern::Ptr &pattern, const QXmlName &mode, const TemplateCompilationStage stage) |
virtual void | processTreePass (const Expression::Ptr &tree, const CompilationStage stage) |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
The central entry point for compiling expressions.
Definition at line 77 of file qexpressionfactory_p.h.
Definition at line 80 of file qexpressionfactory_p.h.
Enumerator | |
---|---|
QueryBodyInitial | |
QueryBodyTypeCheck | |
QueryBodyCompression | |
UserFunctionTypeCheck | |
UserFunctionCompression | |
GlobalVariableTypeCheck |
Definition at line 94 of file qexpressionfactory_p.h.
|
protected |
Enumerator | |
---|---|
TemplateInitial | |
TemplateTypeCheck | |
TemplateCompress |
Definition at line 142 of file qexpressionfactory_p.h.
|
inline |
This constructor cannot be synthesized since we use the Q_DISABLE_COPY macro.
Definition at line 86 of file qexpressionfactory_p.h.
|
inlinevirtual |
Definition at line 90 of file qexpressionfactory_p.h.
|
virtual |
Creates a compiled representation of the XPath expression expr
, with Static Context information supplied via context
. This is for example whether the expression is an XPath 1.0 or XPath 2.0 expression, or what functions that are available.
requiredType
specifies what type results of the evaluating the expression must match. Passing CommonValues::ZeroOrMoreItems allows anything as result, while passing CommonSequenceTypes::EBV means anything but an Effective Boolean Value extractable result is a type error, for example.
expr
is an invalid XPath expression. It will be reported as such, but it is neverthless the caller's resonsibility to ensure that it's not that(since it is likely invalid already in the medium it was stored). Definition at line 77 of file qexpressionfactory.cpp.
|
virtual |
Definition at line 108 of file qexpressionfactory.cpp.
Referenced by createExpression().
|
protected |
Definition at line 128 of file qexpressionfactory.cpp.
|
protectedvirtual |
Definition at line 461 of file qexpressionfactory.cpp.
Referenced by createExpression().
|
protectedvirtual |
Definition at line 450 of file qexpressionfactory.cpp.
Referenced by createExpression().
|
protectedvirtual |
This function is called by createExpression() each time after a pass on the AST has been completed. Under a typical compilation this function is thus called three times: after the initial build, after the Expression::typeCheck() stage, and after Expression::compress(). tree
is the AST after each pass.
This mechanism is currently used for debugging, since it provides a way of introspecting what the compilation process do to the tree. The current implementation do nothing.
Definition at line 445 of file qexpressionfactory.cpp.
Referenced by createExpression().
|
static |
Finds the last paths of a set of paths(if any) and tells the Path so, such that it can generate the code for checking XPTY0018.
Must be called before typeCheck() is called on the operand, since the typeCheck() uses the information for type checking.
Definition at line 428 of file qexpressionfactory.cpp.
Referenced by createExpression(), and QPatternist::yyparse().