1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
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.
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.
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.
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.
40 ****************************************************************************/
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.
54 * @short Contains Doxygen documentation for groups.
60 * @short The abstract syntax tree nodes that implements the builtin
61 * functions, such as @c fn:concat().
63 * @defgroup Patternist_functions Function Implementations
64 * @author Frans Englich <frans.englich@nokia.com>
68 * @short The abstract syntax tree nodes that is generated for XPath,
69 * XQuery, and XSL-T code.
71 * XPath's approach of compilation is traditional. An Abstract Syntax
72 * Tree(AST) is built, where the Expression class is the abstract base
73 * class for all kinds of implementations of expressions.
75 * What perhaps can be said to be characteristic for Patternist is that the
76 * base class, Expression, performs a lot of work, and that sub-classes
77 * declares what specific behaviors they need, which the Expression's
78 * functions then bring into action.
80 * XPath expressions often have different amount of operands. For example,
81 * the 'and' expression takes two, the context item(".") none, and the
82 * if-expression three. To help expression implementations with that, there
83 * exist the abstract EmptyContainer, SingleContainer, PairContainer,
84 * TripleContainer, and UnlimitedContainer classes for avoiding duplicating
87 * @defgroup Patternist_expressions Expressions
88 * @author Frans Englich <frans.englich@nokia.com>
92 * @short Various classes that contains small utility functions.
94 * @defgroup Patternist Utility Classes
95 * @author Frans Englich <frans.englich@nokia.com>
99 * @short Classes for the type system in the XQuery & XSL-T language.
101 * @defgroup Patternist_types Type system
102 * @author Frans Englich <frans.englich@nokia.com>
106 * @defgroup Patternist_xdm XQuery/XPath Data Model
107 * @author Frans Englich <frans.englich@nokia.com>
111 * @short Patternist's family of iterators in one of the most central parts
112 * of Patternist's API, and are responsible for carrying, and typically
113 * also creating, data.
115 * An iterator, which always is an Iterator sub-class, is similar to a
116 * Java-style iterator. What signifies Patternist's iterators is that they
117 * almost always contains business logic(which is the cause to their
120 * An example which illustrates this principle is the RangeIterator. When
121 * the RangeExpression is told to create a sequence of integers between 1
122 * and 1000, it doesn't enter a loop that allocates 1000 Integer instances,
123 * but instead return an RangeIterator that incrementally creates the
124 * numbers when asked to do so via its RangeIterator::next() function. If
125 * it turns out that the expression that has the range expression as
126 * operand only needs three items from it, that is what gets created, not
129 * All iterators operates by that principle, perhaps suitably labeled as
130 * "pull-based", "lazy loaded" or "serialized". Central for the XPath
131 * language is that it filters and selects data, and the iterators supports
132 * this well by letting the demand of the filter expressions(the callees)
133 * decide how "much" source that gets computed. In this way the evaluation
134 * of an expression tree can lead to a chain of pipelined iterators, where
135 * the first asks the second for data and then performs its specific
136 * operations, the second subsequently asks the third, and so forth.
138 * However, the iterators are not limited to be used for representing
139 * sequences of items in the XPath Data Model. The Iterator is
140 * parameterized on one argument, meaning any type of "units" can be
141 * iterated, be it Item or any other. One use of this is in the
142 * ExpressionSequence(which implements the comma operator) where it creates
143 * Iterator instances over Expression instances -- its operands. The
144 * parameterization is often used in combination with the MappingIterator
145 * and the MappingCallback.
147 * @defgroup Patternist_iterators Iterators
148 * @author Frans Englich <frans.englich@nokia.com>