1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
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>