Qt 4.8
|
Contains data used when parsing and tokenizing. More...
#include <qparsercontext_p.h>
Public Types | |
enum | PrologDeclaration { BoundarySpaceDecl = 1, DefaultCollationDecl = 2, BaseURIDecl = 4, ConstructionDecl = 8, OrderingModeDecl = 16, EmptyOrderDecl = 32, CopyNamespacesDecl = 64, DeclareDefaultElementNamespace = 128, DeclareDefaultFunctionNamespace = 256 } |
typedef QFlags< PrologDeclaration > | PrologDeclarations |
typedef QExplicitlySharedDataPointer< ParserContext > | Ptr |
Private Types | |
enum | { InitialTemplateID = -1 } |
Contains data used when parsing and tokenizing.
When ExpressionFactory::create() is called, an instance of this class is passed to the scanner and parser. It holds all information that is needed to create the expression.
Definition at line 87 of file qparsercontext_p.h.
Definition at line 105 of file qparsercontext_p.h.
Definition at line 90 of file qparsercontext_p.h.
|
private |
Enumerator | |
---|---|
BoundarySpaceDecl | |
DefaultCollationDecl | |
BaseURIDecl | |
ConstructionDecl | |
OrderingModeDecl | |
EmptyOrderDecl | |
CopyNamespacesDecl | |
DeclareDefaultElementNamespace | |
DeclareDefaultFunctionNamespace |
Definition at line 92 of file qparsercontext_p.h.
ParserContext::ParserContext | ( | const StaticContext::Ptr & | context, |
const QXmlQuery::QueryLanguage | lang, | ||
Tokenizer *const | tokenizer | ||
) |
Constructs a ParserContext instance.
context | the static context as defined in XPath. This contain namespace bindings, error handler, and other information necessary for creating an XPath expression. |
lang | the particular XPath language sub-set that should be parsed |
tokenizer | the Tokenizer to use. |
Definition at line 54 of file qparsercontext.cpp.
|
inline |
Definition at line 234 of file qparsercontext_p.h.
Referenced by QPatternist::pushVariable().
|
inline |
Definition at line 239 of file qparsercontext_p.h.
|
inline |
Definition at line 137 of file qparsercontext_p.h.
Referenced by QPatternist::pushVariable().
|
inline |
Definition at line 144 of file qparsercontext_p.h.
Referenced by QPatternist::pushVariable().
|
inline |
Definition at line 131 of file qparsercontext_p.h.
Referenced by QPatternist::pushVariable().
|
inline |
Definition at line 347 of file qparsercontext_p.h.
|
inline |
Definition at line 224 of file qparsercontext_p.h.
|
inline |
Definition at line 219 of file qparsercontext_p.h.
|
inline |
Definition at line 384 of file qparsercontext_p.h.
void ParserContext::finalizePushedVariable | ( | const int | amount = 1 , |
const bool | shouldPop = true |
||
) |
Removes the recently pushed variables from scope. The amount of removed variables is amount
.
finalizePushedVariable() can be seen as popping the variable.
Definition at line 81 of file qparsercontext.cpp.
Referenced by templateParametersHandled().
|
inline |
Definition at line 150 of file qparsercontext_p.h.
|
inline |
Definition at line 397 of file qparsercontext_p.h.
|
inline |
Definition at line 374 of file qparsercontext_p.h.
|
inline |
Definition at line 171 of file qparsercontext_p.h.
Referenced by QPatternist::checkVariableCircularity(), QPatternist::createSimpleContent(), QPatternist::pushVariable(), and QPatternist::resolveVariable().
|
inline |
Returns the TemplateMode for modeName
or null
if the mode being asked for is #current
.
Definition at line 329 of file qparsercontext_p.h.
|
inline |
Definition at line 155 of file qparsercontext_p.h.
|
inline |
Definition at line 229 of file qparsercontext_p.h.
|
inline |
Definition at line 379 of file qparsercontext_p.h.
|
inline |
Definition at line 363 of file qparsercontext_p.h.
|
inline |
Definition at line 369 of file qparsercontext_p.h.
ImportPrecedence QPatternist::ParserContext::currentImportPrecedence |
Definition at line 395 of file qparsercontext_p.h.
QStringList QPatternist::ParserContext::declaredPrefixes |
The namespaces declared with declare namespace
.
Definition at line 163 of file qparsercontext_p.h.
VariableDeclaration::List QPatternist::ParserContext::declaredVariables |
All variables declared with declare variable
.
Definition at line 217 of file qparsercontext_p.h.
int QPatternist::ParserContext::elementConstructorDepth |
Definition at line 273 of file qparsercontext_p.h.
bool QPatternist::ParserContext::hasSecondPrologPart |
Whether any prolog declaration that must occur after the first group has been encountered.
Definition at line 283 of file qparsercontext_p.h.
bool QPatternist::ParserContext::inheritNamespacesMode |
Definition at line 286 of file qparsercontext_p.h.
Referenced by QPatternist::createCopyOf().
QXmlName QPatternist::ParserContext::initialTemplateName |
Only used in the case of XSL-T. Is the name of the initial template to call. If null, no name was provided, and regular template matching should be done.
Definition at line 190 of file qparsercontext_p.h.
QStack<bool> QPatternist::ParserContext::isBackwardsCompat |
Whether we're processing XSL-T 1.0 code.
Definition at line 405 of file qparsercontext_p.h.
Referenced by QPatternist::XSLTTokenizer::handleXSLTVersion(), and ParserContext().
bool QPatternist::ParserContext::isParsingPattern |
This is used to deal with XSL-T's exception to the node()
type, which doesn't match document nodes.
Definition at line 393 of file qparsercontext_p.h.
bool QPatternist::ParserContext::isPreviousEnclosedExpr |
This is used for handling the following obscene case:
<e>{1}{1}<\/e>
produce <e>11</e>
<e>{1, 1}<\/e>
produce <e>1 1</e>
This boolean tracks whether the previous reduction inside element content was done with an enclosed expression.
Definition at line 271 of file qparsercontext_p.h.
const QXmlQuery::QueryLanguage QPatternist::ParserContext::languageAccent |
Definition at line 183 of file qparsercontext_p.h.
Referenced by QPatternist::allowedIn(), and isXSLT().
|
private |
Definition at line 418 of file qparsercontext_p.h.
Referenced by allocateTemplateID(), and isFirstTemplate().
|
private |
Definition at line 413 of file qparsercontext_p.h.
Referenced by allocateCacheSlot(), and allocateCacheSlots().
|
private |
Definition at line 414 of file qparsercontext_p.h.
Referenced by allocateExpressionSlot(), and currentExpressionSlot().
|
private |
Definition at line 417 of file qparsercontext_p.h.
Referenced by allocateGlobalVariableSlot().
|
private |
The default is false
. If we're not parsing xsl:with-param
, hence parsing xsl:param
, the value has changed.
Definition at line 424 of file qparsercontext_p.h.
Referenced by endParsingWithParam(), isParsingWithParam(), ParserContext(), and startParsingWithParam().
|
private |
Definition at line 415 of file qparsercontext_p.h.
Referenced by allocatePositionalSlot(), and currentPositionSlot().
|
private |
Definition at line 416 of file qparsercontext_p.h.
Referenced by hasDeclaration(), and registerDeclaration().
QXmlName::NamespaceCode QPatternist::ParserContext::moduleNamespace |
The library module namespace set with declare module
.
Definition at line 253 of file qparsercontext_p.h.
QHash<QXmlName, Template::Ptr> QPatternist::ParserContext::namedTemplates |
Contains all named templates. Since named templates can also have rules, each body may also be in templateRules.
Definition at line 292 of file qparsercontext_p.h.
Referenced by QPatternist::registerNamedTemplate().
ItemType::Ptr QPatternist::ParserContext::nodeTestSource |
Definition at line 246 of file qparsercontext_p.h.
Referenced by restoreNodeTestSource().
QStack<OrderBy::Stability> QPatternist::ParserContext::orderStability |
Definition at line 277 of file qparsercontext_p.h.
bool QPatternist::ParserContext::preserveNamespacesMode |
Definition at line 285 of file qparsercontext_p.h.
Referenced by QPatternist::createCopyOf().
Expression::Ptr QPatternist::ParserContext::queryBody |
The actual expression, the Query. This member may be null
, such as in the case of an XQuery library module.
Definition at line 202 of file qparsercontext_p.h.
QStack<NamespaceResolver::Ptr> QPatternist::ParserContext::resolvers |
When a direct element constructor is processed, resolvers are created in order to carry the namespace declarations. In such case, the old resolver is pushed here.
Definition at line 260 of file qparsercontext_p.h.
Referenced by ParserContext().
QStack<bool> QPatternist::ParserContext::scanOnlyStack |
Definition at line 275 of file qparsercontext_p.h.
const StaticContext::Ptr QPatternist::ParserContext::staticContext |
Definition at line 176 of file qparsercontext_p.h.
Referenced by QPatternist::allowedIn(), QPatternist::checkVariableCircularity(), QPatternist::create(), QPatternist::createConcatFN(), QPatternist::createIdPatternPath(), QPatternist::createNumericLiteral(), QPatternist::createPatternPath(), QPatternist::createRootExpression(), finalizePushedVariable(), QPatternist::XSLTTokenizer::handleXSLTVersion(), QPatternist::pushVariable(), QPatternist::registerNamedTemplate(), QPatternist::resolveAndCheckCollation(), QPatternist::resolveVariable(), QPatternist::typeCheckTemplateBody(), QPatternist::variableUnavailable(), and QPatternist::XPatherror().
Used when parsing direct element constructors. It is used for ensuring tags are well-balanced.
Definition at line 196 of file qparsercontext_p.h.
QVector<Expression::Ptr> QPatternist::ParserContext::templateCalls |
All the xsl:call-template
instructions that we have encountered.
Definition at line 297 of file qparsercontext_p.h.
VariableDeclaration::List QPatternist::ParserContext::templateParameters |
The xsl:param
appearing inside template.
Definition at line 356 of file qparsercontext_p.h.
QHash<QXmlName, TemplateMode::Ptr> QPatternist::ParserContext::templateRules |
Contains the encountered template rules, as opposed to named templates.
The key is the name of the template mode. If it's a default constructed value, it's the default mode.
Since templates rules may also be named, each body may also be in namedTemplates.
To be specific, the values are not the templates, the values are modes, and the TemplateMode contains the patterns and bodies.
Definition at line 323 of file qparsercontext_p.h.
WithParam::Hash QPatternist::ParserContext::templateWithParams |
The xsl:with-param
appearing in template calling instruction.
Definition at line 361 of file qparsercontext_p.h.
Tokenizer* const QPatternist::ParserContext::tokenizer |
We don't store a Tokenizer::Ptr here, because then we would get a circular referencing between ParserContext and XSLTTokenizer, and hence they would never destruct.
Definition at line 182 of file qparsercontext_p.h.
Referenced by QPatternist::fromYYLTYPE(), ParserContext(), and QPatternist::XPathlex().
QStack<Expression::Ptr> QPatternist::ParserContext::typeswitchSource |
Definition at line 248 of file qparsercontext_p.h.
QMultiHash<QXmlName, Expression::Ptr> QPatternist::ParserContext::unresolvedVariableReferences |
If we're in XSL-T, and a variable reference is encountered which isn't in-scope, it's added to this hash since a global variable declaration may appear later on.
We use a multi hash, since we can encounter several references to the same variable before it's declared.
Definition at line 307 of file qparsercontext_p.h.
Referenced by QPatternist::resolveVariable().
UserFunctionCallsite::List QPatternist::ParserContext::userFunctionCallsites |
Contains all calls to user defined functions.
Definition at line 212 of file qparsercontext_p.h.
UserFunction::List QPatternist::ParserContext::userFunctions |
The user functions declared in the prolog.
Definition at line 207 of file qparsercontext_p.h.
VariableDeclaration::Stack QPatternist::ParserContext::variables |
This is a temporary stack, used for keeping variables in scope, such as for function arguments & let clauses.
Definition at line 169 of file qparsercontext_p.h.
Referenced by finalizePushedVariable(), QPatternist::pushVariable(), and QPatternist::variableByName().