Xalan-C++ API Reference
1.12.0
xalanc
XPath
XPathExpression.hpp
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
#if !defined(XPATHEXPRESSION_HEADER_GUARD_1357924680)
19
#define XPATHEXPRESSION_HEADER_GUARD_1357924680
20
21
22
23
// Base header file. Must be first.
24
#include <
xalanc/XPath/XPathDefinitions.hpp
>
25
26
27
28
#include <
xalanc/Include/XalanVector.hpp
>
29
30
31
32
#include <iosfwd>
33
34
35
36
#include <
xalanc/XalanDOM/XalanDOMString.hpp
>
37
38
39
40
#include <
xalanc/PlatformSupport/DOMStringHelper.hpp
>
41
#include <
xalanc/PlatformSupport/PrintWriter.hpp
>
42
43
44
45
#include <
xalanc/XPath/XToken.hpp
>
46
#include <
xalanc/XPath/XalanXPathException.hpp
>
47
48
49
50
namespace
XALAN_CPP_NAMESPACE
{
51
52
53
54
using
xercesc::MemoryManager;
55
56
57
58
class
XALAN_XPATH_EXPORT
XPathExpression
59
{
60
public
:
61
62
typedef
std::ostream
OstreamType
;
63
64
typedef
XalanVector<int>
OpCodeMapType
;
65
typedef
XalanVector<XToken>
TokenQueueType
;
66
67
typedef
OpCodeMapType::value_type
OpCodeMapValueType
;
68
typedef
OpCodeMapValueType
OpCodeMapSizeType
;
69
70
typedef
XalanVector<OpCodeMapValueType>
OpCodeMapValueVectorType
;
71
72
typedef
XalanVector<double>
NumberLiteralValueVectorType
;
73
74
#define XALAN_XPATH_EXPRESSION_USE_ITERATORS
75
76
#if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
77
typedef
OpCodeMapType::const_iterator
OpCodeMapPositionType
;
78
#else
79
typedef
OpCodeMapSizeType
OpCodeMapPositionType
;
80
#endif
81
typedef
OpCodeMapType::difference_type
OpCodeMapDifferenceType
;
82
typedef
TokenQueueType::value_type
TokenQueueValueType
;
83
typedef
int
TokenQueueSizeType
;
84
typedef
TokenQueueSizeType
TokenQueuePositionType
;
85
86
/**
87
* List of operations codes.
88
*
89
* Code for the descriptions of the operations codes:
90
* [UPPER CASE] indicates a literal value,
91
* [lower case] is a description of a value,
92
* ([length] always indicates the length of the operation,
93
* including the operations code and the length integer.)
94
* {UPPER CASE} indicates the given production,
95
* {description} is the description of a new production,
96
* (For instance, {boolean expression} means some expression
97
* that should be resolved to a boolean.)
98
* * means that it occurs zero or more times,
99
* + means that it occurs one or more times,
100
* ? means that it is optional.
101
*
102
* returns: indicates what the production should return.
103
*/
104
enum
eOpCodes
105
{
106
/**
107
* [ELEMWILDCARD]
108
* Means ELEMWILDCARD ("*"), used instead
109
* of string index in some places.
110
*/
111
eELEMWILDCARD = -3,
112
113
/**
114
* [EMPTY]
115
* Empty slot to indicate NULL.
116
*/
117
eEMPTY = -2,
118
119
/**
120
* [ENDOP]
121
* Some operators may like to have a terminator.
122
*/
123
eENDOP = -1,
124
125
/**
126
* [OP_XPATH]
127
* [length]
128
* {expression}
129
*
130
* returns:
131
* XNodeSet
132
* XNumber
133
* XString
134
* XBoolean
135
* XRTree
136
* XObject
137
*/
138
eOP_XPATH = 1,
139
140
/**
141
* [OP_OR]
142
* [length]
143
* {boolean expression}
144
* {boolean expression}
145
*
146
* returns:
147
* XBoolean
148
*/
149
eOP_OR = 2,
150
151
/**
152
* [OP_AND]
153
* [length]
154
* {boolean expression}
155
* {boolean expression}
156
*
157
* returns:
158
* XBoolean
159
*/
160
eOP_AND = 3,
161
162
/**
163
* [OP_NOTEQUALS]
164
* [length]
165
* {expression}
166
* {expression}
167
*
168
* returns:
169
* XBoolean
170
*/
171
eOP_NOTEQUALS = 4,
172
173
/**
174
* [OP_EQUALS]
175
* [length]
176
* {expression}
177
* {expression}
178
*
179
* returns:
180
* XBoolean
181
*/
182
eOP_EQUALS = 5,
183
184
/**
185
* [OP_LTE] (less-than-or-equals)
186
* [length]
187
* {number expression}
188
* {number expression}
189
*
190
* returns:
191
* XBoolean
192
*/
193
eOP_LTE = 6,
194
195
/**
196
* [OP_LT] (less-than)
197
* [length]
198
* {number expression}
199
* {number expression}
200
*
201
* returns:
202
* XBoolean
203
*/
204
eOP_LT = 7,
205
206
/**
207
* [OP_GTE] (greater-than-or-equals)
208
* [length]
209
* {number expression}
210
* {number expression}
211
*
212
* returns:
213
* XBoolean
214
*/
215
eOP_GTE = 8,
216
217
/**
218
* [OP_GT] (greater-than)
219
* [length]
220
* {number expression}
221
* {number expression}
222
*
223
* returns:
224
* XBoolean
225
*/
226
eOP_GT = 9,
227
228
/**
229
* [OP_PLUS]
230
* [length]
231
* {number expression}
232
* {number expression}
233
*
234
* returns:
235
* XNumber
236
*/
237
eOP_PLUS = 10,
238
239
/**
240
* [OP_MINUS]
241
* [length]
242
* {number expression}
243
* {number expression}
244
*
245
* returns: