Qt 4.8
qexpressiondispatch_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_ExpressionDispatch_H
53 #define Patternist_ExpressionDispatch_H
54 
55 #include <QSharedData>
56 
57 
59 
61 
62 namespace QPatternist
63 {
64  class AndExpression;
65  class ApplyTemplate;
66  class ArgumentConverter;
67  class ArgumentReference;
68  class ArithmeticExpression;
69  class Atomizer;
70  class AttributeConstructor;
71  class AttributeNameValidator;
72  class AxisStep;
73  class CallTemplate;
74  class CardinalityVerifier;
75  class CardinalityVerifier;
76  class CastableAs;
77  class CastableAs;
78  class CastAs;
79  class CastAs;
80  class CollationChecker;
81  class CollationChecker;
82  class CombineNodes;
83  class CombineNodes;
84  class CommentConstructor;
85  class CommentConstructor;
86  class ComputedNamespaceConstructor;
87  class ContextItem;
88  class CopyOf;
89  class CurrentItemStore;
90  class DocumentConstructor;
91  class DynamicContextStore;
92  class EBVExtractor;
93  class ElementConstructor;
94  class EmptySequence;
95  class ExpressionSequence;
96  class ExpressionVariableReference;
97  class ExternalVariableReference;
98  class FirstItemPredicate;
99  class ForClause;
100  class FunctionCall;
101  class GeneralComparison;
102  class GenericPredicate;
103  class IfThenClause;
104  class InstanceOf;
105  class ItemVerifier;
106  class LetClause;
107  class Literal;
108  class LiteralSequence;
109  class NamespaceConstructor;
110  class NCNameConstructor;
111  class NodeComparison;
112  class NodeSortExpression;
113  class OrderBy;
114  class OrExpression;
115  class ParentNodeAxis;
116  class Path;
117  class PositionalVariableReference;
118  class ProcessingInstructionConstructor;
119  class QNameConstructor;
120  class QuantifiedExpression;
121  class RangeExpression;
122  class RangeVariableReference;
123  class ReturnOrderBy;
124  class SimpleContentConstructor;
125  class StaticBaseURIStore;
126  class StaticCompatibilityStore;
127  class TemplateParameterReference;
128  class TextNodeConstructor;
129  class TreatAs;
130  class TruthPredicate;
131  class UnresolvedVariableReference;
132  class UntypedAtomicConverter;
133  class UserFunctionCallsite;
134  class ValidationError;
135  class ValueComparison;
136  template<bool IsForGlobal> class EvaluationCache;
137 
149  {
150  public:
154  };
155 
161  {
162  public:
164  virtual ~ExpressionVisitor() {}
165 
166  virtual ExpressionVisitorResult::Ptr visit(const AndExpression *) const = 0;
167  virtual ExpressionVisitorResult::Ptr visit(const ApplyTemplate *) const = 0;
168  virtual ExpressionVisitorResult::Ptr visit(const ArgumentConverter *) const = 0;
169  virtual ExpressionVisitorResult::Ptr visit(const ArgumentReference *) const = 0;
170  virtual ExpressionVisitorResult::Ptr visit(const ArithmeticExpression *) const = 0;
171  virtual ExpressionVisitorResult::Ptr visit(const Atomizer *) const = 0;
172  virtual ExpressionVisitorResult::Ptr visit(const AttributeConstructor *) const = 0;
173  virtual ExpressionVisitorResult::Ptr visit(const AttributeNameValidator *) const = 0;
174  virtual ExpressionVisitorResult::Ptr visit(const AxisStep *) const = 0;
175  virtual ExpressionVisitorResult::Ptr visit(const CallTemplate *) const = 0;
176  virtual ExpressionVisitorResult::Ptr visit(const CardinalityVerifier *) const = 0;
177  virtual ExpressionVisitorResult::Ptr visit(const CastableAs *) const = 0;
178  virtual ExpressionVisitorResult::Ptr visit(const CastAs *) const = 0;
179  virtual ExpressionVisitorResult::Ptr visit(const CollationChecker *) const = 0;
180  virtual ExpressionVisitorResult::Ptr visit(const CombineNodes *) const = 0;
181  virtual ExpressionVisitorResult::Ptr visit(const CommentConstructor *) const = 0;
182  virtual ExpressionVisitorResult::Ptr visit(const ComputedNamespaceConstructor *) const = 0;
183  virtual ExpressionVisitorResult::Ptr visit(const ContextItem *) const = 0;
184  virtual ExpressionVisitorResult::Ptr visit(const CopyOf *) const = 0;
185  virtual ExpressionVisitorResult::Ptr visit(const CurrentItemStore *) const = 0;
186  virtual ExpressionVisitorResult::Ptr visit(const DocumentConstructor *) const = 0;
187  virtual ExpressionVisitorResult::Ptr visit(const DynamicContextStore *) const = 0;
188  virtual ExpressionVisitorResult::Ptr visit(const EBVExtractor *) const = 0;
189  virtual ExpressionVisitorResult::Ptr visit(const ElementConstructor *) const = 0;
190  virtual ExpressionVisitorResult::Ptr visit(const EmptySequence *) const = 0;
191  virtual ExpressionVisitorResult::Ptr visit(const EvaluationCache<false> *) const = 0;
192  virtual ExpressionVisitorResult::Ptr visit(const EvaluationCache<true> *) const = 0;
193  virtual ExpressionVisitorResult::Ptr visit(const ExpressionSequence *) const = 0;
194  virtual ExpressionVisitorResult::Ptr visit(const ExpressionVariableReference *) const = 0;
195  virtual ExpressionVisitorResult::Ptr visit(const ExternalVariableReference *) const = 0;
196  virtual ExpressionVisitorResult::Ptr visit(const FirstItemPredicate *) const = 0;
197  virtual ExpressionVisitorResult::Ptr visit(const ForClause *) const = 0;
198  virtual ExpressionVisitorResult::Ptr visit(const FunctionCall *) const = 0;
199  virtual ExpressionVisitorResult::Ptr visit(const GeneralComparison *) const = 0;
200  virtual ExpressionVisitorResult::Ptr visit(const GenericPredicate *) const = 0;
201  virtual ExpressionVisitorResult::Ptr visit(const IfThenClause *) const = 0;
202  virtual ExpressionVisitorResult::Ptr visit(const InstanceOf *) const = 0;
203  virtual ExpressionVisitorResult::Ptr visit(const ItemVerifier *) const = 0;
204  virtual ExpressionVisitorResult::Ptr visit(const LetClause *) const = 0;
205  virtual ExpressionVisitorResult::Ptr visit(const Literal *) const = 0;
206  virtual ExpressionVisitorResult::Ptr visit(const LiteralSequence *) const = 0;
207  virtual ExpressionVisitorResult::Ptr visit(const NamespaceConstructor *) const = 0;
208  virtual ExpressionVisitorResult::Ptr visit(const NCNameConstructor *) const = 0;
209  virtual ExpressionVisitorResult::Ptr visit(const NodeComparison *) const = 0;
210  virtual ExpressionVisitorResult::Ptr visit(const NodeSortExpression *) const = 0;
211  virtual ExpressionVisitorResult::Ptr visit(const OrderBy *) const = 0;
212  virtual ExpressionVisitorResult::Ptr visit(const OrExpression *) const = 0;
213  virtual ExpressionVisitorResult::Ptr visit(const ParentNodeAxis *) const = 0;
214  virtual ExpressionVisitorResult::Ptr visit(const Path *) const = 0;
215  virtual ExpressionVisitorResult::Ptr visit(const PositionalVariableReference *) const = 0;
216  virtual ExpressionVisitorResult::Ptr visit(const ProcessingInstructionConstructor *) const = 0;
217  virtual ExpressionVisitorResult::Ptr visit(const QNameConstructor *) const = 0;
218  virtual ExpressionVisitorResult::Ptr visit(const QuantifiedExpression *) const = 0;
219  virtual ExpressionVisitorResult::Ptr visit(const RangeExpression *) const = 0;
220  virtual ExpressionVisitorResult::Ptr visit(const RangeVariableReference *) const = 0;
221  virtual ExpressionVisitorResult::Ptr visit(const ReturnOrderBy *) const = 0;
222  virtual ExpressionVisitorResult::Ptr visit(const SimpleContentConstructor *) const = 0;
223  virtual ExpressionVisitorResult::Ptr visit(const StaticBaseURIStore *) const = 0;
224  virtual ExpressionVisitorResult::Ptr visit(const StaticCompatibilityStore *) const = 0;
225  virtual ExpressionVisitorResult::Ptr visit(const TemplateParameterReference *) const = 0;
226  virtual ExpressionVisitorResult::Ptr visit(const TextNodeConstructor *) const = 0;
227  virtual ExpressionVisitorResult::Ptr visit(const TreatAs *) const = 0;
228  virtual ExpressionVisitorResult::Ptr visit(const TruthPredicate *) const = 0;
229  virtual ExpressionVisitorResult::Ptr visit(const UnresolvedVariableReference *) const = 0;
230  virtual ExpressionVisitorResult::Ptr visit(const UntypedAtomicConverter *) const = 0;
231  virtual ExpressionVisitorResult::Ptr visit(const UserFunctionCallsite *) const = 0;
232  virtual ExpressionVisitorResult::Ptr visit(const ValidationError *) const = 0;
233  virtual ExpressionVisitorResult::Ptr visit(const ValueComparison *) const = 0;
234  };
235 }
236 
238 
240 
241 #endif
Base class for implementations of builtin functions.
Constructs a text node. This covers both computed and directly constructed text nodes.
Implements XPath 2.0&#39;s quantification expressions some and every.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
Constructs an element node. This covers both computed and directly constructed element nodes...
A compile time only AST node that changes the static base URI, used when xml:base attributes appears...
Verifies that the sequence an Expression evaluates to conforms to a Cardinality.
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
Used for signalling casting errors.
Implements XPath 2.0&#39;s instance of expression.
Definition: qinstanceof_p.h:72
Together with OrderBy, it implements XQuery 1.0&#39;s order by expression.
Creates a DynamicContext which provides the focus item for the function fn:current().
Implements XPath 2.0&#39;s castable as expression.
Definition: qcastableas_p.h:73
Implements the path expression, containing two steps, such as in html/body.
Definition: qpath_p.h:72
A step in a path expression that with an axis and a node test evaluates to a sequence of nodes from t...
Definition: qaxisstep_p.h:71
Constructs an element node. This covers both computed and directly constructed element nodes...
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
Implements XPath 2.0&#39;s cast as expression.
Definition: qcastas_p.h:79
Constructs a namespace on an element, and naturally only appears as a child of ElementConstructor.
Implements XPath 2.0&#39;s for expression.
Definition: qforclause_p.h:72
Ensures the lexical space of the string value of the Item returned from its child Expression is an NC...
Constructs a namespace on an element, and naturally only appears as a child of ElementConstructor.
Implements the node comparison operators >>, <<, and is.
Constructs an element node. This covers both computed and directly constructed element nodes...
De-duplicates and sorts in document order the content that its operand returns.
Definition: qnodesort_p.h:70
Does node copying in a parameterized way, in order to deal with namespace preservation/inheritance.
Definition: qcopyof_p.h:75
Constructs simple content as specified for attributes in direct element constructors in XQuery...
Implements XPath 2.0&#39;s to expression.
Performs the sorting by being a parent to ForClause.
Definition: qorderby_p.h:76
Implements XPath 2.0&#39;s conditional expression if([expr]) then [expr] else [expr]. ...
Implements XPath 2.0&#39;s general comparions, such as the = operator.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Implements XPath 2.0&#39;s operators for combining node sequences: union, intersect and except...
Creates an xs:QName value from a lexical QName using statically known namespace bindings.
Implements arithmetics, such as multiplication and subtraction.
Checks that its operand evaluates to a supported string collation.
A Path object defines a path for use by PathView .
The namespace for the internal API of QtXmlPatterns.
Implements the context item, the dot: ..
Verifies that the items in a sequence an Expression evaluates is of a certain ItemType.
Implements the value instance of empty sequence: ().
QExplicitlySharedDataPointer< ExpressionVisitor > Ptr
A predicate that can handle all kinds of predicates and is therefore not very efficient, but can cope with all the tricky scenarios.
A reference to an argument declared in a UserFunction.
Corresponds to the expression parent::node().
A compile time only AST node that changes the backwareds compatibility mode. Used for XSL-T 2...
Houses an AtomicValue, making it available as an Expression.
Definition: qliteral_p.h:74
Performs atomization. Effectively, it is an implementation of the fn:data() function.
Definition: qatomizer_p.h:76
UntypedAtomicConverter for ArgumentReference, if needed.
A reference to a variable declared with declare variable or let.
Represents a let-clause, but is only used at compile time.
Definition: qletclause_p.h:78
Constructs a text node. This covers both computed and directly constructed text nodes.
The QSharedData class is a base class for shared data objects.
Definition: qshareddata.h:56
A reference to a variable declared with for or a quantification expression, but not for instance a le...
Evaluates to the same result as its operand, but ensures the operand is evaluated once even if this E...
Compile time only AST-node which is a marker for variable references whose declaration has not yet ap...
Constructs a comment node. This covers both computed and directly constructed text nodes...
A reference to an at variable, declared with the for-part in XQuery&#39;s FLWOR expression.
Calculates the Effective Boolean Value of its operand.
Casts every item in a sequence obtained from evaluating an Expression, to a requested atomic type...
A predicate which is optimized for filter expressions that are of type xs:boolean.
When combined with other components, implements xsl:apply-templates.
Implements the comma(",") operator, the sequence constructor.
A reference to an external variable.
A reference to a template parameter declared with xsl:param.
Evaluates its operand with an assigned DynamicContext, not the one passed to one of the evaluation fu...
Houses a sequence of atomic values, making it available as an Expression.
Implements XPath 2.0&#39;s logical expression or.
Implements XPath 2.0 value comparions, such as the eq operator.
Ensures the lexical space of the string value of the Item returned from its child Expression is an NC...
#define QT_END_HEADER
Definition: qglobal.h:137
A predicate that always selects the first item from its sequence.
Performs a call to a UserFunction.
Implements XPath 2.0&#39;s logical expression and.
Implements XPath 2.0&#39;s treat as expression.
Definition: qtreatas_p.h:82
Implements xsl:call-template.
QExplicitlySharedDataPointer< ExpressionVisitorResult > Ptr