Merge lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba
- xquery3.0_funcs
- Merge into trunk
Status: | Superseded | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~zorba-coders/zorba/xquery3.0_funcs | ||||||||||||||||
Merge into: | lp:zorba | ||||||||||||||||
Diff against target: |
34502 lines (+16814/-16924) 80 files modified
ChangeLog (+13/-15) modules/w3c/xpath_functions.xq (+17/-1) src/compiler/translator/translator.cpp (+4/-0) src/functions/pregenerated/func_accessors.cpp (+20/-0) src/functions/pregenerated/func_accessors.h (+17/-1) src/functions/pregenerated/func_nodes.cpp (+44/-0) src/functions/pregenerated/func_nodes.h (+15/-0) src/functions/pregenerated/func_parse_fragment.cpp (+1/-1) src/functions/pregenerated/func_sequences.cpp (+775/-923) src/functions/pregenerated/func_sequences.h (+633/-708) src/functions/pregenerated/func_strings.cpp (+922/-895) src/functions/pregenerated/function_enum.h (+4/-0) src/runtime/accessors/accessors_impl.cpp (+1/-2) src/runtime/any_uri/pregenerated/any_uri.cpp (+60/-60) src/runtime/any_uri/pregenerated/any_uri.h (+76/-76) src/runtime/base64/pregenerated/base64.cpp (+82/-82) src/runtime/base64/pregenerated/base64.h (+110/-110) src/runtime/booleans/pregenerated/booleans.cpp (+104/-104) src/runtime/booleans/pregenerated/booleans.h (+144/-144) src/runtime/collections/collections_impl.cpp (+116/-116) src/runtime/collections/pregenerated/collections.h (+3/-3) src/runtime/context/pregenerated/context.cpp (+148/-148) src/runtime/context/pregenerated/context.h (+212/-212) src/runtime/debug/pregenerated/debug_iterator.cpp (+75/-75) src/runtime/debug/pregenerated/debug_iterator.h (+135/-135) src/runtime/durations_dates_times/pregenerated/durations_dates_times.cpp (+500/-500) src/runtime/durations_dates_times/pregenerated/durations_dates_times.h (+756/-756) src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.cpp (+100/-100) src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.h (+125/-125) src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.cpp (+105/-105) src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.h (+174/-174) src/runtime/fetch/pregenerated/fetch.cpp (+82/-82) src/runtime/fetch/pregenerated/fetch.h (+112/-112) src/runtime/fnput/pregenerated/fnput.cpp (+60/-60) src/runtime/fnput/pregenerated/fnput.h (+76/-76) src/runtime/function_item/pregenerated/function_item_iter.cpp (+107/-107) src/runtime/function_item/pregenerated/function_item_iter.h (+155/-155) src/runtime/indexing/pregenerated/ic_ddl.cpp (+93/-93) src/runtime/indexing/pregenerated/ic_ddl.h (+167/-167) src/runtime/introspection/pregenerated/sctx.cpp (+662/-662) src/runtime/introspection/pregenerated/sctx.h (+1110/-1110) src/runtime/json/pregenerated/json.cpp (+82/-82) src/runtime/json/pregenerated/json.h (+114/-114) src/runtime/maths/pregenerated/maths.cpp (+538/-538) src/runtime/maths/pregenerated/maths.h (+952/-952) src/runtime/nodes/nodes_impl.cpp (+117/-0) src/runtime/nodes/pregenerated/node_position.cpp (+566/-566) src/runtime/nodes/pregenerated/node_position.h (+858/-858) src/runtime/nodes/pregenerated/nodes.cpp (+22/-0) src/runtime/nodes/pregenerated/nodes.h (+34/-0) src/runtime/numerics/pregenerated/numerics.cpp (+192/-192) src/runtime/numerics/pregenerated/numerics.h (+290/-290) src/runtime/parsing_and_serializing/parse_fragment_impl.cpp (+65/-13) src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp (+0/-1) src/runtime/parsing_and_serializing/pregenerated/parse_fragment.cpp (+15/-15) src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h (+11/-11) src/runtime/qnames/pregenerated/qnames.cpp (+193/-193) src/runtime/qnames/pregenerated/qnames.h (+329/-329) src/runtime/random/pregenerated/random.cpp (+128/-128) src/runtime/random/pregenerated/random.h (+177/-177) src/runtime/schema/pregenerated/schema.cpp (+122/-122) src/runtime/schema/pregenerated/schema.h (+187/-187) src/runtime/sequences/pregenerated/sequences.cpp (+846/-962) src/runtime/sequences/pregenerated/sequences.h (+1403/-1622) src/runtime/spec/accessors/accessors.xml (+5/-2) src/runtime/spec/collections/collections.xml (+26/-26) src/runtime/spec/nodes/nodes.xml (+27/-0) src/runtime/spec/parsing_and_serializing/parse_fragment.xml (+32/-3) src/runtime/spec/parsing_and_serializing/parsing_and_serializing.xml (+3/-3) src/runtime/store/pregenerated/documents.cpp (+151/-151) src/runtime/store/pregenerated/documents.h (+240/-240) src/runtime/store/pregenerated/maps.cpp (+242/-242) src/runtime/store/pregenerated/maps.h (+368/-368) src/runtime/uris/pregenerated/uris.cpp (+60/-60) src/runtime/uris/pregenerated/uris.h (+80/-80) src/runtime/visitors/pregenerated/planiter_visitor.h (+8/-3) src/runtime/visitors/pregenerated/printer_visitor.cpp (+19/-5) src/runtime/visitors/pregenerated/printer_visitor.h (+5/-2) src/runtime/xqdoc/pregenerated/xqdoc.cpp (+82/-82) src/runtime/xqdoc/pregenerated/xqdoc.h (+110/-110) |
||||||||||||||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/xquery3.0_funcs | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Pending | ||
Review via email: mp+104331@code.launchpad.net |
This proposal supersedes a proposal from 2012-05-02.
This proposal has been superseded by a proposal from 2012-05-02.
Commit message
Added XQuery 3.0 Functions
path, has-children#0, nilled#0
Description of the change
Added XQuery 3.0 Functions
path, has-children#0, nilled#0
Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal | # |
Juan Zacarias (juan457) wrote : Posted in a previous version of this proposal | # |
> - The fn:path functions returns a wrong result for the following doc/query:
>
> doc.xml
> <a><b/><b/></a>
>
> fn:path(
> /"":a[2]/"":b[1]
Oh It seems I used the wrong value for the position. I have a question about this I was using Item->getRefCount() for the value of the position of the node, but it appears to be wrong is that info on the node stored anywhere else? if not should I implement it as info inside the Item? or just for the function?
>
> - As far as I understood from the spec, fn:parse-
> true for the query
>
> fn:parse-
> document-node()
I will take a look on this
Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal | # |
> > - The fn:path functions returns a wrong result for the following doc/query:
> >
> > doc.xml
> > <a><b/><b/></a>
> >
> > fn:path(
> > /"":a[2]/"":b[1]
> Oh It seems I used the wrong value for the position. I have a question about
> this I was using Item->getRefCount() for the value of the position of the
> node, but it appears to be wrong is that info on the node stored anywhere
> else? if not should I implement it as info inside the Item? or just for the
> function?
getRefCount() returns the number of references to the node. It cannot be used as the position among siblings. I'm afraid there is no such information stored in a node. You probably have to count the number of preceding siblings, i.e. go to the parent and iterate over the children until you reached the node in question.
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job xquery3.
The final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job xquery3.
The final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
Error in read script: /home/ceej/
- 10743. By Matthias Brantner
-
commit of generated files
- 10744. By Matthias Brantner
-
commit of more pregenerated files
- 10745. By Matthias Brantner
-
fixed failing tests
- 10747. By Nicolae Brinza
-
Enabled fn:parse-
xml-fragment( ) which now correctly retuns only one document node holding all the fragments - 10748. By Nicolae Brinza
-
Fixed a new bug in the parse-fragment code reported by Juan. Added relevant testcases
- 10749. By Nicolae Brinza
-
Merged with Zorba trunk.
- 10750. By Nicolae Brinza
-
Fixed a reported bug in the parse-fragment code.
- 10751. By Nicolae Brinza
-
Merged with Zorba trunk
- 10752. By Juan Zacarias
-
Fixed failing tests
- 10753. By Nicolae Brinza
-
Fixed the parse-fragment() bug where an empty string input would not return a document node.
- 10754. By Juan Zacarias
-
updated changelog
- 10755. By Nicolae Brinza
-
Merged with Zorba trunk
- 10756. By Nicolae Brinza
-
Fixed the Changelog note for the fn:parse-
xml-fragment# 1 implementation - 10757. By Nicolae Brinza
-
Merged with Zorba trunk
- 10758. By Nicolae Brinza
-
Fixed the fn:parse-
xml-fragment( ) pregenerated files so that Zorba now correctly builds - 10759. By Nicolae Brinza
-
Fixed the backwards-
compatible zorba:parse- xml-fragment( ) function so that it works with the 'w' option enabled
Unmerged revisions
Preview Diff
1 | === modified file 'ChangeLog' |
2 | --- ChangeLog 2012-05-01 15:54:27 +0000 |
3 | +++ ChangeLog 2012-05-02 07:18:18 +0000 |
4 | @@ -3,11 +3,15 @@ |
5 | version 2.5 |
6 | |
7 | New Features: |
8 | - * fn:available-environment-variables |
9 | - * fn:environment-variables |
10 | - * fn:uri-collection |
11 | - * fn:unparsed-text |
12 | - * fn:unparsed-text-available |
13 | + * XQuery 3.0 functions |
14 | + - fn:available-environment-variables |
15 | + - fn:environment-variables |
16 | + - fn:uri-collection |
17 | + - fn:unparsed-text |
18 | + - fn:unparsed-text-available |
19 | + - fn:has-children#0 |
20 | + - fn:nilled#0 |
21 | + - fn:path |
22 | * Extended API for Python, Java, PHP and Ruby. |
23 | * Add jvm classpath to zorbacmd and to Zorba API. Tracked by #931816 |
24 | * Added full-text module. |
25 | @@ -15,14 +19,11 @@ |
26 | * Added XQJ support. |
27 | * Added CollectionManager and DocumentManager support for XQJ. |
28 | |
29 | -Optimization: |
30 | - |
31 | Bug Fixes/Other Changes: |
32 | * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number(). Additionally, the function now throws the FODF1310 error instead of XTDE1310, as the 3.0 spec requires) |
33 | * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest) |
34 | * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions) |
35 | - * Fixed bug #986075 (encountering flwor expr with no clauses; due to common |
36 | - subexression being formed when inlining var in if-then-else expression) |
37 | + * Fixed bug #986075 (encountering flwor expr with no clauses; due to common subexression being formed when inlining var in if-then-else expression) |
38 | * Fixed bug #967864 (var substitution did not update theFreeVars property) |
39 | * Fixed bug #891650 (context size var not always declared within path expr) |
40 | * Fixed bug #948879 (--uri-path doesn't work with fetch:content()) |
41 | @@ -36,17 +37,14 @@ |
42 | * Fixed bug #988412 (date:current-dateTime daylight saving) |
43 | * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation) |
44 | * Fixed bug #921458 (file:read-text-lines() blocking) |
45 | - * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the |
46 | - associated try-catch expression) |
47 | - * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item |
48 | - type in same module) |
49 | + * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the associated try-catch expression) |
50 | + * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item type in same module) |
51 | * Fixed bug #980526 (no-copy rule bug due to global var being set in "distant" udf) |
52 | * Fixed bug #949910 (has-children may be invoked on all nodes). Internally, zorba::store::Item::getChildren() now returns NULL on node classes without offspring (instead of raising an error). |
53 | - * Fixed Bug #933490: Error ItemFactoryImpl::createBase64Binary with istream |
54 | + * Fixed Bug #933490 (Error ItemFactoryImpl::createBase64Binary with istream) |
55 | * Fixed bug #867112 (Diagnostic Handler was not working on external APIs) |
56 | * Fixed bug #857842 (Assertion failed with simple content element with comments) |
57 | |
58 | - |
59 | version 2.2 |
60 | |
61 | New Features: |
62 | |
63 | === modified file 'modules/w3c/xpath_functions.xq' |
64 | --- modules/w3c/xpath_functions.xq 2012-04-24 12:39:38 +0000 |
65 | +++ modules/w3c/xpath_functions.xq 2012-05-02 07:18:18 +0000 |
66 | @@ -522,6 +522,12 @@ |
67 | declare function fn:parse-xml( $arg as xs:string?, $baseURI as xs:string) as document-node(element(*, xs:untyped)) external; |
68 | |
69 | (:~ |
70 | + : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-parse-xml-fragment">fn:parse-xml-fragment</a> |
71 | + :) |
72 | +declare function fn:parse-xml-fragment( $arg as xs:string?) as document-node(element(*, xs:untyped)) external; |
73 | + |
74 | + |
75 | +(:~ |
76 | : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-prefix-from-QName">fn:prefix-from-QName</a> |
77 | :) |
78 | declare function fn:prefix-from-QName($arg as xs:QName?) as xs:NCName? external; |
79 | @@ -864,6 +870,11 @@ |
80 | (:~ |
81 | : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-has-children">fn:has-children</a> |
82 | :) |
83 | +declare function fn:has-children() as xs:boolean external; |
84 | + |
85 | +(:~ |
86 | + : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-has-children">fn:has-children</a> |
87 | + :) |
88 | declare function fn:has-children($node as node()?) as xs:boolean external; |
89 | |
90 | (:~ |
91 | @@ -923,12 +934,17 @@ |
92 | |
93 | (:~ |
94 | : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-namespace-uri">fn:namespace-uri</a> |
95 | - :) |
96 | + :) |
97 | declare function fn:namespace-uri($arg as node()?) as xs:anyURI external; |
98 | |
99 | (:~ |
100 | : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-nilled">fn:nilled</a> |
101 | :) |
102 | +declare function fn:nilled() as xs:boolean external; |
103 | + |
104 | +(:~ |
105 | + : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-nilled">fn:nilled</a> |
106 | + :) |
107 | declare function fn:nilled($arg as node()?) as xs:boolean? external; |
108 | |
109 | (:~ |
110 | |
111 | === modified file 'src/compiler/translator/translator.cpp' |
112 | --- src/compiler/translator/translator.cpp 2012-05-01 21:21:04 +0000 |
113 | +++ src/compiler/translator/translator.cpp 2012-05-02 07:18:18 +0000 |
114 | @@ -694,6 +694,10 @@ |
115 | xquery_fns_def_dot.set(FunctionConsts::FN_DATA_0); |
116 | xquery_fns_def_dot.set(FunctionConsts::FN_DOCUMENT_URI_0); |
117 | xquery_fns_def_dot.set(FunctionConsts::FN_NODE_NAME_0); |
118 | + xquery_fns_def_dot.set(FunctionConsts::FN_NILLED_0); |
119 | + xquery_fns_def_dot.set(FunctionConsts::FN_HAS_CHILDREN_0); |
120 | + xquery_fns_def_dot.set(FunctionConsts::FN_PATH_0); |
121 | + |
122 | |
123 | op_concatenate = GET_BUILTIN_FUNCTION(OP_CONCATENATE_N); |
124 | assert(op_concatenate != NULL); |
125 | |
126 | === modified file 'src/functions/pregenerated/func_accessors.cpp' |
127 | --- src/functions/pregenerated/func_accessors.cpp 2012-04-24 12:39:38 +0000 |
128 | +++ src/functions/pregenerated/func_accessors.cpp 2012-05-02 07:18:18 +0000 |
129 | @@ -50,6 +50,15 @@ |
130 | return new NodeNameIterator(sctx, loc, argv); |
131 | } |
132 | |
133 | +PlanIter_t fn_nilled_3_0::codegen( |
134 | + CompilerCB*, |
135 | + static_context* sctx, |
136 | + const QueryLoc& loc, |
137 | + std::vector<PlanIter_t>& argv, |
138 | + expr& ann) const |
139 | +{ |
140 | + return new NilledIterator(sctx, loc, argv); |
141 | +} |
142 | PlanIter_t fn_nilled::codegen( |
143 | CompilerCB*, |
144 | static_context* sctx, |
145 | @@ -138,6 +147,17 @@ |
146 | { |
147 | |
148 | |
149 | + DECL_WITH_KIND(sctx, fn_nilled_3_0, |
150 | + (createQName("http://www.w3.org/2005/xpath-functions","","nilled"), |
151 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
152 | + FunctionConsts::FN_NILLED_0); |
153 | + |
154 | + } |
155 | + |
156 | + |
157 | + { |
158 | + |
159 | + |
160 | DECL_WITH_KIND(sctx, fn_nilled, |
161 | (createQName("http://www.w3.org/2005/xpath-functions","","nilled"), |
162 | GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, |
163 | |
164 | === modified file 'src/functions/pregenerated/func_accessors.h' |
165 | --- src/functions/pregenerated/func_accessors.h 2012-04-24 12:39:38 +0000 |
166 | +++ src/functions/pregenerated/func_accessors.h 2012-05-02 07:18:18 +0000 |
167 | @@ -72,6 +72,22 @@ |
168 | |
169 | |
170 | //fn:nilled |
171 | +class fn_nilled_3_0 : public function |
172 | +{ |
173 | +public: |
174 | + fn_nilled_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
175 | + : |
176 | + function(sig, kind) |
177 | + { |
178 | +theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
179 | + } |
180 | + |
181 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } |
182 | + |
183 | + CODEGEN_DECL(); |
184 | +}; |
185 | + |
186 | +//fn:nilled |
187 | class fn_nilled : public function |
188 | { |
189 | public: |
190 | @@ -82,7 +98,7 @@ |
191 | |
192 | } |
193 | |
194 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
195 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } |
196 | |
197 | CODEGEN_DECL(); |
198 | }; |
199 | |
200 | === modified file 'src/functions/pregenerated/func_nodes.cpp' |
201 | --- src/functions/pregenerated/func_nodes.cpp 2012-04-24 12:39:38 +0000 |
202 | +++ src/functions/pregenerated/func_nodes.cpp 2012-05-02 07:18:18 +0000 |
203 | @@ -231,6 +231,16 @@ |
204 | return new LeastCommonAncestor(sctx, loc, argv); |
205 | } |
206 | |
207 | +PlanIter_t fn_path_3_0::codegen( |
208 | + CompilerCB*, |
209 | + static_context* sctx, |
210 | + const QueryLoc& loc, |
211 | + std::vector<PlanIter_t>& argv, |
212 | + expr& ann) const |
213 | +{ |
214 | + return new FnPathIterator(sctx, loc, argv); |
215 | +} |
216 | + |
217 | void populate_context_nodes(static_context* sctx) |
218 | { |
219 | { |
220 | @@ -356,6 +366,17 @@ |
221 | |
222 | DECL_WITH_KIND(sctx, fn_has_children_3_0, |
223 | (createQName("http://www.w3.org/2005/xpath-functions","","has-children"), |
224 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
225 | + FunctionConsts::FN_HAS_CHILDREN_0); |
226 | + |
227 | + } |
228 | + |
229 | + |
230 | + { |
231 | + |
232 | + |
233 | + DECL_WITH_KIND(sctx, fn_has_children_3_0, |
234 | + (createQName("http://www.w3.org/2005/xpath-functions","","has-children"), |
235 | GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, |
236 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
237 | FunctionConsts::FN_HAS_CHILDREN_1); |
238 | @@ -538,6 +559,29 @@ |
239 | |
240 | } |
241 | |
242 | + |
243 | + { |
244 | + |
245 | + |
246 | + DECL_WITH_KIND(sctx, fn_path_3_0, |
247 | + (createQName("http://www.w3.org/2005/xpath-functions","","path"), |
248 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
249 | + FunctionConsts::FN_PATH_0); |
250 | + |
251 | + } |
252 | + |
253 | + |
254 | + { |
255 | + |
256 | + |
257 | + DECL_WITH_KIND(sctx, fn_path_3_0, |
258 | + (createQName("http://www.w3.org/2005/xpath-functions","","path"), |
259 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, |
260 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
261 | + FunctionConsts::FN_PATH_1); |
262 | + |
263 | + } |
264 | + |
265 | } |
266 | |
267 | |
268 | |
269 | === modified file 'src/functions/pregenerated/func_nodes.h' |
270 | --- src/functions/pregenerated/func_nodes.h 2012-04-24 12:39:38 +0000 |
271 | +++ src/functions/pregenerated/func_nodes.h 2012-05-02 07:18:18 +0000 |
272 | @@ -372,6 +372,21 @@ |
273 | }; |
274 | |
275 | |
276 | +//fn:path |
277 | +class fn_path_3_0 : public function |
278 | +{ |
279 | +public: |
280 | + fn_path_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
281 | + : |
282 | + function(sig, kind) |
283 | + { |
284 | +theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
285 | + } |
286 | + |
287 | + CODEGEN_DECL(); |
288 | +}; |
289 | + |
290 | + |
291 | } //namespace zorba |
292 | |
293 | |
294 | |
295 | === modified file 'src/functions/pregenerated/func_parse_fragment.cpp' |
296 | --- src/functions/pregenerated/func_parse_fragment.cpp 2012-04-24 12:39:38 +0000 |
297 | +++ src/functions/pregenerated/func_parse_fragment.cpp 2012-05-02 07:18:18 +0000 |
298 | @@ -38,7 +38,7 @@ |
299 | std::vector<PlanIter_t>& argv, |
300 | expr& ann) const |
301 | { |
302 | - return new FnParseXmlFragmentIterator(sctx, loc, argv); |
303 | + return new FnZorbaParseXmlFragmentIterator(sctx, loc, argv); |
304 | } |
305 | |
306 | void populate_context_parse_fragment(static_context* sctx) |
307 | |
308 | === modified file 'src/functions/pregenerated/func_sequences.cpp' |
309 | --- src/functions/pregenerated/func_sequences.cpp 2012-04-24 12:39:38 +0000 |
310 | +++ src/functions/pregenerated/func_sequences.cpp 2012-05-02 07:18:18 +0000 |
311 | @@ -1,923 +1,775 @@ |
312 | -/* |
313 | - * Copyright 2006-2008 The FLWOR Foundation. |
314 | - * |
315 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
316 | - * you may not use this file except in compliance with the License. |
317 | - * You may obtain a copy of the License at |
318 | - * |
319 | - * http://www.apache.org/licenses/LICENSE-2.0 |
320 | - * |
321 | - * Unless required by applicable law or agreed to in writing, software |
322 | - * distributed under the License is distributed on an "AS IS" BASIS, |
323 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
324 | - * See the License for the specific language governing permissions and |
325 | - * limitations under the License. |
326 | - */ |
327 | - |
328 | -// ****************************************** |
329 | -// * * |
330 | -// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
331 | -// * SEE .xml FILE WITH SAME NAME * |
332 | -// * * |
333 | -// ****************************************** |
334 | - |
335 | - |
336 | -#include "stdafx.h" |
337 | -#include "runtime/sequences/sequences.h" |
338 | -#include "functions/func_sequences.h" |
339 | -#include "system/globalenv.h" |
340 | -#include "types/typeops.h" |
341 | -#include "compiler/expression/expr_base.h" |
342 | - |
343 | - |
344 | -namespace zorba{ |
345 | - |
346 | - |
347 | - |
348 | -PlanIter_t op_concatenate::codegen( |
349 | - CompilerCB*, |
350 | - static_context* sctx, |
351 | - const QueryLoc& loc, |
352 | - std::vector<PlanIter_t>& argv, |
353 | - expr& ann) const |
354 | -{ |
355 | - return new FnConcatIterator(sctx, loc, argv); |
356 | -} |
357 | - |
358 | -PlanIter_t fn_index_of::codegen( |
359 | - CompilerCB*, |
360 | - static_context* sctx, |
361 | - const QueryLoc& loc, |
362 | - std::vector<PlanIter_t>& argv, |
363 | - expr& ann) const |
364 | -{ |
365 | - return new FnIndexOfIterator(sctx, loc, argv); |
366 | -} |
367 | - |
368 | -PlanIter_t fn_empty::codegen( |
369 | - CompilerCB*, |
370 | - static_context* sctx, |
371 | - const QueryLoc& loc, |
372 | - std::vector<PlanIter_t>& argv, |
373 | - expr& ann) const |
374 | -{ |
375 | - return new FnEmptyIterator(sctx, loc, argv); |
376 | -} |
377 | - |
378 | -PlanIter_t fn_exists::codegen( |
379 | - CompilerCB*, |
380 | - static_context* sctx, |
381 | - const QueryLoc& loc, |
382 | - std::vector<PlanIter_t>& argv, |
383 | - expr& ann) const |
384 | -{ |
385 | - return new FnExistsIterator(sctx, loc, argv); |
386 | -} |
387 | - |
388 | -PlanIter_t fn_distinct_values::codegen( |
389 | - CompilerCB*, |
390 | - static_context* sctx, |
391 | - const QueryLoc& loc, |
392 | - std::vector<PlanIter_t>& argv, |
393 | - expr& ann) const |
394 | -{ |
395 | - return new FnDistinctValuesIterator(sctx, loc, argv); |
396 | -} |
397 | - |
398 | -PlanIter_t fn_insert_before::codegen( |
399 | - CompilerCB*, |
400 | - static_context* sctx, |
401 | - const QueryLoc& loc, |
402 | - std::vector<PlanIter_t>& argv, |
403 | - expr& ann) const |
404 | -{ |
405 | - return new FnInsertBeforeIterator(sctx, loc, argv); |
406 | -} |
407 | - |
408 | -PlanIter_t fn_remove::codegen( |
409 | - CompilerCB*, |
410 | - static_context* sctx, |
411 | - const QueryLoc& loc, |
412 | - std::vector<PlanIter_t>& argv, |
413 | - expr& ann) const |
414 | -{ |
415 | - return new FnRemoveIterator(sctx, loc, argv); |
416 | -} |
417 | - |
418 | -PlanIter_t fn_reverse::codegen( |
419 | - CompilerCB*, |
420 | - static_context* sctx, |
421 | - const QueryLoc& loc, |
422 | - std::vector<PlanIter_t>& argv, |
423 | - expr& ann) const |
424 | -{ |
425 | - return new FnReverseIterator(sctx, loc, argv); |
426 | -} |
427 | - |
428 | - |
429 | - |
430 | - |
431 | - |
432 | -PlanIter_t fn_one_or_more::codegen( |
433 | - CompilerCB*, |
434 | - static_context* sctx, |
435 | - const QueryLoc& loc, |
436 | - std::vector<PlanIter_t>& argv, |
437 | - expr& ann) const |
438 | -{ |
439 | - return new FnOneOrMoreIterator(sctx, loc, argv); |
440 | -} |
441 | - |
442 | -PlanIter_t fn_deep_equal::codegen( |
443 | - CompilerCB*, |
444 | - static_context* sctx, |
445 | - const QueryLoc& loc, |
446 | - std::vector<PlanIter_t>& argv, |
447 | - expr& ann) const |
448 | -{ |
449 | - return new FnDeepEqualIterator(sctx, loc, argv); |
450 | -} |
451 | - |
452 | - |
453 | -PlanIter_t fn_avg::codegen( |
454 | - CompilerCB*, |
455 | - static_context* sctx, |
456 | - const QueryLoc& loc, |
457 | - std::vector<PlanIter_t>& argv, |
458 | - expr& ann) const |
459 | -{ |
460 | - return new FnAvgIterator(sctx, loc, argv); |
461 | -} |
462 | - |
463 | -PlanIter_t fn_sum::codegen( |
464 | - CompilerCB*, |
465 | - static_context* sctx, |
466 | - const QueryLoc& loc, |
467 | - std::vector<PlanIter_t>& argv, |
468 | - expr& ann) const |
469 | -{ |
470 | - return new FnSumIterator(sctx, loc, argv); |
471 | -} |
472 | - |
473 | -PlanIter_t op_sum_double::codegen( |
474 | - CompilerCB*, |
475 | - static_context* sctx, |
476 | - const QueryLoc& loc, |
477 | - std::vector<PlanIter_t>& argv, |
478 | - expr& ann) const |
479 | -{ |
480 | - return new FnSumDoubleIterator(sctx, loc, argv); |
481 | -} |
482 | - |
483 | -PlanIter_t op_sum_float::codegen( |
484 | - CompilerCB*, |
485 | - static_context* sctx, |
486 | - const QueryLoc& loc, |
487 | - std::vector<PlanIter_t>& argv, |
488 | - expr& ann) const |
489 | -{ |
490 | - return new FnSumFloatIterator(sctx, loc, argv); |
491 | -} |
492 | - |
493 | -PlanIter_t op_sum_decimal::codegen( |
494 | - CompilerCB*, |
495 | - static_context* sctx, |
496 | - const QueryLoc& loc, |
497 | - std::vector<PlanIter_t>& argv, |
498 | - expr& ann) const |
499 | -{ |
500 | - return new FnSumDecimalIterator(sctx, loc, argv); |
501 | -} |
502 | - |
503 | -PlanIter_t op_sum_integer::codegen( |
504 | - CompilerCB*, |
505 | - static_context* sctx, |
506 | - const QueryLoc& loc, |
507 | - std::vector<PlanIter_t>& argv, |
508 | - expr& ann) const |
509 | -{ |
510 | - return new FnSumIntegerIterator(sctx, loc, argv); |
511 | -} |
512 | - |
513 | -PlanIter_t op_to::codegen( |
514 | - CompilerCB*, |
515 | - static_context* sctx, |
516 | - const QueryLoc& loc, |
517 | - std::vector<PlanIter_t>& argv, |
518 | - expr& ann) const |
519 | -{ |
520 | - return new OpToIterator(sctx, loc, argv); |
521 | -} |
522 | - |
523 | -PlanIter_t fn_id::codegen( |
524 | - CompilerCB*, |
525 | - static_context* sctx, |
526 | - const QueryLoc& loc, |
527 | - std::vector<PlanIter_t>& argv, |
528 | - expr& ann) const |
529 | -{ |
530 | - return new FnIdIterator(sctx, loc, argv); |
531 | -} |
532 | - |
533 | -PlanIter_t fn_element_with_id::codegen( |
534 | - CompilerCB*, |
535 | - static_context* sctx, |
536 | - const QueryLoc& loc, |
537 | - std::vector<PlanIter_t>& argv, |
538 | - expr& ann) const |
539 | -{ |
540 | - return new FnElementWithIdIterator(sctx, loc, argv); |
541 | -} |
542 | - |
543 | -PlanIter_t fn_idref::codegen( |
544 | - CompilerCB*, |
545 | - static_context* sctx, |
546 | - const QueryLoc& loc, |
547 | - std::vector<PlanIter_t>& argv, |
548 | - expr& ann) const |
549 | -{ |
550 | - return new FnIdRefIterator(sctx, loc, argv); |
551 | -} |
552 | - |
553 | -PlanIter_t fn_doc::codegen( |
554 | - CompilerCB*, |
555 | - static_context* sctx, |
556 | - const QueryLoc& loc, |
557 | - std::vector<PlanIter_t>& argv, |
558 | - expr& ann) const |
559 | -{ |
560 | - return new FnDocIterator(sctx, loc, argv); |
561 | -} |
562 | - |
563 | -PlanIter_t fn_doc_available::codegen( |
564 | - CompilerCB*, |
565 | - static_context* sctx, |
566 | - const QueryLoc& loc, |
567 | - std::vector<PlanIter_t>& argv, |
568 | - expr& ann) const |
569 | -{ |
570 | - return new FnDocAvailableIterator(sctx, loc, argv); |
571 | -} |
572 | - |
573 | -PlanIter_t fn_available_environment_variables_3_0::codegen( |
574 | - CompilerCB*, |
575 | - static_context* sctx, |
576 | - const QueryLoc& loc, |
577 | - std::vector<PlanIter_t>& argv, |
578 | - expr& ann) const |
579 | -{ |
580 | - return new FnAvailableEnvironmentVariablesIterator(sctx, loc, argv); |
581 | -} |
582 | - |
583 | -PlanIter_t fn_environment_variable_3_0::codegen( |
584 | - CompilerCB*, |
585 | - static_context* sctx, |
586 | - const QueryLoc& loc, |
587 | - std::vector<PlanIter_t>& argv, |
588 | - expr& ann) const |
589 | -{ |
590 | - return new FnEnvironmentVariableIterator(sctx, loc, argv); |
591 | -} |
592 | - |
593 | -PlanIter_t fn_unparsed_text_3_0::codegen( |
594 | - CompilerCB*, |
595 | - static_context* sctx, |
596 | - const QueryLoc& loc, |
597 | - std::vector<PlanIter_t>& argv, |
598 | - expr& ann) const |
599 | -{ |
600 | - return new FnUnparsedTextIterator(sctx, loc, argv); |
601 | -} |
602 | - |
603 | -PlanIter_t fn_unparsed_text_available_3_0::codegen( |
604 | - CompilerCB*, |
605 | - static_context* sctx, |
606 | - const QueryLoc& loc, |
607 | - std::vector<PlanIter_t>& argv, |
608 | - expr& ann) const |
609 | -{ |
610 | - return new FnUnparsedTextAvailableIterator(sctx, loc, argv); |
611 | -} |
612 | - |
613 | -PlanIter_t fn_unparsed_text_lines_3_0::codegen( |
614 | - CompilerCB*, |
615 | - static_context* sctx, |
616 | - const QueryLoc& loc, |
617 | - std::vector<PlanIter_t>& argv, |
618 | - expr& ann) const |
619 | -{ |
620 | - return new FnUnparsedTextLinesIterator(sctx, loc, argv); |
621 | -} |
622 | - |
623 | -void populate_context_sequences(static_context* sctx) |
624 | -{ |
625 | - { |
626 | - std::vector<xqtref_t> lParamTypes; |
627 | - lParamTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR); |
628 | - |
629 | - DECL_WITH_KIND(sctx, op_concatenate, |
630 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","concatenate"), |
631 | - lParamTypes, GENV_TYPESYSTEM.ITEM_TYPE_STAR, true), |
632 | - FunctionConsts::OP_CONCATENATE_N); |
633 | - |
634 | - } |
635 | - |
636 | - |
637 | - { |
638 | - |
639 | - |
640 | - DECL_WITH_KIND(sctx, fn_index_of, |
641 | - (createQName("http://www.w3.org/2005/xpath-functions","","index-of"), |
642 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
643 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, |
644 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
645 | - FunctionConsts::FN_INDEX_OF_2); |
646 | - |
647 | - } |
648 | - |
649 | - |
650 | - { |
651 | - |
652 | - |
653 | - DECL_WITH_KIND(sctx, fn_index_of, |
654 | - (createQName("http://www.w3.org/2005/xpath-functions","","index-of"), |
655 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
656 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, |
657 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
658 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
659 | - FunctionConsts::FN_INDEX_OF_3); |
660 | - |
661 | - } |
662 | - |
663 | - |
664 | - { |
665 | - |
666 | - |
667 | - DECL_WITH_KIND(sctx, fn_empty, |
668 | - (createQName("http://www.w3.org/2005/xpath-functions","","empty"), |
669 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
670 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
671 | - FunctionConsts::FN_EMPTY_1); |
672 | - |
673 | - } |
674 | - |
675 | - |
676 | - { |
677 | - |
678 | - |
679 | - DECL_WITH_KIND(sctx, fn_exists, |
680 | - (createQName("http://www.w3.org/2005/xpath-functions","","exists"), |
681 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
682 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
683 | - FunctionConsts::FN_EXISTS_1); |
684 | - |
685 | - } |
686 | - |
687 | - |
688 | - { |
689 | - |
690 | - |
691 | - DECL_WITH_KIND(sctx, fn_distinct_values, |
692 | - (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values"), |
693 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
694 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
695 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR), |
696 | - FunctionConsts::FN_DISTINCT_VALUES_2); |
697 | - |
698 | - } |
699 | - |
700 | - |
701 | - { |
702 | - |
703 | - |
704 | - DECL_WITH_KIND(sctx, fn_distinct_values, |
705 | - (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values"), |
706 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
707 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR), |
708 | - FunctionConsts::FN_DISTINCT_VALUES_1); |
709 | - |
710 | - } |
711 | - |
712 | - |
713 | - { |
714 | - |
715 | - |
716 | - DECL_WITH_KIND(sctx, fn_insert_before, |
717 | - (createQName("http://www.w3.org/2005/xpath-functions","","insert-before"), |
718 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
719 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
720 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
721 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
722 | - FunctionConsts::FN_INSERT_BEFORE_3); |
723 | - |
724 | - } |
725 | - |
726 | - |
727 | - { |
728 | - |
729 | - |
730 | - DECL_WITH_KIND(sctx, fn_remove, |
731 | - (createQName("http://www.w3.org/2005/xpath-functions","","remove"), |
732 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
733 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
734 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
735 | - FunctionConsts::FN_REMOVE_2); |
736 | - |
737 | - } |
738 | - |
739 | - |
740 | - { |
741 | - |
742 | - |
743 | - DECL_WITH_KIND(sctx, fn_reverse, |
744 | - (createQName("http://www.w3.org/2005/xpath-functions","","reverse"), |
745 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
746 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
747 | - FunctionConsts::FN_REVERSE_1); |
748 | - |
749 | - } |
750 | - |
751 | - |
752 | - { |
753 | - |
754 | - |
755 | - DECL_WITH_KIND(sctx, fn_subsequence, |
756 | - (createQName("http://www.w3.org/2005/xpath-functions","","subsequence"), |
757 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
758 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
759 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
760 | - FunctionConsts::FN_SUBSEQUENCE_2); |
761 | - |
762 | - } |
763 | - |
764 | - |
765 | - { |
766 | - |
767 | - |
768 | - DECL_WITH_KIND(sctx, fn_subsequence, |
769 | - (createQName("http://www.w3.org/2005/xpath-functions","","subsequence"), |
770 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
771 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
772 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
773 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
774 | - FunctionConsts::FN_SUBSEQUENCE_3); |
775 | - |
776 | - } |
777 | - |
778 | - |
779 | - { |
780 | - |
781 | - |
782 | - DECL_WITH_KIND(sctx, op_zorba_subsequence_int, |
783 | - (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int"), |
784 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
785 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
786 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
787 | - FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_2); |
788 | - |
789 | - } |
790 | - |
791 | - |
792 | - { |
793 | - |
794 | - |
795 | - DECL_WITH_KIND(sctx, op_zorba_subsequence_int, |
796 | - (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int"), |
797 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
798 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
799 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
800 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
801 | - FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_3); |
802 | - |
803 | - } |
804 | - |
805 | - |
806 | - { |
807 | - |
808 | - |
809 | - DECL_WITH_KIND(sctx, op_zorba_sequence_point_access, |
810 | - (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","sequence-point-access"), |
811 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
812 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
813 | - GENV_TYPESYSTEM.ITEM_TYPE_QUESTION), |
814 | - FunctionConsts::OP_ZORBA_SEQUENCE_POINT_ACCESS_2); |
815 | - |
816 | - } |
817 | - |
818 | - |
819 | - { |
820 | - |
821 | - |
822 | - DECL_WITH_KIND(sctx, fn_zero_or_one, |
823 | - (createQName("http://www.w3.org/2005/xpath-functions","","zero-or-one"), |
824 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
825 | - GENV_TYPESYSTEM.ITEM_TYPE_QUESTION), |
826 | - FunctionConsts::FN_ZERO_OR_ONE_1); |
827 | - |
828 | - } |
829 | - |
830 | - |
831 | - { |
832 | - |
833 | - |
834 | - DECL_WITH_KIND(sctx, fn_one_or_more, |
835 | - (createQName("http://www.w3.org/2005/xpath-functions","","one-or-more"), |
836 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
837 | - GENV_TYPESYSTEM.ITEM_TYPE_PLUS), |
838 | - FunctionConsts::FN_ONE_OR_MORE_1); |
839 | - |
840 | - } |
841 | - |
842 | - |
843 | - { |
844 | - |
845 | - |
846 | - DECL_WITH_KIND(sctx, fn_deep_equal, |
847 | - (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal"), |
848 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
849 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
850 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
851 | - FunctionConsts::FN_DEEP_EQUAL_2); |
852 | - |
853 | - } |
854 | - |
855 | - |
856 | - { |
857 | - |
858 | - |
859 | - DECL_WITH_KIND(sctx, fn_deep_equal, |
860 | - (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal"), |
861 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
862 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
863 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
864 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
865 | - FunctionConsts::FN_DEEP_EQUAL_3); |
866 | - |
867 | - } |
868 | - |
869 | - |
870 | - { |
871 | - |
872 | - |
873 | - DECL_WITH_KIND(sctx, fn_count, |
874 | - (createQName("http://www.w3.org/2005/xpath-functions","","count"), |
875 | - GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
876 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
877 | - FunctionConsts::FN_COUNT_1); |
878 | - |
879 | - } |
880 | - |
881 | - |
882 | - { |
883 | - |
884 | - |
885 | - DECL_WITH_KIND(sctx, fn_avg, |
886 | - (createQName("http://www.w3.org/2005/xpath-functions","","avg"), |
887 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
888 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
889 | - FunctionConsts::FN_AVG_1); |
890 | - |
891 | - } |
892 | - |
893 | - |
894 | - { |
895 | - |
896 | - |
897 | - DECL_WITH_KIND(sctx, fn_sum, |
898 | - (createQName("http://www.w3.org/2005/xpath-functions","","sum"), |
899 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
900 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE), |
901 | - FunctionConsts::FN_SUM_1); |
902 | - |
903 | - } |
904 | - |
905 | - |
906 | - { |
907 | - |
908 | - |
909 | - DECL_WITH_KIND(sctx, fn_sum, |
910 | - (createQName("http://www.w3.org/2005/xpath-functions","","sum"), |
911 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
912 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
913 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
914 | - FunctionConsts::FN_SUM_2); |
915 | - |
916 | - } |
917 | - |
918 | - |
919 | - { |
920 | - |
921 | - |
922 | - DECL_WITH_KIND(sctx, op_sum_double, |
923 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double"), |
924 | - GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, |
925 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
926 | - FunctionConsts::OP_SUM_DOUBLE_1); |
927 | - |
928 | - } |
929 | - |
930 | - |
931 | - { |
932 | - |
933 | - |
934 | - DECL_WITH_KIND(sctx, op_sum_double, |
935 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double"), |
936 | - GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, |
937 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
938 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
939 | - FunctionConsts::OP_SUM_DOUBLE_2); |
940 | - |
941 | - } |
942 | - |
943 | - |
944 | - { |
945 | - |
946 | - |
947 | - DECL_WITH_KIND(sctx, op_sum_float, |
948 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float"), |
949 | - GENV_TYPESYSTEM.FLOAT_TYPE_STAR, |
950 | - GENV_TYPESYSTEM.FLOAT_TYPE_ONE), |
951 | - FunctionConsts::OP_SUM_FLOAT_1); |
952 | - |
953 | - } |
954 | - |
955 | - |
956 | - { |
957 | - |
958 | - |
959 | - DECL_WITH_KIND(sctx, op_sum_float, |
960 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float"), |
961 | - GENV_TYPESYSTEM.FLOAT_TYPE_STAR, |
962 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
963 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
964 | - FunctionConsts::OP_SUM_FLOAT_2); |
965 | - |
966 | - } |
967 | - |
968 | - |
969 | - { |
970 | - |
971 | - |
972 | - DECL_WITH_KIND(sctx, op_sum_decimal, |
973 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal"), |
974 | - GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, |
975 | - GENV_TYPESYSTEM.DECIMAL_TYPE_ONE), |
976 | - FunctionConsts::OP_SUM_DECIMAL_1); |
977 | - |
978 | - } |
979 | - |
980 | - |
981 | - { |
982 | - |
983 | - |
984 | - DECL_WITH_KIND(sctx, op_sum_decimal, |
985 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal"), |
986 | - GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, |
987 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
988 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
989 | - FunctionConsts::OP_SUM_DECIMAL_2); |
990 | - |
991 | - } |
992 | - |
993 | - |
994 | - { |
995 | - |
996 | - |
997 | - DECL_WITH_KIND(sctx, op_sum_integer, |
998 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer"), |
999 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
1000 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
1001 | - FunctionConsts::OP_SUM_INTEGER_1); |
1002 | - |
1003 | - } |
1004 | - |
1005 | - |
1006 | - { |
1007 | - |
1008 | - |
1009 | - DECL_WITH_KIND(sctx, op_sum_integer, |
1010 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer"), |
1011 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
1012 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1013 | - GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1014 | - FunctionConsts::OP_SUM_INTEGER_2); |
1015 | - |
1016 | - } |
1017 | - |
1018 | - |
1019 | - { |
1020 | - |
1021 | - |
1022 | - DECL_WITH_KIND(sctx, op_to, |
1023 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","to"), |
1024 | - GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, |
1025 | - GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, |
1026 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
1027 | - FunctionConsts::OP_TO_2); |
1028 | - |
1029 | - } |
1030 | - |
1031 | - |
1032 | - { |
1033 | - |
1034 | - |
1035 | - DECL_WITH_KIND(sctx, fn_id, |
1036 | - (createQName("http://www.w3.org/2005/xpath-functions","","id"), |
1037 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1038 | - GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1039 | - FunctionConsts::FN_ID_1); |
1040 | - |
1041 | - } |
1042 | - |
1043 | - |
1044 | - { |
1045 | - |
1046 | - |
1047 | - DECL_WITH_KIND(sctx, fn_id, |
1048 | - (createQName("http://www.w3.org/2005/xpath-functions","","id"), |
1049 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1050 | - GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1051 | - GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1052 | - FunctionConsts::FN_ID_2); |
1053 | - |
1054 | - } |
1055 | - |
1056 | - |
1057 | - { |
1058 | - |
1059 | - |
1060 | - DECL_WITH_KIND(sctx, fn_element_with_id, |
1061 | - (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id"), |
1062 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1063 | - GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1064 | - FunctionConsts::FN_ELEMENT_WITH_ID_1); |
1065 | - |
1066 | - } |
1067 | - |
1068 | - |
1069 | - { |
1070 | - |
1071 | - |
1072 | - DECL_WITH_KIND(sctx, fn_element_with_id, |
1073 | - (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id"), |
1074 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1075 | - GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1076 | - GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1077 | - FunctionConsts::FN_ELEMENT_WITH_ID_2); |
1078 | - |
1079 | - } |
1080 | - |
1081 | - |
1082 | - { |
1083 | - |
1084 | - |
1085 | - DECL_WITH_KIND(sctx, fn_idref, |
1086 | - (createQName("http://www.w3.org/2005/xpath-functions","","idref"), |
1087 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1088 | - GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR), |
1089 | - FunctionConsts::FN_IDREF_1); |
1090 | - |
1091 | - } |
1092 | - |
1093 | - |
1094 | - { |
1095 | - |
1096 | - |
1097 | - DECL_WITH_KIND(sctx, fn_idref, |
1098 | - (createQName("http://www.w3.org/2005/xpath-functions","","idref"), |
1099 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1100 | - GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1101 | - GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR), |
1102 | - FunctionConsts::FN_IDREF_2); |
1103 | - |
1104 | - } |
1105 | - |
1106 | - |
1107 | - { |
1108 | - |
1109 | - |
1110 | - DECL_WITH_KIND(sctx, fn_doc, |
1111 | - (createQName("http://www.w3.org/2005/xpath-functions","","doc"), |
1112 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1113 | - GENV_TYPESYSTEM.DOCUMENT_UNTYPED_TYPE_QUESTION), |
1114 | - FunctionConsts::FN_DOC_1); |
1115 | - |
1116 | - } |
1117 | - |
1118 | - |
1119 | - { |
1120 | - |
1121 | - |
1122 | - DECL_WITH_KIND(sctx, fn_doc_available, |
1123 | - (createQName("http://www.w3.org/2005/xpath-functions","","doc-available"), |
1124 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1125 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1126 | - FunctionConsts::FN_DOC_AVAILABLE_1); |
1127 | - |
1128 | - } |
1129 | - |
1130 | - |
1131 | - { |
1132 | - |
1133 | - |
1134 | - DECL_WITH_KIND(sctx, fn_available_environment_variables_3_0, |
1135 | - (createQName("http://www.w3.org/2005/xpath-functions","","available-environment-variables"), |
1136 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
1137 | - FunctionConsts::FN_AVAILABLE_ENVIRONMENT_VARIABLES_0); |
1138 | - |
1139 | - } |
1140 | - |
1141 | - |
1142 | - { |
1143 | - |
1144 | - |
1145 | - DECL_WITH_KIND(sctx, fn_environment_variable_3_0, |
1146 | - (createQName("http://www.w3.org/2005/xpath-functions","","environment-variable"), |
1147 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1148 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
1149 | - FunctionConsts::FN_ENVIRONMENT_VARIABLE_1); |
1150 | - |
1151 | - } |
1152 | - |
1153 | - |
1154 | - { |
1155 | - |
1156 | - |
1157 | - DECL_WITH_KIND(sctx, fn_unparsed_text_3_0, |
1158 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text"), |
1159 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1160 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
1161 | - FunctionConsts::FN_UNPARSED_TEXT_1); |
1162 | - |
1163 | - } |
1164 | - |
1165 | - |
1166 | - { |
1167 | - |
1168 | - |
1169 | - DECL_WITH_KIND(sctx, fn_unparsed_text_3_0, |
1170 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text"), |
1171 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1172 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1173 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
1174 | - FunctionConsts::FN_UNPARSED_TEXT_2); |
1175 | - |
1176 | - } |
1177 | - |
1178 | - |
1179 | - { |
1180 | - |
1181 | - |
1182 | - DECL_WITH_KIND(sctx, fn_unparsed_text_available_3_0, |
1183 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-available"), |
1184 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1185 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
1186 | - FunctionConsts::FN_UNPARSED_TEXT_AVAILABLE_1); |
1187 | - |
1188 | - } |
1189 | - |
1190 | - |
1191 | - { |
1192 | - |
1193 | - |
1194 | - DECL_WITH_KIND(sctx, fn_unparsed_text_available_3_0, |
1195 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-available"), |
1196 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1197 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1198 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION), |
1199 | - FunctionConsts::FN_UNPARSED_TEXT_AVAILABLE_2); |
1200 | - |
1201 | - } |
1202 | - |
1203 | - |
1204 | - { |
1205 | - |
1206 | - |
1207 | - DECL_WITH_KIND(sctx, fn_unparsed_text_lines_3_0, |
1208 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-lines"), |
1209 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1210 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
1211 | - FunctionConsts::FN_UNPARSED_TEXT_LINES_1); |
1212 | - |
1213 | - } |
1214 | - |
1215 | - |
1216 | - { |
1217 | - |
1218 | - |
1219 | - DECL_WITH_KIND(sctx, fn_unparsed_text_lines_3_0, |
1220 | - (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-lines"), |
1221 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1222 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1223 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
1224 | - FunctionConsts::FN_UNPARSED_TEXT_LINES_2); |
1225 | - |
1226 | - } |
1227 | - |
1228 | -} |
1229 | - |
1230 | - |
1231 | -} |
1232 | - |
1233 | - |
1234 | - |
1235 | +/* |
1236 | + * Copyright 2006-2008 The FLWOR Foundation. |
1237 | + * |
1238 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
1239 | + * you may not use this file except in compliance with the License. |
1240 | + * You may obtain a copy of the License at |
1241 | + * |
1242 | + * http://www.apache.org/licenses/LICENSE-2.0 |
1243 | + * |
1244 | + * Unless required by applicable law or agreed to in writing, software |
1245 | + * distributed under the License is distributed on an "AS IS" BASIS, |
1246 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1247 | + * See the License for the specific language governing permissions and |
1248 | + * limitations under the License. |
1249 | + */ |
1250 | + |
1251 | +// ****************************************** |
1252 | +// * * |
1253 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
1254 | +// * SEE .xml FILE WITH SAME NAME * |
1255 | +// * * |
1256 | +// ****************************************** |
1257 | + |
1258 | + |
1259 | +#include "stdafx.h" |
1260 | +#include "runtime/sequences/sequences.h" |
1261 | +#include "functions/func_sequences.h" |
1262 | +#include "system/globalenv.h" |
1263 | +#include "types/typeops.h" |
1264 | +#include "compiler/expression/expr_base.h" |
1265 | + |
1266 | + |
1267 | +namespace zorba{ |
1268 | + |
1269 | + |
1270 | + |
1271 | +PlanIter_t op_concatenate::codegen( |
1272 | + CompilerCB*, |
1273 | + static_context* sctx, |
1274 | + const QueryLoc& loc, |
1275 | + std::vector<PlanIter_t>& argv, |
1276 | + expr& ann) const |
1277 | +{ |
1278 | + return new FnConcatIterator(sctx, loc, argv); |
1279 | +} |
1280 | + |
1281 | +PlanIter_t fn_index_of::codegen( |
1282 | + CompilerCB*, |
1283 | + static_context* sctx, |
1284 | + const QueryLoc& loc, |
1285 | + std::vector<PlanIter_t>& argv, |
1286 | + expr& ann) const |
1287 | +{ |
1288 | + return new FnIndexOfIterator(sctx, loc, argv); |
1289 | +} |
1290 | + |
1291 | +PlanIter_t fn_empty::codegen( |
1292 | + CompilerCB*, |
1293 | + static_context* sctx, |
1294 | + const QueryLoc& loc, |
1295 | + std::vector<PlanIter_t>& argv, |
1296 | + expr& ann) const |
1297 | +{ |
1298 | + return new FnEmptyIterator(sctx, loc, argv); |
1299 | +} |
1300 | + |
1301 | +PlanIter_t fn_exists::codegen( |
1302 | + CompilerCB*, |
1303 | + static_context* sctx, |
1304 | + const QueryLoc& loc, |
1305 | + std::vector<PlanIter_t>& argv, |
1306 | + expr& ann) const |
1307 | +{ |
1308 | + return new FnExistsIterator(sctx, loc, argv); |
1309 | +} |
1310 | + |
1311 | +PlanIter_t fn_distinct_values::codegen( |
1312 | + CompilerCB*, |
1313 | + static_context* sctx, |
1314 | + const QueryLoc& loc, |
1315 | + std::vector<PlanIter_t>& argv, |
1316 | + expr& ann) const |
1317 | +{ |
1318 | + return new FnDistinctValuesIterator(sctx, loc, argv); |
1319 | +} |
1320 | + |
1321 | +PlanIter_t fn_insert_before::codegen( |
1322 | + CompilerCB*, |
1323 | + static_context* sctx, |
1324 | + const QueryLoc& loc, |
1325 | + std::vector<PlanIter_t>& argv, |
1326 | + expr& ann) const |
1327 | +{ |
1328 | + return new FnInsertBeforeIterator(sctx, loc, argv); |
1329 | +} |
1330 | + |
1331 | +PlanIter_t fn_remove::codegen( |
1332 | + CompilerCB*, |
1333 | + static_context* sctx, |
1334 | + const QueryLoc& loc, |
1335 | + std::vector<PlanIter_t>& argv, |
1336 | + expr& ann) const |
1337 | +{ |
1338 | + return new FnRemoveIterator(sctx, loc, argv); |
1339 | +} |
1340 | + |
1341 | +PlanIter_t fn_reverse::codegen( |
1342 | + CompilerCB*, |
1343 | + static_context* sctx, |
1344 | + const QueryLoc& loc, |
1345 | + std::vector<PlanIter_t>& argv, |
1346 | + expr& ann) const |
1347 | +{ |
1348 | + return new FnReverseIterator(sctx, loc, argv); |
1349 | +} |
1350 | + |
1351 | + |
1352 | + |
1353 | + |
1354 | + |
1355 | +PlanIter_t fn_one_or_more::codegen( |
1356 | + CompilerCB*, |
1357 | + static_context* sctx, |
1358 | + const QueryLoc& loc, |
1359 | + std::vector<PlanIter_t>& argv, |
1360 | + expr& ann) const |
1361 | +{ |
1362 | + return new FnOneOrMoreIterator(sctx, loc, argv); |
1363 | +} |
1364 | + |
1365 | +PlanIter_t fn_deep_equal::codegen( |
1366 | + CompilerCB*, |
1367 | + static_context* sctx, |
1368 | + const QueryLoc& loc, |
1369 | + std::vector<PlanIter_t>& argv, |
1370 | + expr& ann) const |
1371 | +{ |
1372 | + return new FnDeepEqualIterator(sctx, loc, argv); |
1373 | +} |
1374 | + |
1375 | + |
1376 | +PlanIter_t fn_avg::codegen( |
1377 | + CompilerCB*, |
1378 | + static_context* sctx, |
1379 | + const QueryLoc& loc, |
1380 | + std::vector<PlanIter_t>& argv, |
1381 | + expr& ann) const |
1382 | +{ |
1383 | + return new FnAvgIterator(sctx, loc, argv); |
1384 | +} |
1385 | + |
1386 | +PlanIter_t fn_sum::codegen( |
1387 | + CompilerCB*, |
1388 | + static_context* sctx, |
1389 | + const QueryLoc& loc, |
1390 | + std::vector<PlanIter_t>& argv, |
1391 | + expr& ann) const |
1392 | +{ |
1393 | + return new FnSumIterator(sctx, loc, argv); |
1394 | +} |
1395 | + |
1396 | +PlanIter_t op_sum_double::codegen( |
1397 | + CompilerCB*, |
1398 | + static_context* sctx, |
1399 | + const QueryLoc& loc, |
1400 | + std::vector<PlanIter_t>& argv, |
1401 | + expr& ann) const |
1402 | +{ |
1403 | + return new FnSumDoubleIterator(sctx, loc, argv); |
1404 | +} |
1405 | + |
1406 | +PlanIter_t op_sum_float::codegen( |
1407 | + CompilerCB*, |
1408 | + static_context* sctx, |
1409 | + const QueryLoc& loc, |
1410 | + std::vector<PlanIter_t>& argv, |
1411 | + expr& ann) const |
1412 | +{ |
1413 | + return new FnSumFloatIterator(sctx, loc, argv); |
1414 | +} |
1415 | + |
1416 | +PlanIter_t op_sum_decimal::codegen( |
1417 | + CompilerCB*, |
1418 | + static_context* sctx, |
1419 | + const QueryLoc& loc, |
1420 | + std::vector<PlanIter_t>& argv, |
1421 | + expr& ann) const |
1422 | +{ |
1423 | + return new FnSumDecimalIterator(sctx, loc, argv); |
1424 | +} |
1425 | + |
1426 | +PlanIter_t op_sum_integer::codegen( |
1427 | + CompilerCB*, |
1428 | + static_context* sctx, |
1429 | + const QueryLoc& loc, |
1430 | + std::vector<PlanIter_t>& argv, |
1431 | + expr& ann) const |
1432 | +{ |
1433 | + return new FnSumIntegerIterator(sctx, loc, argv); |
1434 | +} |
1435 | + |
1436 | +PlanIter_t op_to::codegen( |
1437 | + CompilerCB*, |
1438 | + static_context* sctx, |
1439 | + const QueryLoc& loc, |
1440 | + std::vector<PlanIter_t>& argv, |
1441 | + expr& ann) const |
1442 | +{ |
1443 | + return new OpToIterator(sctx, loc, argv); |
1444 | +} |
1445 | + |
1446 | +PlanIter_t fn_id::codegen( |
1447 | + CompilerCB*, |
1448 | + static_context* sctx, |
1449 | + const QueryLoc& loc, |
1450 | + std::vector<PlanIter_t>& argv, |
1451 | + expr& ann) const |
1452 | +{ |
1453 | + return new FnIdIterator(sctx, loc, argv); |
1454 | +} |
1455 | + |
1456 | +PlanIter_t fn_element_with_id::codegen( |
1457 | + CompilerCB*, |
1458 | + static_context* sctx, |
1459 | + const QueryLoc& loc, |
1460 | + std::vector<PlanIter_t>& argv, |
1461 | + expr& ann) const |
1462 | +{ |
1463 | + return new FnElementWithIdIterator(sctx, loc, argv); |
1464 | +} |
1465 | + |
1466 | +PlanIter_t fn_idref::codegen( |
1467 | + CompilerCB*, |
1468 | + static_context* sctx, |
1469 | + const QueryLoc& loc, |
1470 | + std::vector<PlanIter_t>& argv, |
1471 | + expr& ann) const |
1472 | +{ |
1473 | + return new FnIdRefIterator(sctx, loc, argv); |
1474 | +} |
1475 | + |
1476 | +PlanIter_t fn_doc::codegen( |
1477 | + CompilerCB*, |
1478 | + static_context* sctx, |
1479 | + const QueryLoc& loc, |
1480 | + std::vector<PlanIter_t>& argv, |
1481 | + expr& ann) const |
1482 | +{ |
1483 | + return new FnDocIterator(sctx, loc, argv); |
1484 | +} |
1485 | + |
1486 | +PlanIter_t fn_doc_available::codegen( |
1487 | + CompilerCB*, |
1488 | + static_context* sctx, |
1489 | + const QueryLoc& loc, |
1490 | + std::vector<PlanIter_t>& argv, |
1491 | + expr& ann) const |
1492 | +{ |
1493 | + return new FnDocAvailableIterator(sctx, loc, argv); |
1494 | +} |
1495 | + |
1496 | +void populate_context_sequences(static_context* sctx) |
1497 | +{ |
1498 | + { |
1499 | + std::vector<xqtref_t> lParamTypes; |
1500 | + lParamTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR); |
1501 | + |
1502 | + DECL_WITH_KIND(sctx, op_concatenate, |
1503 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","concatenate"), |
1504 | + lParamTypes, GENV_TYPESYSTEM.ITEM_TYPE_STAR, true), |
1505 | + FunctionConsts::OP_CONCATENATE_N); |
1506 | + |
1507 | + } |
1508 | + |
1509 | + |
1510 | + { |
1511 | + |
1512 | + |
1513 | + DECL_WITH_KIND(sctx, fn_index_of, |
1514 | + (createQName("http://www.w3.org/2005/xpath-functions","","index-of"), |
1515 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1516 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, |
1517 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
1518 | + FunctionConsts::FN_INDEX_OF_2); |
1519 | + |
1520 | + } |
1521 | + |
1522 | + |
1523 | + { |
1524 | + |
1525 | + |
1526 | + DECL_WITH_KIND(sctx, fn_index_of, |
1527 | + (createQName("http://www.w3.org/2005/xpath-functions","","index-of"), |
1528 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1529 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, |
1530 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1531 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
1532 | + FunctionConsts::FN_INDEX_OF_3); |
1533 | + |
1534 | + } |
1535 | + |
1536 | + |
1537 | + { |
1538 | + |
1539 | + |
1540 | + DECL_WITH_KIND(sctx, fn_empty, |
1541 | + (createQName("http://www.w3.org/2005/xpath-functions","","empty"), |
1542 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1543 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1544 | + FunctionConsts::FN_EMPTY_1); |
1545 | + |
1546 | + } |
1547 | + |
1548 | + |
1549 | + { |
1550 | + |
1551 | + |
1552 | + DECL_WITH_KIND(sctx, fn_exists, |
1553 | + (createQName("http://www.w3.org/2005/xpath-functions","","exists"), |
1554 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1555 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1556 | + FunctionConsts::FN_EXISTS_1); |
1557 | + |
1558 | + } |
1559 | + |
1560 | + |
1561 | + { |
1562 | + |
1563 | + |
1564 | + DECL_WITH_KIND(sctx, fn_distinct_values, |
1565 | + (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values"), |
1566 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1567 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1568 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR), |
1569 | + FunctionConsts::FN_DISTINCT_VALUES_2); |
1570 | + |
1571 | + } |
1572 | + |
1573 | + |
1574 | + { |
1575 | + |
1576 | + |
1577 | + DECL_WITH_KIND(sctx, fn_distinct_values, |
1578 | + (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values"), |
1579 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1580 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR), |
1581 | + FunctionConsts::FN_DISTINCT_VALUES_1); |
1582 | + |
1583 | + } |
1584 | + |
1585 | + |
1586 | + { |
1587 | + |
1588 | + |
1589 | + DECL_WITH_KIND(sctx, fn_insert_before, |
1590 | + (createQName("http://www.w3.org/2005/xpath-functions","","insert-before"), |
1591 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1592 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1593 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1594 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1595 | + FunctionConsts::FN_INSERT_BEFORE_3); |
1596 | + |
1597 | + } |
1598 | + |
1599 | + |
1600 | + { |
1601 | + |
1602 | + |
1603 | + DECL_WITH_KIND(sctx, fn_remove, |
1604 | + (createQName("http://www.w3.org/2005/xpath-functions","","remove"), |
1605 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1606 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1607 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1608 | + FunctionConsts::FN_REMOVE_2); |
1609 | + |
1610 | + } |
1611 | + |
1612 | + |
1613 | + { |
1614 | + |
1615 | + |
1616 | + DECL_WITH_KIND(sctx, fn_reverse, |
1617 | + (createQName("http://www.w3.org/2005/xpath-functions","","reverse"), |
1618 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1619 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1620 | + FunctionConsts::FN_REVERSE_1); |
1621 | + |
1622 | + } |
1623 | + |
1624 | + |
1625 | + { |
1626 | + |
1627 | + |
1628 | + DECL_WITH_KIND(sctx, fn_subsequence, |
1629 | + (createQName("http://www.w3.org/2005/xpath-functions","","subsequence"), |
1630 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1631 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
1632 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1633 | + FunctionConsts::FN_SUBSEQUENCE_2); |
1634 | + |
1635 | + } |
1636 | + |
1637 | + |
1638 | + { |
1639 | + |
1640 | + |
1641 | + DECL_WITH_KIND(sctx, fn_subsequence, |
1642 | + (createQName("http://www.w3.org/2005/xpath-functions","","subsequence"), |
1643 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1644 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
1645 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
1646 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1647 | + FunctionConsts::FN_SUBSEQUENCE_3); |
1648 | + |
1649 | + } |
1650 | + |
1651 | + |
1652 | + { |
1653 | + |
1654 | + |
1655 | + DECL_WITH_KIND(sctx, op_zorba_subsequence_int, |
1656 | + (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int"), |
1657 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1658 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1659 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1660 | + FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_2); |
1661 | + |
1662 | + } |
1663 | + |
1664 | + |
1665 | + { |
1666 | + |
1667 | + |
1668 | + DECL_WITH_KIND(sctx, op_zorba_subsequence_int, |
1669 | + (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int"), |
1670 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1671 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1672 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1673 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR), |
1674 | + FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_3); |
1675 | + |
1676 | + } |
1677 | + |
1678 | + |
1679 | + { |
1680 | + |
1681 | + |
1682 | + DECL_WITH_KIND(sctx, op_zorba_sequence_point_access, |
1683 | + (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","sequence-point-access"), |
1684 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1685 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
1686 | + GENV_TYPESYSTEM.ITEM_TYPE_QUESTION), |
1687 | + FunctionConsts::OP_ZORBA_SEQUENCE_POINT_ACCESS_2); |
1688 | + |
1689 | + } |
1690 | + |
1691 | + |
1692 | + { |
1693 | + |
1694 | + |
1695 | + DECL_WITH_KIND(sctx, fn_zero_or_one, |
1696 | + (createQName("http://www.w3.org/2005/xpath-functions","","zero-or-one"), |
1697 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1698 | + GENV_TYPESYSTEM.ITEM_TYPE_QUESTION), |
1699 | + FunctionConsts::FN_ZERO_OR_ONE_1); |
1700 | + |
1701 | + } |
1702 | + |
1703 | + |
1704 | + { |
1705 | + |
1706 | + |
1707 | + DECL_WITH_KIND(sctx, fn_one_or_more, |
1708 | + (createQName("http://www.w3.org/2005/xpath-functions","","one-or-more"), |
1709 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1710 | + GENV_TYPESYSTEM.ITEM_TYPE_PLUS), |
1711 | + FunctionConsts::FN_ONE_OR_MORE_1); |
1712 | + |
1713 | + } |
1714 | + |
1715 | + |
1716 | + { |
1717 | + |
1718 | + |
1719 | + DECL_WITH_KIND(sctx, fn_deep_equal, |
1720 | + (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal"), |
1721 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1722 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1723 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1724 | + FunctionConsts::FN_DEEP_EQUAL_2); |
1725 | + |
1726 | + } |
1727 | + |
1728 | + |
1729 | + { |
1730 | + |
1731 | + |
1732 | + DECL_WITH_KIND(sctx, fn_deep_equal, |
1733 | + (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal"), |
1734 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1735 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1736 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
1737 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1738 | + FunctionConsts::FN_DEEP_EQUAL_3); |
1739 | + |
1740 | + } |
1741 | + |
1742 | + |
1743 | + { |
1744 | + |
1745 | + |
1746 | + DECL_WITH_KIND(sctx, fn_count, |
1747 | + (createQName("http://www.w3.org/2005/xpath-functions","","count"), |
1748 | + GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
1749 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
1750 | + FunctionConsts::FN_COUNT_1); |
1751 | + |
1752 | + } |
1753 | + |
1754 | + |
1755 | + { |
1756 | + |
1757 | + |
1758 | + DECL_WITH_KIND(sctx, fn_avg, |
1759 | + (createQName("http://www.w3.org/2005/xpath-functions","","avg"), |
1760 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1761 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1762 | + FunctionConsts::FN_AVG_1); |
1763 | + |
1764 | + } |
1765 | + |
1766 | + |
1767 | + { |
1768 | + |
1769 | + |
1770 | + DECL_WITH_KIND(sctx, fn_sum, |
1771 | + (createQName("http://www.w3.org/2005/xpath-functions","","sum"), |
1772 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1773 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE), |
1774 | + FunctionConsts::FN_SUM_1); |
1775 | + |
1776 | + } |
1777 | + |
1778 | + |
1779 | + { |
1780 | + |
1781 | + |
1782 | + DECL_WITH_KIND(sctx, fn_sum, |
1783 | + (createQName("http://www.w3.org/2005/xpath-functions","","sum"), |
1784 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, |
1785 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1786 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1787 | + FunctionConsts::FN_SUM_2); |
1788 | + |
1789 | + } |
1790 | + |
1791 | + |
1792 | + { |
1793 | + |
1794 | + |
1795 | + DECL_WITH_KIND(sctx, op_sum_double, |
1796 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double"), |
1797 | + GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, |
1798 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
1799 | + FunctionConsts::OP_SUM_DOUBLE_1); |
1800 | + |
1801 | + } |
1802 | + |
1803 | + |
1804 | + { |
1805 | + |
1806 | + |
1807 | + DECL_WITH_KIND(sctx, op_sum_double, |
1808 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double"), |
1809 | + GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, |
1810 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1811 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1812 | + FunctionConsts::OP_SUM_DOUBLE_2); |
1813 | + |
1814 | + } |
1815 | + |
1816 | + |
1817 | + { |
1818 | + |
1819 | + |
1820 | + DECL_WITH_KIND(sctx, op_sum_float, |
1821 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float"), |
1822 | + GENV_TYPESYSTEM.FLOAT_TYPE_STAR, |
1823 | + GENV_TYPESYSTEM.FLOAT_TYPE_ONE), |
1824 | + FunctionConsts::OP_SUM_FLOAT_1); |
1825 | + |
1826 | + } |
1827 | + |
1828 | + |
1829 | + { |
1830 | + |
1831 | + |
1832 | + DECL_WITH_KIND(sctx, op_sum_float, |
1833 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float"), |
1834 | + GENV_TYPESYSTEM.FLOAT_TYPE_STAR, |
1835 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1836 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1837 | + FunctionConsts::OP_SUM_FLOAT_2); |
1838 | + |
1839 | + } |
1840 | + |
1841 | + |
1842 | + { |
1843 | + |
1844 | + |
1845 | + DECL_WITH_KIND(sctx, op_sum_decimal, |
1846 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal"), |
1847 | + GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, |
1848 | + GENV_TYPESYSTEM.DECIMAL_TYPE_ONE), |
1849 | + FunctionConsts::OP_SUM_DECIMAL_1); |
1850 | + |
1851 | + } |
1852 | + |
1853 | + |
1854 | + { |
1855 | + |
1856 | + |
1857 | + DECL_WITH_KIND(sctx, op_sum_decimal, |
1858 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal"), |
1859 | + GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, |
1860 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1861 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1862 | + FunctionConsts::OP_SUM_DECIMAL_2); |
1863 | + |
1864 | + } |
1865 | + |
1866 | + |
1867 | + { |
1868 | + |
1869 | + |
1870 | + DECL_WITH_KIND(sctx, op_sum_integer, |
1871 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer"), |
1872 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
1873 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
1874 | + FunctionConsts::OP_SUM_INTEGER_1); |
1875 | + |
1876 | + } |
1877 | + |
1878 | + |
1879 | + { |
1880 | + |
1881 | + |
1882 | + DECL_WITH_KIND(sctx, op_sum_integer, |
1883 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer"), |
1884 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
1885 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, |
1886 | + GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION), |
1887 | + FunctionConsts::OP_SUM_INTEGER_2); |
1888 | + |
1889 | + } |
1890 | + |
1891 | + |
1892 | + { |
1893 | + |
1894 | + |
1895 | + DECL_WITH_KIND(sctx, op_to, |
1896 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","to"), |
1897 | + GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, |
1898 | + GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, |
1899 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
1900 | + FunctionConsts::OP_TO_2); |
1901 | + |
1902 | + } |
1903 | + |
1904 | + |
1905 | + { |
1906 | + |
1907 | + |
1908 | + DECL_WITH_KIND(sctx, fn_id, |
1909 | + (createQName("http://www.w3.org/2005/xpath-functions","","id"), |
1910 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1911 | + GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1912 | + FunctionConsts::FN_ID_1); |
1913 | + |
1914 | + } |
1915 | + |
1916 | + |
1917 | + { |
1918 | + |
1919 | + |
1920 | + DECL_WITH_KIND(sctx, fn_id, |
1921 | + (createQName("http://www.w3.org/2005/xpath-functions","","id"), |
1922 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1923 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1924 | + GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1925 | + FunctionConsts::FN_ID_2); |
1926 | + |
1927 | + } |
1928 | + |
1929 | + |
1930 | + { |
1931 | + |
1932 | + |
1933 | + DECL_WITH_KIND(sctx, fn_element_with_id, |
1934 | + (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id"), |
1935 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1936 | + GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1937 | + FunctionConsts::FN_ELEMENT_WITH_ID_1); |
1938 | + |
1939 | + } |
1940 | + |
1941 | + |
1942 | + { |
1943 | + |
1944 | + |
1945 | + DECL_WITH_KIND(sctx, fn_element_with_id, |
1946 | + (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id"), |
1947 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1948 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1949 | + GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
1950 | + FunctionConsts::FN_ELEMENT_WITH_ID_2); |
1951 | + |
1952 | + } |
1953 | + |
1954 | + |
1955 | + { |
1956 | + |
1957 | + |
1958 | + DECL_WITH_KIND(sctx, fn_idref, |
1959 | + (createQName("http://www.w3.org/2005/xpath-functions","","idref"), |
1960 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1961 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR), |
1962 | + FunctionConsts::FN_IDREF_1); |
1963 | + |
1964 | + } |
1965 | + |
1966 | + |
1967 | + { |
1968 | + |
1969 | + |
1970 | + DECL_WITH_KIND(sctx, fn_idref, |
1971 | + (createQName("http://www.w3.org/2005/xpath-functions","","idref"), |
1972 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
1973 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
1974 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR), |
1975 | + FunctionConsts::FN_IDREF_2); |
1976 | + |
1977 | + } |
1978 | + |
1979 | + |
1980 | + { |
1981 | + |
1982 | + |
1983 | + DECL_WITH_KIND(sctx, fn_doc, |
1984 | + (createQName("http://www.w3.org/2005/xpath-functions","","doc"), |
1985 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1986 | + GENV_TYPESYSTEM.DOCUMENT_UNTYPED_TYPE_QUESTION), |
1987 | + FunctionConsts::FN_DOC_1); |
1988 | + |
1989 | + } |
1990 | + |
1991 | + |
1992 | + { |
1993 | + |
1994 | + |
1995 | + DECL_WITH_KIND(sctx, fn_doc_available, |
1996 | + (createQName("http://www.w3.org/2005/xpath-functions","","doc-available"), |
1997 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
1998 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1999 | + FunctionConsts::FN_DOC_AVAILABLE_1); |
2000 | + |
2001 | + } |
2002 | + |
2003 | +} |
2004 | + |
2005 | + |
2006 | +} |
2007 | + |
2008 | + |
2009 | + |
2010 | |
2011 | === modified file 'src/functions/pregenerated/func_sequences.h' |
2012 | --- src/functions/pregenerated/func_sequences.h 2012-04-24 12:39:38 +0000 |
2013 | +++ src/functions/pregenerated/func_sequences.h 2012-05-02 07:18:18 +0000 |
2014 | @@ -1,708 +1,633 @@ |
2015 | -/* |
2016 | - * Copyright 2006-2008 The FLWOR Foundation. |
2017 | - * |
2018 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
2019 | - * you may not use this file except in compliance with the License. |
2020 | - * You may obtain a copy of the License at |
2021 | - * |
2022 | - * http://www.apache.org/licenses/LICENSE-2.0 |
2023 | - * |
2024 | - * Unless required by applicable law or agreed to in writing, software |
2025 | - * distributed under the License is distributed on an "AS IS" BASIS, |
2026 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2027 | - * See the License for the specific language governing permissions and |
2028 | - * limitations under the License. |
2029 | - */ |
2030 | - |
2031 | -// ****************************************** |
2032 | -// * * |
2033 | -// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
2034 | -// * SEE .xml FILE WITH SAME NAME * |
2035 | -// * * |
2036 | -// ****************************************** |
2037 | - |
2038 | - |
2039 | -#ifndef ZORBA_FUNCTIONS_SEQUENCES_H |
2040 | -#define ZORBA_FUNCTIONS_SEQUENCES_H |
2041 | - |
2042 | - |
2043 | -#include "common/shared_types.h" |
2044 | -#include "functions/function_impl.h" |
2045 | - |
2046 | - |
2047 | -namespace zorba { |
2048 | - |
2049 | - |
2050 | -void populate_context_sequences(static_context* sctx); |
2051 | - |
2052 | - |
2053 | - |
2054 | - |
2055 | -//op:concatenate |
2056 | -class op_concatenate : public function |
2057 | -{ |
2058 | -public: |
2059 | - op_concatenate(const signature& sig, FunctionConsts::FunctionKind kind) |
2060 | - : |
2061 | - function(sig, kind) |
2062 | - { |
2063 | - |
2064 | - } |
2065 | - |
2066 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2067 | - |
2068 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2069 | - |
2070 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2071 | - |
2072 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2073 | - |
2074 | - CODEGEN_DECL(); |
2075 | -}; |
2076 | - |
2077 | - |
2078 | -//fn:index-of |
2079 | -class fn_index_of : public function |
2080 | -{ |
2081 | -public: |
2082 | - fn_index_of(const signature& sig, FunctionConsts::FunctionKind kind) |
2083 | - : |
2084 | - function(sig, kind) |
2085 | - { |
2086 | - |
2087 | - } |
2088 | - |
2089 | - CODEGEN_DECL(); |
2090 | -}; |
2091 | - |
2092 | - |
2093 | -//fn:empty |
2094 | -class fn_empty : public function |
2095 | -{ |
2096 | -public: |
2097 | - fn_empty(const signature& sig, FunctionConsts::FunctionKind kind) |
2098 | - : |
2099 | - function(sig, kind) |
2100 | - { |
2101 | - |
2102 | - } |
2103 | - |
2104 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2105 | - |
2106 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2107 | - |
2108 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2109 | - |
2110 | - CODEGEN_DECL(); |
2111 | -}; |
2112 | - |
2113 | - |
2114 | -//fn:exists |
2115 | -class fn_exists : public function |
2116 | -{ |
2117 | -public: |
2118 | - fn_exists(const signature& sig, FunctionConsts::FunctionKind kind) |
2119 | - : |
2120 | - function(sig, kind) |
2121 | - { |
2122 | - |
2123 | - } |
2124 | - |
2125 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2126 | - |
2127 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2128 | - |
2129 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2130 | - |
2131 | - CODEGEN_DECL(); |
2132 | -}; |
2133 | - |
2134 | - |
2135 | -//fn:distinct-values |
2136 | -class fn_distinct_values : public function |
2137 | -{ |
2138 | -public: |
2139 | - fn_distinct_values(const signature& sig, FunctionConsts::FunctionKind kind) |
2140 | - : |
2141 | - function(sig, kind) |
2142 | - { |
2143 | - |
2144 | - } |
2145 | - |
2146 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2147 | - |
2148 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2149 | - |
2150 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2151 | - |
2152 | - CODEGEN_DECL(); |
2153 | -}; |
2154 | - |
2155 | - |
2156 | -//fn:insert-before |
2157 | -class fn_insert_before : public function |
2158 | -{ |
2159 | -public: |
2160 | - fn_insert_before(const signature& sig, FunctionConsts::FunctionKind kind) |
2161 | - : |
2162 | - function(sig, kind) |
2163 | - { |
2164 | - |
2165 | - } |
2166 | - |
2167 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2168 | - |
2169 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2170 | - |
2171 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2172 | - |
2173 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2174 | - |
2175 | - CODEGEN_DECL(); |
2176 | -}; |
2177 | - |
2178 | - |
2179 | -//fn:remove |
2180 | -class fn_remove : public function |
2181 | -{ |
2182 | -public: |
2183 | - fn_remove(const signature& sig, FunctionConsts::FunctionKind kind) |
2184 | - : |
2185 | - function(sig, kind) |
2186 | - { |
2187 | - |
2188 | - } |
2189 | - |
2190 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2191 | - |
2192 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2193 | - |
2194 | - bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2195 | - |
2196 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2197 | - |
2198 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2199 | - |
2200 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2201 | - |
2202 | - CODEGEN_DECL(); |
2203 | -}; |
2204 | - |
2205 | - |
2206 | -//fn:reverse |
2207 | -class fn_reverse : public function |
2208 | -{ |
2209 | -public: |
2210 | - fn_reverse(const signature& sig, FunctionConsts::FunctionKind kind) |
2211 | - : |
2212 | - function(sig, kind) |
2213 | - { |
2214 | - |
2215 | - } |
2216 | - |
2217 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2218 | - |
2219 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2220 | - |
2221 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2222 | - |
2223 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2224 | - |
2225 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2226 | - |
2227 | - CODEGEN_DECL(); |
2228 | -}; |
2229 | - |
2230 | - |
2231 | -//fn:subsequence |
2232 | -class fn_subsequence : public function |
2233 | -{ |
2234 | -public: |
2235 | - fn_subsequence(const signature& sig, FunctionConsts::FunctionKind kind) |
2236 | - : |
2237 | - function(sig, kind) |
2238 | - { |
2239 | - |
2240 | - } |
2241 | - |
2242 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2243 | - |
2244 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2245 | - |
2246 | - bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2247 | - |
2248 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2249 | - |
2250 | - bool serializable() const { return true; } |
2251 | - |
2252 | - CODEGEN_DECL(); |
2253 | -}; |
2254 | - |
2255 | - |
2256 | -//op-zorba:subsequence-int |
2257 | -class op_zorba_subsequence_int : public function |
2258 | -{ |
2259 | -public: |
2260 | - op_zorba_subsequence_int(const signature& sig, FunctionConsts::FunctionKind kind) |
2261 | - : |
2262 | - function(sig, kind) |
2263 | - { |
2264 | - |
2265 | - } |
2266 | - |
2267 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2268 | - |
2269 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2270 | - |
2271 | - bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2272 | - |
2273 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2274 | - |
2275 | - CODEGEN_DECL(); |
2276 | -}; |
2277 | - |
2278 | - |
2279 | -//op-zorba:sequence-point-access |
2280 | -class op_zorba_sequence_point_access : public function |
2281 | -{ |
2282 | -public: |
2283 | - op_zorba_sequence_point_access(const signature& sig, FunctionConsts::FunctionKind kind) |
2284 | - : |
2285 | - function(sig, kind) |
2286 | - { |
2287 | - |
2288 | - } |
2289 | - |
2290 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2291 | - |
2292 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2293 | - |
2294 | - bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2295 | - |
2296 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2297 | - |
2298 | - CODEGEN_DECL(); |
2299 | -}; |
2300 | - |
2301 | - |
2302 | -//fn:zero-or-one |
2303 | -class fn_zero_or_one : public function |
2304 | -{ |
2305 | -public: |
2306 | - fn_zero_or_one(const signature& sig, FunctionConsts::FunctionKind kind) |
2307 | - : |
2308 | - function(sig, kind) |
2309 | - { |
2310 | - |
2311 | - } |
2312 | - |
2313 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2314 | - |
2315 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2316 | - |
2317 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2318 | - |
2319 | - CODEGEN_DECL(); |
2320 | -}; |
2321 | - |
2322 | - |
2323 | -//fn:one-or-more |
2324 | -class fn_one_or_more : public function |
2325 | -{ |
2326 | -public: |
2327 | - fn_one_or_more(const signature& sig, FunctionConsts::FunctionKind kind) |
2328 | - : |
2329 | - function(sig, kind) |
2330 | - { |
2331 | - |
2332 | - } |
2333 | - |
2334 | - xqtref_t getReturnType(const fo_expr* caller) const; |
2335 | - |
2336 | - bool isMap(ulong producer) const { return producer == 0; } |
2337 | - |
2338 | - bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2339 | - |
2340 | - bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2341 | - |
2342 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2343 | - |
2344 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2345 | - |
2346 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2347 | - |
2348 | - CODEGEN_DECL(); |
2349 | -}; |
2350 | - |
2351 | - |
2352 | -//fn:deep-equal |
2353 | -class fn_deep_equal : public function |
2354 | -{ |
2355 | -public: |
2356 | - fn_deep_equal(const signature& sig, FunctionConsts::FunctionKind kind) |
2357 | - : |
2358 | - function(sig, kind) |
2359 | - { |
2360 | - |
2361 | - } |
2362 | - |
2363 | - bool accessesDynCtx() const { return true; } |
2364 | - |
2365 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2366 | - |
2367 | - CODEGEN_DECL(); |
2368 | -}; |
2369 | - |
2370 | - |
2371 | -//fn:count |
2372 | -class fn_count : public function |
2373 | -{ |
2374 | -public: |
2375 | - fn_count(const signature& sig, FunctionConsts::FunctionKind kind) |
2376 | - : |
2377 | - function(sig, kind) |
2378 | - { |
2379 | - |
2380 | - } |
2381 | - |
2382 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2383 | - |
2384 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2385 | - |
2386 | - CODEGEN_DECL(); |
2387 | -}; |
2388 | - |
2389 | - |
2390 | -//fn:avg |
2391 | -class fn_avg : public function |
2392 | -{ |
2393 | -public: |
2394 | - fn_avg(const signature& sig, FunctionConsts::FunctionKind kind) |
2395 | - : |
2396 | - function(sig, kind) |
2397 | - { |
2398 | - |
2399 | - } |
2400 | - |
2401 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2402 | - |
2403 | - CODEGEN_DECL(); |
2404 | -}; |
2405 | - |
2406 | - |
2407 | -//fn:sum |
2408 | -class fn_sum : public function |
2409 | -{ |
2410 | -public: |
2411 | - fn_sum(const signature& sig, FunctionConsts::FunctionKind kind) |
2412 | - : |
2413 | - function(sig, kind) |
2414 | - { |
2415 | - |
2416 | - } |
2417 | - |
2418 | - bool specializable() const { return true; } |
2419 | - |
2420 | - function* specialize( static_context* sctx, |
2421 | - const std::vector<xqtref_t>& argTypes) const; |
2422 | - |
2423 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2424 | - |
2425 | - CODEGEN_DECL(); |
2426 | -}; |
2427 | - |
2428 | - |
2429 | -//op:sum_double |
2430 | -class op_sum_double : public function |
2431 | -{ |
2432 | -public: |
2433 | - op_sum_double(const signature& sig, FunctionConsts::FunctionKind kind) |
2434 | - : |
2435 | - function(sig, kind) |
2436 | - { |
2437 | - |
2438 | - } |
2439 | - |
2440 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2441 | - |
2442 | - CODEGEN_DECL(); |
2443 | -}; |
2444 | - |
2445 | - |
2446 | -//op:sum_float |
2447 | -class op_sum_float : public function |
2448 | -{ |
2449 | -public: |
2450 | - op_sum_float(const signature& sig, FunctionConsts::FunctionKind kind) |
2451 | - : |
2452 | - function(sig, kind) |
2453 | - { |
2454 | - |
2455 | - } |
2456 | - |
2457 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2458 | - |
2459 | - CODEGEN_DECL(); |
2460 | -}; |
2461 | - |
2462 | - |
2463 | -//op:sum_decimal |
2464 | -class op_sum_decimal : public function |
2465 | -{ |
2466 | -public: |
2467 | - op_sum_decimal(const signature& sig, FunctionConsts::FunctionKind kind) |
2468 | - : |
2469 | - function(sig, kind) |
2470 | - { |
2471 | - |
2472 | - } |
2473 | - |
2474 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2475 | - |
2476 | - CODEGEN_DECL(); |
2477 | -}; |
2478 | - |
2479 | - |
2480 | -//op:sum_integer |
2481 | -class op_sum_integer : public function |
2482 | -{ |
2483 | -public: |
2484 | - op_sum_integer(const signature& sig, FunctionConsts::FunctionKind kind) |
2485 | - : |
2486 | - function(sig, kind) |
2487 | - { |
2488 | - |
2489 | - } |
2490 | - |
2491 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2492 | - |
2493 | - CODEGEN_DECL(); |
2494 | -}; |
2495 | - |
2496 | - |
2497 | -//op:to |
2498 | -class op_to : public function |
2499 | -{ |
2500 | -public: |
2501 | - op_to(const signature& sig, FunctionConsts::FunctionKind kind) |
2502 | - : |
2503 | - function(sig, kind) |
2504 | - { |
2505 | - |
2506 | - } |
2507 | - |
2508 | - CODEGEN_DECL(); |
2509 | -}; |
2510 | - |
2511 | - |
2512 | -//fn:id |
2513 | -class fn_id : public function |
2514 | -{ |
2515 | -public: |
2516 | - fn_id(const signature& sig, FunctionConsts::FunctionKind kind) |
2517 | - : |
2518 | - function(sig, kind) |
2519 | - { |
2520 | - |
2521 | - } |
2522 | - |
2523 | - FunctionConsts::AnnotationValue producesDistinctNodes() const |
2524 | - { |
2525 | - return FunctionConsts::YES; |
2526 | - } |
2527 | - |
2528 | - FunctionConsts::AnnotationValue producesSortedNodes() const |
2529 | - { |
2530 | - return FunctionConsts::YES; |
2531 | - } |
2532 | - |
2533 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2534 | - |
2535 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2536 | - |
2537 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
2538 | - |
2539 | - CODEGEN_DECL(); |
2540 | -}; |
2541 | - |
2542 | - |
2543 | -//fn:element-with-id |
2544 | -class fn_element_with_id : public function |
2545 | -{ |
2546 | -public: |
2547 | - fn_element_with_id(const signature& sig, FunctionConsts::FunctionKind kind) |
2548 | - : |
2549 | - function(sig, kind) |
2550 | - { |
2551 | - |
2552 | - } |
2553 | - |
2554 | - FunctionConsts::AnnotationValue producesDistinctNodes() const |
2555 | - { |
2556 | - return FunctionConsts::YES; |
2557 | - } |
2558 | - |
2559 | - FunctionConsts::AnnotationValue producesSortedNodes() const |
2560 | - { |
2561 | - return FunctionConsts::YES; |
2562 | - } |
2563 | - |
2564 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2565 | - |
2566 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2567 | - |
2568 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
2569 | - |
2570 | - CODEGEN_DECL(); |
2571 | -}; |
2572 | - |
2573 | - |
2574 | -//fn:idref |
2575 | -class fn_idref : public function |
2576 | -{ |
2577 | -public: |
2578 | - fn_idref(const signature& sig, FunctionConsts::FunctionKind kind) |
2579 | - : |
2580 | - function(sig, kind) |
2581 | - { |
2582 | - |
2583 | - } |
2584 | - |
2585 | - FunctionConsts::AnnotationValue producesDistinctNodes() const |
2586 | - { |
2587 | - return FunctionConsts::YES; |
2588 | - } |
2589 | - |
2590 | - FunctionConsts::AnnotationValue producesSortedNodes() const |
2591 | - { |
2592 | - return FunctionConsts::YES; |
2593 | - } |
2594 | - |
2595 | - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2596 | - |
2597 | - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2598 | - |
2599 | - bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
2600 | - |
2601 | - CODEGEN_DECL(); |
2602 | -}; |
2603 | - |
2604 | - |
2605 | -//fn:doc |
2606 | -class fn_doc : public function |
2607 | -{ |
2608 | -public: |
2609 | - fn_doc(const signature& sig, FunctionConsts::FunctionKind kind) |
2610 | - : |
2611 | - function(sig, kind) |
2612 | - { |
2613 | - |
2614 | - } |
2615 | - |
2616 | - bool accessesDynCtx() const { return true; } |
2617 | - |
2618 | - bool isSource() const { return true; } |
2619 | - |
2620 | - CODEGEN_DECL(); |
2621 | -}; |
2622 | - |
2623 | - |
2624 | -//fn:doc-available |
2625 | -class fn_doc_available : public function |
2626 | -{ |
2627 | -public: |
2628 | - fn_doc_available(const signature& sig, FunctionConsts::FunctionKind kind) |
2629 | - : |
2630 | - function(sig, kind) |
2631 | - { |
2632 | - |
2633 | - } |
2634 | - |
2635 | - CODEGEN_DECL(); |
2636 | -}; |
2637 | - |
2638 | - |
2639 | -//fn:available-environment-variables |
2640 | -class fn_available_environment_variables_3_0 : public function |
2641 | -{ |
2642 | -public: |
2643 | - fn_available_environment_variables_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
2644 | - : |
2645 | - function(sig, kind) |
2646 | - { |
2647 | -theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
2648 | - } |
2649 | - |
2650 | - CODEGEN_DECL(); |
2651 | -}; |
2652 | - |
2653 | - |
2654 | -//fn:environment-variable |
2655 | -class fn_environment_variable_3_0 : public function |
2656 | -{ |
2657 | -public: |
2658 | - fn_environment_variable_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
2659 | - : |
2660 | - function(sig, kind) |
2661 | - { |
2662 | -theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
2663 | - } |
2664 | - |
2665 | - CODEGEN_DECL(); |
2666 | -}; |
2667 | - |
2668 | - |
2669 | -//fn:unparsed-text |
2670 | -class fn_unparsed_text_3_0 : public function |
2671 | -{ |
2672 | -public: |
2673 | - fn_unparsed_text_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
2674 | - : |
2675 | - function(sig, kind) |
2676 | - { |
2677 | -theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
2678 | - } |
2679 | - |
2680 | - CODEGEN_DECL(); |
2681 | -}; |
2682 | - |
2683 | - |
2684 | -//fn:unparsed-text-available |
2685 | -class fn_unparsed_text_available_3_0 : public function |
2686 | -{ |
2687 | -public: |
2688 | - fn_unparsed_text_available_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
2689 | - : |
2690 | - function(sig, kind) |
2691 | - { |
2692 | -theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
2693 | - } |
2694 | - |
2695 | - CODEGEN_DECL(); |
2696 | -}; |
2697 | - |
2698 | - |
2699 | -//fn:unparsed-text-lines |
2700 | -class fn_unparsed_text_lines_3_0 : public function |
2701 | -{ |
2702 | -public: |
2703 | - fn_unparsed_text_lines_3_0(const signature& sig, FunctionConsts::FunctionKind kind) |
2704 | - : |
2705 | - function(sig, kind) |
2706 | - { |
2707 | -theXQueryVersion = StaticContextConsts::xquery_version_3_0; |
2708 | - } |
2709 | - |
2710 | - CODEGEN_DECL(); |
2711 | -}; |
2712 | - |
2713 | - |
2714 | -} //namespace zorba |
2715 | - |
2716 | - |
2717 | -#endif |
2718 | -/* |
2719 | - * Local variables: |
2720 | - * mode: c++ |
2721 | - * End: |
2722 | - */ |
2723 | +/* |
2724 | + * Copyright 2006-2008 The FLWOR Foundation. |
2725 | + * |
2726 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
2727 | + * you may not use this file except in compliance with the License. |
2728 | + * You may obtain a copy of the License at |
2729 | + * |
2730 | + * http://www.apache.org/licenses/LICENSE-2.0 |
2731 | + * |
2732 | + * Unless required by applicable law or agreed to in writing, software |
2733 | + * distributed under the License is distributed on an "AS IS" BASIS, |
2734 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2735 | + * See the License for the specific language governing permissions and |
2736 | + * limitations under the License. |
2737 | + */ |
2738 | + |
2739 | +// ****************************************** |
2740 | +// * * |
2741 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
2742 | +// * SEE .xml FILE WITH SAME NAME * |
2743 | +// * * |
2744 | +// ****************************************** |
2745 | + |
2746 | + |
2747 | +#ifndef ZORBA_FUNCTIONS_SEQUENCES_H |
2748 | +#define ZORBA_FUNCTIONS_SEQUENCES_H |
2749 | + |
2750 | + |
2751 | +#include "common/shared_types.h" |
2752 | +#include "functions/function_impl.h" |
2753 | + |
2754 | + |
2755 | +namespace zorba { |
2756 | + |
2757 | + |
2758 | +void populate_context_sequences(static_context* sctx); |
2759 | + |
2760 | + |
2761 | + |
2762 | + |
2763 | +//op:concatenate |
2764 | +class op_concatenate : public function |
2765 | +{ |
2766 | +public: |
2767 | + op_concatenate(const signature& sig, FunctionConsts::FunctionKind kind) |
2768 | + : |
2769 | + function(sig, kind) |
2770 | + { |
2771 | + |
2772 | + } |
2773 | + |
2774 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2775 | + |
2776 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2777 | + |
2778 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2779 | + |
2780 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2781 | + |
2782 | + CODEGEN_DECL(); |
2783 | +}; |
2784 | + |
2785 | + |
2786 | +//fn:index-of |
2787 | +class fn_index_of : public function |
2788 | +{ |
2789 | +public: |
2790 | + fn_index_of(const signature& sig, FunctionConsts::FunctionKind kind) |
2791 | + : |
2792 | + function(sig, kind) |
2793 | + { |
2794 | + |
2795 | + } |
2796 | + |
2797 | + CODEGEN_DECL(); |
2798 | +}; |
2799 | + |
2800 | + |
2801 | +//fn:empty |
2802 | +class fn_empty : public function |
2803 | +{ |
2804 | +public: |
2805 | + fn_empty(const signature& sig, FunctionConsts::FunctionKind kind) |
2806 | + : |
2807 | + function(sig, kind) |
2808 | + { |
2809 | + |
2810 | + } |
2811 | + |
2812 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2813 | + |
2814 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2815 | + |
2816 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2817 | + |
2818 | + CODEGEN_DECL(); |
2819 | +}; |
2820 | + |
2821 | + |
2822 | +//fn:exists |
2823 | +class fn_exists : public function |
2824 | +{ |
2825 | +public: |
2826 | + fn_exists(const signature& sig, FunctionConsts::FunctionKind kind) |
2827 | + : |
2828 | + function(sig, kind) |
2829 | + { |
2830 | + |
2831 | + } |
2832 | + |
2833 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2834 | + |
2835 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2836 | + |
2837 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2838 | + |
2839 | + CODEGEN_DECL(); |
2840 | +}; |
2841 | + |
2842 | + |
2843 | +//fn:distinct-values |
2844 | +class fn_distinct_values : public function |
2845 | +{ |
2846 | +public: |
2847 | + fn_distinct_values(const signature& sig, FunctionConsts::FunctionKind kind) |
2848 | + : |
2849 | + function(sig, kind) |
2850 | + { |
2851 | + |
2852 | + } |
2853 | + |
2854 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2855 | + |
2856 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2857 | + |
2858 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2859 | + |
2860 | + CODEGEN_DECL(); |
2861 | +}; |
2862 | + |
2863 | + |
2864 | +//fn:insert-before |
2865 | +class fn_insert_before : public function |
2866 | +{ |
2867 | +public: |
2868 | + fn_insert_before(const signature& sig, FunctionConsts::FunctionKind kind) |
2869 | + : |
2870 | + function(sig, kind) |
2871 | + { |
2872 | + |
2873 | + } |
2874 | + |
2875 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2876 | + |
2877 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2878 | + |
2879 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2880 | + |
2881 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2882 | + |
2883 | + CODEGEN_DECL(); |
2884 | +}; |
2885 | + |
2886 | + |
2887 | +//fn:remove |
2888 | +class fn_remove : public function |
2889 | +{ |
2890 | +public: |
2891 | + fn_remove(const signature& sig, FunctionConsts::FunctionKind kind) |
2892 | + : |
2893 | + function(sig, kind) |
2894 | + { |
2895 | + |
2896 | + } |
2897 | + |
2898 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2899 | + |
2900 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2901 | + |
2902 | + bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2903 | + |
2904 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2905 | + |
2906 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2907 | + |
2908 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2909 | + |
2910 | + CODEGEN_DECL(); |
2911 | +}; |
2912 | + |
2913 | + |
2914 | +//fn:reverse |
2915 | +class fn_reverse : public function |
2916 | +{ |
2917 | +public: |
2918 | + fn_reverse(const signature& sig, FunctionConsts::FunctionKind kind) |
2919 | + : |
2920 | + function(sig, kind) |
2921 | + { |
2922 | + |
2923 | + } |
2924 | + |
2925 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2926 | + |
2927 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2928 | + |
2929 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
2930 | + |
2931 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
2932 | + |
2933 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2934 | + |
2935 | + CODEGEN_DECL(); |
2936 | +}; |
2937 | + |
2938 | + |
2939 | +//fn:subsequence |
2940 | +class fn_subsequence : public function |
2941 | +{ |
2942 | +public: |
2943 | + fn_subsequence(const signature& sig, FunctionConsts::FunctionKind kind) |
2944 | + : |
2945 | + function(sig, kind) |
2946 | + { |
2947 | + |
2948 | + } |
2949 | + |
2950 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2951 | + |
2952 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2953 | + |
2954 | + bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2955 | + |
2956 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2957 | + |
2958 | + bool serializable() const { return true; } |
2959 | + |
2960 | + CODEGEN_DECL(); |
2961 | +}; |
2962 | + |
2963 | + |
2964 | +//op-zorba:subsequence-int |
2965 | +class op_zorba_subsequence_int : public function |
2966 | +{ |
2967 | +public: |
2968 | + op_zorba_subsequence_int(const signature& sig, FunctionConsts::FunctionKind kind) |
2969 | + : |
2970 | + function(sig, kind) |
2971 | + { |
2972 | + |
2973 | + } |
2974 | + |
2975 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2976 | + |
2977 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
2978 | + |
2979 | + bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
2980 | + |
2981 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
2982 | + |
2983 | + CODEGEN_DECL(); |
2984 | +}; |
2985 | + |
2986 | + |
2987 | +//op-zorba:sequence-point-access |
2988 | +class op_zorba_sequence_point_access : public function |
2989 | +{ |
2990 | +public: |
2991 | + op_zorba_sequence_point_access(const signature& sig, FunctionConsts::FunctionKind kind) |
2992 | + : |
2993 | + function(sig, kind) |
2994 | + { |
2995 | + |
2996 | + } |
2997 | + |
2998 | + xqtref_t getReturnType(const fo_expr* caller) const; |
2999 | + |
3000 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
3001 | + |
3002 | + bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
3003 | + |
3004 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
3005 | + |
3006 | + CODEGEN_DECL(); |
3007 | +}; |
3008 | + |
3009 | + |
3010 | +//fn:zero-or-one |
3011 | +class fn_zero_or_one : public function |
3012 | +{ |
3013 | +public: |
3014 | + fn_zero_or_one(const signature& sig, FunctionConsts::FunctionKind kind) |
3015 | + : |
3016 | + function(sig, kind) |
3017 | + { |
3018 | + |
3019 | + } |
3020 | + |
3021 | + xqtref_t getReturnType(const fo_expr* caller) const; |
3022 | + |
3023 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3024 | + |
3025 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
3026 | + |
3027 | + CODEGEN_DECL(); |
3028 | +}; |
3029 | + |
3030 | + |
3031 | +//fn:one-or-more |
3032 | +class fn_one_or_more : public function |
3033 | +{ |
3034 | +public: |
3035 | + fn_one_or_more(const signature& sig, FunctionConsts::FunctionKind kind) |
3036 | + : |
3037 | + function(sig, kind) |
3038 | + { |
3039 | + |
3040 | + } |
3041 | + |
3042 | + xqtref_t getReturnType(const fo_expr* caller) const; |
3043 | + |
3044 | + bool isMap(ulong producer) const { return producer == 0; } |
3045 | + |
3046 | + bool propagatesDistinctNodes(csize producer) const { return producer == 0; } |
3047 | + |
3048 | + bool propagatesSortedNodes(csize producer) const { return producer == 0; } |
3049 | + |
3050 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3051 | + |
3052 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
3053 | + |
3054 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
3055 | + |
3056 | + CODEGEN_DECL(); |
3057 | +}; |
3058 | + |
3059 | + |
3060 | +//fn:deep-equal |
3061 | +class fn_deep_equal : public function |
3062 | +{ |
3063 | +public: |
3064 | + fn_deep_equal(const signature& sig, FunctionConsts::FunctionKind kind) |
3065 | + : |
3066 | + function(sig, kind) |
3067 | + { |
3068 | + |
3069 | + } |
3070 | + |
3071 | + bool accessesDynCtx() const { return true; } |
3072 | + |
3073 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
3074 | + |
3075 | + CODEGEN_DECL(); |
3076 | +}; |
3077 | + |
3078 | + |
3079 | +//fn:count |
3080 | +class fn_count : public function |
3081 | +{ |
3082 | +public: |
3083 | + fn_count(const signature& sig, FunctionConsts::FunctionKind kind) |
3084 | + : |
3085 | + function(sig, kind) |
3086 | + { |
3087 | + |
3088 | + } |
3089 | + |
3090 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3091 | + |
3092 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } |
3093 | + |
3094 | + CODEGEN_DECL(); |
3095 | +}; |
3096 | + |
3097 | + |
3098 | +//fn:avg |
3099 | +class fn_avg : public function |
3100 | +{ |
3101 | +public: |
3102 | + fn_avg(const signature& sig, FunctionConsts::FunctionKind kind) |
3103 | + : |
3104 | + function(sig, kind) |
3105 | + { |
3106 | + |
3107 | + } |
3108 | + |
3109 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3110 | + |
3111 | + CODEGEN_DECL(); |
3112 | +}; |
3113 | + |
3114 | + |
3115 | +//fn:sum |
3116 | +class fn_sum : public function |
3117 | +{ |
3118 | +public: |
3119 | + fn_sum(const signature& sig, FunctionConsts::FunctionKind kind) |
3120 | + : |
3121 | + function(sig, kind) |
3122 | + { |
3123 | + |
3124 | + } |
3125 | + |
3126 | + bool specializable() const { return true; } |
3127 | + |
3128 | + function* specialize( static_context* sctx, |
3129 | + const std::vector<xqtref_t>& argTypes) const; |
3130 | + |
3131 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3132 | + |
3133 | + CODEGEN_DECL(); |
3134 | +}; |
3135 | + |
3136 | + |
3137 | +//op:sum_double |
3138 | +class op_sum_double : public function |
3139 | +{ |
3140 | +public: |
3141 | + op_sum_double(const signature& sig, FunctionConsts::FunctionKind kind) |
3142 | + : |
3143 | + function(sig, kind) |
3144 | + { |
3145 | + |
3146 | + } |
3147 | + |
3148 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3149 | + |
3150 | + CODEGEN_DECL(); |
3151 | +}; |
3152 | + |
3153 | + |
3154 | +//op:sum_float |
3155 | +class op_sum_float : public function |
3156 | +{ |
3157 | +public: |
3158 | + op_sum_float(const signature& sig, FunctionConsts::FunctionKind kind) |
3159 | + : |
3160 | + function(sig, kind) |
3161 | + { |
3162 | + |
3163 | + } |
3164 | + |
3165 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3166 | + |
3167 | + CODEGEN_DECL(); |
3168 | +}; |
3169 | + |
3170 | + |
3171 | +//op:sum_decimal |
3172 | +class op_sum_decimal : public function |
3173 | +{ |
3174 | +public: |
3175 | + op_sum_decimal(const signature& sig, FunctionConsts::FunctionKind kind) |
3176 | + : |
3177 | + function(sig, kind) |
3178 | + { |
3179 | + |
3180 | + } |
3181 | + |
3182 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3183 | + |
3184 | + CODEGEN_DECL(); |
3185 | +}; |
3186 | + |
3187 | + |
3188 | +//op:sum_integer |
3189 | +class op_sum_integer : public function |
3190 | +{ |
3191 | +public: |
3192 | + op_sum_integer(const signature& sig, FunctionConsts::FunctionKind kind) |
3193 | + : |
3194 | + function(sig, kind) |
3195 | + { |
3196 | + |
3197 | + } |
3198 | + |
3199 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3200 | + |
3201 | + CODEGEN_DECL(); |
3202 | +}; |
3203 | + |
3204 | + |
3205 | +//op:to |
3206 | +class op_to : public function |
3207 | +{ |
3208 | +public: |
3209 | + op_to(const signature& sig, FunctionConsts::FunctionKind kind) |
3210 | + : |
3211 | + function(sig, kind) |
3212 | + { |
3213 | + |
3214 | + } |
3215 | + |
3216 | + CODEGEN_DECL(); |
3217 | +}; |
3218 | + |
3219 | + |
3220 | +//fn:id |
3221 | +class fn_id : public function |
3222 | +{ |
3223 | +public: |
3224 | + fn_id(const signature& sig, FunctionConsts::FunctionKind kind) |
3225 | + : |
3226 | + function(sig, kind) |
3227 | + { |
3228 | + |
3229 | + } |
3230 | + |
3231 | + FunctionConsts::AnnotationValue producesDistinctNodes() const |
3232 | + { |
3233 | + return FunctionConsts::YES; |
3234 | + } |
3235 | + |
3236 | + FunctionConsts::AnnotationValue producesSortedNodes() const |
3237 | + { |
3238 | + return FunctionConsts::YES; |
3239 | + } |
3240 | + |
3241 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3242 | + |
3243 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
3244 | + |
3245 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
3246 | + |
3247 | + CODEGEN_DECL(); |
3248 | +}; |
3249 | + |
3250 | + |
3251 | +//fn:element-with-id |
3252 | +class fn_element_with_id : public function |
3253 | +{ |
3254 | +public: |
3255 | + fn_element_with_id(const signature& sig, FunctionConsts::FunctionKind kind) |
3256 | + : |
3257 | + function(sig, kind) |
3258 | + { |
3259 | + |
3260 | + } |
3261 | + |
3262 | + FunctionConsts::AnnotationValue producesDistinctNodes() const |
3263 | + { |
3264 | + return FunctionConsts::YES; |
3265 | + } |
3266 | + |
3267 | + FunctionConsts::AnnotationValue producesSortedNodes() const |
3268 | + { |
3269 | + return FunctionConsts::YES; |
3270 | + } |
3271 | + |
3272 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3273 | + |
3274 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
3275 | + |
3276 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
3277 | + |
3278 | + CODEGEN_DECL(); |
3279 | +}; |
3280 | + |
3281 | + |
3282 | +//fn:idref |
3283 | +class fn_idref : public function |
3284 | +{ |
3285 | +public: |
3286 | + fn_idref(const signature& sig, FunctionConsts::FunctionKind kind) |
3287 | + : |
3288 | + function(sig, kind) |
3289 | + { |
3290 | + |
3291 | + } |
3292 | + |
3293 | + FunctionConsts::AnnotationValue producesDistinctNodes() const |
3294 | + { |
3295 | + return FunctionConsts::YES; |
3296 | + } |
3297 | + |
3298 | + FunctionConsts::AnnotationValue producesSortedNodes() const |
3299 | + { |
3300 | + return FunctionConsts::YES; |
3301 | + } |
3302 | + |
3303 | + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const; |
3304 | + |
3305 | + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; |
3306 | + |
3307 | + bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } |
3308 | + |
3309 | + CODEGEN_DECL(); |
3310 | +}; |
3311 | + |
3312 | + |
3313 | +//fn:doc |
3314 | +class fn_doc : public function |
3315 | +{ |
3316 | +public: |
3317 | + fn_doc(const signature& sig, FunctionConsts::FunctionKind kind) |
3318 | + : |
3319 | + function(sig, kind) |
3320 | + { |
3321 | + |
3322 | + } |
3323 | + |
3324 | + bool accessesDynCtx() const { return true; } |
3325 | + |
3326 | + bool isSource() const { return true; } |
3327 | + |
3328 | + CODEGEN_DECL(); |
3329 | +}; |
3330 | + |
3331 | + |
3332 | +//fn:doc-available |
3333 | +class fn_doc_available : public function |
3334 | +{ |
3335 | +public: |
3336 | + fn_doc_available(const signature& sig, FunctionConsts::FunctionKind kind) |
3337 | + : |
3338 | + function(sig, kind) |
3339 | + { |
3340 | + |
3341 | + } |
3342 | + |
3343 | + CODEGEN_DECL(); |
3344 | +}; |
3345 | + |
3346 | + |
3347 | +} //namespace zorba |
3348 | + |
3349 | + |
3350 | +#endif |
3351 | +/* |
3352 | + * Local variables: |
3353 | + * mode: c++ |
3354 | + * End: |
3355 | + */ |
3356 | |
3357 | === modified file 'src/functions/pregenerated/func_strings.cpp' |
3358 | --- src/functions/pregenerated/func_strings.cpp 2012-04-24 12:39:38 +0000 |
3359 | +++ src/functions/pregenerated/func_strings.cpp 2012-05-02 07:18:18 +0000 |
3360 | @@ -1,895 +1,922 @@ |
3361 | -/* |
3362 | - * Copyright 2006-2008 The FLWOR Foundation. |
3363 | - * |
3364 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
3365 | - * you may not use this file except in compliance with the License. |
3366 | - * You may obtain a copy of the License at |
3367 | - * |
3368 | - * http://www.apache.org/licenses/LICENSE-2.0 |
3369 | - * |
3370 | - * Unless required by applicable law or agreed to in writing, software |
3371 | - * distributed under the License is distributed on an "AS IS" BASIS, |
3372 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
3373 | - * See the License for the specific language governing permissions and |
3374 | - * limitations under the License. |
3375 | - */ |
3376 | - |
3377 | -// ****************************************** |
3378 | -// * * |
3379 | -// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
3380 | -// * SEE .xml FILE WITH SAME NAME * |
3381 | -// * * |
3382 | -// ****************************************** |
3383 | - |
3384 | - |
3385 | -#include "stdafx.h" |
3386 | -#include "runtime/strings/strings.h" |
3387 | -#include "functions/func_strings.h" |
3388 | - |
3389 | - |
3390 | -namespace zorba{ |
3391 | - |
3392 | - |
3393 | - |
3394 | -PlanIter_t fn_codepoints_to_string::codegen( |
3395 | - CompilerCB*, |
3396 | - static_context* sctx, |
3397 | - const QueryLoc& loc, |
3398 | - std::vector<PlanIter_t>& argv, |
3399 | - expr& ann) const |
3400 | -{ |
3401 | - return new CodepointsToStringIterator(sctx, loc, argv); |
3402 | -} |
3403 | - |
3404 | -PlanIter_t fn_string_to_codepoints::codegen( |
3405 | - CompilerCB*, |
3406 | - static_context* sctx, |
3407 | - const QueryLoc& loc, |
3408 | - std::vector<PlanIter_t>& argv, |
3409 | - expr& ann) const |
3410 | -{ |
3411 | - return new StringToCodepointsIterator(sctx, loc, argv); |
3412 | -} |
3413 | - |
3414 | -PlanIter_t fn_compare::codegen( |
3415 | - CompilerCB*, |
3416 | - static_context* sctx, |
3417 | - const QueryLoc& loc, |
3418 | - std::vector<PlanIter_t>& argv, |
3419 | - expr& ann) const |
3420 | -{ |
3421 | - return new CompareStrIterator(sctx, loc, argv); |
3422 | -} |
3423 | - |
3424 | -PlanIter_t fn_codepoint_equal::codegen( |
3425 | - CompilerCB*, |
3426 | - static_context* sctx, |
3427 | - const QueryLoc& loc, |
3428 | - std::vector<PlanIter_t>& argv, |
3429 | - expr& ann) const |
3430 | -{ |
3431 | - return new CodepointEqualIterator(sctx, loc, argv); |
3432 | -} |
3433 | - |
3434 | -PlanIter_t fn_concat::codegen( |
3435 | - CompilerCB*, |
3436 | - static_context* sctx, |
3437 | - const QueryLoc& loc, |
3438 | - std::vector<PlanIter_t>& argv, |
3439 | - expr& ann) const |
3440 | -{ |
3441 | - return new ConcatStrIterator(sctx, loc, argv); |
3442 | -} |
3443 | - |
3444 | -PlanIter_t fn_string_join_3_0::codegen( |
3445 | - CompilerCB*, |
3446 | - static_context* sctx, |
3447 | - const QueryLoc& loc, |
3448 | - std::vector<PlanIter_t>& argv, |
3449 | - expr& ann) const |
3450 | -{ |
3451 | - return new StringJoinIterator(sctx, loc, argv); |
3452 | -} |
3453 | -PlanIter_t fn_string_join::codegen( |
3454 | - CompilerCB*, |
3455 | - static_context* sctx, |
3456 | - const QueryLoc& loc, |
3457 | - std::vector<PlanIter_t>& argv, |
3458 | - expr& ann) const |
3459 | -{ |
3460 | - return new StringJoinIterator(sctx, loc, argv); |
3461 | -} |
3462 | - |
3463 | -PlanIter_t fn_substring::codegen( |
3464 | - CompilerCB*, |
3465 | - static_context* sctx, |
3466 | - const QueryLoc& loc, |
3467 | - std::vector<PlanIter_t>& argv, |
3468 | - expr& ann) const |
3469 | -{ |
3470 | - return new SubstringIterator(sctx, loc, argv); |
3471 | -} |
3472 | - |
3473 | -PlanIter_t op_substring_int::codegen( |
3474 | - CompilerCB*, |
3475 | - static_context* sctx, |
3476 | - const QueryLoc& loc, |
3477 | - std::vector<PlanIter_t>& argv, |
3478 | - expr& ann) const |
3479 | -{ |
3480 | - return new SubstringIntOptIterator(sctx, loc, argv); |
3481 | -} |
3482 | - |
3483 | -PlanIter_t fn_string_length::codegen( |
3484 | - CompilerCB*, |
3485 | - static_context* sctx, |
3486 | - const QueryLoc& loc, |
3487 | - std::vector<PlanIter_t>& argv, |
3488 | - expr& ann) const |
3489 | -{ |
3490 | - return new StringLengthIterator(sctx, loc, argv); |
3491 | -} |
3492 | - |
3493 | -PlanIter_t fn_normalize_space::codegen( |
3494 | - CompilerCB*, |
3495 | - static_context* sctx, |
3496 | - const QueryLoc& loc, |
3497 | - std::vector<PlanIter_t>& argv, |
3498 | - expr& ann) const |
3499 | -{ |
3500 | - return new NormalizeSpaceIterator(sctx, loc, argv); |
3501 | -} |
3502 | - |
3503 | -PlanIter_t fn_normalize_unicode::codegen( |
3504 | - CompilerCB*, |
3505 | - static_context* sctx, |
3506 | - const QueryLoc& loc, |
3507 | - std::vector<PlanIter_t>& argv, |
3508 | - expr& ann) const |
3509 | -{ |
3510 | - return new NormalizeUnicodeIterator(sctx, loc, argv); |
3511 | -} |
3512 | - |
3513 | -PlanIter_t fn_upper_case::codegen( |
3514 | - CompilerCB*, |
3515 | - static_context* sctx, |
3516 | - const QueryLoc& loc, |
3517 | - std::vector<PlanIter_t>& argv, |
3518 | - expr& ann) const |
3519 | -{ |
3520 | - return new UpperCaseIterator(sctx, loc, argv); |
3521 | -} |
3522 | - |
3523 | -PlanIter_t fn_lower_case::codegen( |
3524 | - CompilerCB*, |
3525 | - static_context* sctx, |
3526 | - const QueryLoc& loc, |
3527 | - std::vector<PlanIter_t>& argv, |
3528 | - expr& ann) const |
3529 | -{ |
3530 | - return new LowerCaseIterator(sctx, loc, argv); |
3531 | -} |
3532 | - |
3533 | -PlanIter_t fn_translate::codegen( |
3534 | - CompilerCB*, |
3535 | - static_context* sctx, |
3536 | - const QueryLoc& loc, |
3537 | - std::vector<PlanIter_t>& argv, |
3538 | - expr& ann) const |
3539 | -{ |
3540 | - return new TranslateIterator(sctx, loc, argv); |
3541 | -} |
3542 | - |
3543 | -PlanIter_t fn_encode_for_uri::codegen( |
3544 | - CompilerCB*, |
3545 | - static_context* sctx, |
3546 | - const QueryLoc& loc, |
3547 | - std::vector<PlanIter_t>& argv, |
3548 | - expr& ann) const |
3549 | -{ |
3550 | - return new EncodeForUriIterator(sctx, loc, argv); |
3551 | -} |
3552 | - |
3553 | -PlanIter_t fn_iri_to_uri::codegen( |
3554 | - CompilerCB*, |
3555 | - static_context* sctx, |
3556 | - const QueryLoc& loc, |
3557 | - std::vector<PlanIter_t>& argv, |
3558 | - expr& ann) const |
3559 | -{ |
3560 | - return new IriToUriIterator(sctx, loc, argv); |
3561 | -} |
3562 | - |
3563 | -PlanIter_t fn_escape_html_uri::codegen( |
3564 | - CompilerCB*, |
3565 | - static_context* sctx, |
3566 | - const QueryLoc& loc, |
3567 | - std::vector<PlanIter_t>& argv, |
3568 | - expr& ann) const |
3569 | -{ |
3570 | - return new EscapeHtmlUriIterator(sctx, loc, argv); |
3571 | -} |
3572 | - |
3573 | -PlanIter_t fn_contains::codegen( |
3574 | - CompilerCB*, |
3575 | - static_context* sctx, |
3576 | - const QueryLoc& loc, |
3577 | - std::vector<PlanIter_t>& argv, |
3578 | - expr& ann) const |
3579 | -{ |
3580 | - return new ContainsIterator(sctx, loc, argv); |
3581 | -} |
3582 | - |
3583 | -PlanIter_t fn_starts_with::codegen( |
3584 | - CompilerCB*, |
3585 | - static_context* sctx, |
3586 | - const QueryLoc& loc, |
3587 | - std::vector<PlanIter_t>& argv, |
3588 | - expr& ann) const |
3589 | -{ |
3590 | - return new StartsWithIterator(sctx, loc, argv); |
3591 | -} |
3592 | - |
3593 | -PlanIter_t fn_ends_with::codegen( |
3594 | - CompilerCB*, |
3595 | - static_context* sctx, |
3596 | - const QueryLoc& loc, |
3597 | - std::vector<PlanIter_t>& argv, |
3598 | - expr& ann) const |
3599 | -{ |
3600 | - return new EndsWithIterator(sctx, loc, argv); |
3601 | -} |
3602 | - |
3603 | -PlanIter_t fn_substring_before::codegen( |
3604 | - CompilerCB*, |
3605 | - static_context* sctx, |
3606 | - const QueryLoc& loc, |
3607 | - std::vector<PlanIter_t>& argv, |
3608 | - expr& ann) const |
3609 | -{ |
3610 | - return new SubstringBeforeIterator(sctx, loc, argv); |
3611 | -} |
3612 | - |
3613 | -PlanIter_t fn_substring_after::codegen( |
3614 | - CompilerCB*, |
3615 | - static_context* sctx, |
3616 | - const QueryLoc& loc, |
3617 | - std::vector<PlanIter_t>& argv, |
3618 | - expr& ann) const |
3619 | -{ |
3620 | - return new SubstringAfterIterator(sctx, loc, argv); |
3621 | -} |
3622 | - |
3623 | -PlanIter_t fn_matches::codegen( |
3624 | - CompilerCB*, |
3625 | - static_context* sctx, |
3626 | - const QueryLoc& loc, |
3627 | - std::vector<PlanIter_t>& argv, |
3628 | - expr& ann) const |
3629 | -{ |
3630 | - return new FnMatchesIterator(sctx, loc, argv); |
3631 | -} |
3632 | - |
3633 | -PlanIter_t fn_replace::codegen( |
3634 | - CompilerCB*, |
3635 | - static_context* sctx, |
3636 | - const QueryLoc& loc, |
3637 | - std::vector<PlanIter_t>& argv, |
3638 | - expr& ann) const |
3639 | -{ |
3640 | - return new FnReplaceIterator(sctx, loc, argv); |
3641 | -} |
3642 | - |
3643 | -PlanIter_t fn_tokenize::codegen( |
3644 | - CompilerCB*, |
3645 | - static_context* sctx, |
3646 | - const QueryLoc& loc, |
3647 | - std::vector<PlanIter_t>& argv, |
3648 | - expr& ann) const |
3649 | -{ |
3650 | - return new FnTokenizeIterator(sctx, loc, argv); |
3651 | -} |
3652 | - |
3653 | -PlanIter_t fn_analyze_string_3_0::codegen( |
3654 | - CompilerCB*, |
3655 | - static_context* sctx, |
3656 | - const QueryLoc& loc, |
3657 | - std::vector<PlanIter_t>& argv, |
3658 | - expr& ann) const |
3659 | -{ |
3660 | - return new FnAnalyzeStringIterator(sctx, loc, argv); |
3661 | -} |
3662 | - |
3663 | -PlanIter_t fn_zorba_string_materialize::codegen( |
3664 | - CompilerCB*, |
3665 | - static_context* sctx, |
3666 | - const QueryLoc& loc, |
3667 | - std::vector<PlanIter_t>& argv, |
3668 | - expr& ann) const |
3669 | -{ |
3670 | - return new StringMaterializeIterator(sctx, loc, argv); |
3671 | -} |
3672 | - |
3673 | -PlanIter_t fn_zorba_string_is_streamable::codegen( |
3674 | - CompilerCB*, |
3675 | - static_context* sctx, |
3676 | - const QueryLoc& loc, |
3677 | - std::vector<PlanIter_t>& argv, |
3678 | - expr& ann) const |
3679 | -{ |
3680 | - return new StringIsStreamableIterator(sctx, loc, argv); |
3681 | -} |
3682 | - |
3683 | -PlanIter_t fn_zorba_string_split::codegen( |
3684 | - CompilerCB*, |
3685 | - static_context* sctx, |
3686 | - const QueryLoc& loc, |
3687 | - std::vector<PlanIter_t>& argv, |
3688 | - expr& ann) const |
3689 | -{ |
3690 | - return new StringSplitIterator(sctx, loc, argv); |
3691 | -} |
3692 | - |
3693 | -void populate_context_strings(static_context* sctx) |
3694 | -{ |
3695 | - { |
3696 | - |
3697 | - |
3698 | - DECL_WITH_KIND(sctx, fn_codepoints_to_string, |
3699 | - (createQName("http://www.w3.org/2005/xpath-functions","","codepoints-to-string"), |
3700 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
3701 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3702 | - FunctionConsts::FN_CODEPOINTS_TO_STRING_1); |
3703 | - |
3704 | - } |
3705 | - |
3706 | - |
3707 | - { |
3708 | - |
3709 | - |
3710 | - DECL_WITH_KIND(sctx, fn_string_to_codepoints, |
3711 | - (createQName("http://www.w3.org/2005/xpath-functions","","string-to-codepoints"), |
3712 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3713 | - GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
3714 | - FunctionConsts::FN_STRING_TO_CODEPOINTS_1); |
3715 | - |
3716 | - } |
3717 | - |
3718 | - |
3719 | - { |
3720 | - |
3721 | - |
3722 | - DECL_WITH_KIND(sctx, fn_compare, |
3723 | - (createQName("http://www.w3.org/2005/xpath-functions","","compare"), |
3724 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3725 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3726 | - GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION), |
3727 | - FunctionConsts::FN_COMPARE_2); |
3728 | - |
3729 | - } |
3730 | - |
3731 | - |
3732 | - { |
3733 | - |
3734 | - |
3735 | - DECL_WITH_KIND(sctx, fn_compare, |
3736 | - (createQName("http://www.w3.org/2005/xpath-functions","","compare"), |
3737 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3738 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3739 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
3740 | - GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION), |
3741 | - FunctionConsts::FN_COMPARE_3); |
3742 | - |
3743 | - } |
3744 | - |
3745 | - |
3746 | - { |
3747 | - |
3748 | - |
3749 | - DECL_WITH_KIND(sctx, fn_codepoint_equal, |
3750 | - (createQName("http://www.w3.org/2005/xpath-functions","","codepoint-equal"), |
3751 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3752 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3753 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION), |
3754 | - FunctionConsts::FN_CODEPOINT_EQUAL_2); |
3755 | - |
3756 | - } |
3757 | - |
3758 | - |
3759 | - { |
3760 | - std::vector<xqtref_t> lParamTypes; |
3761 | - lParamTypes.push_back(GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION); |
3762 | - |
3763 | - DECL_WITH_KIND(sctx, fn_concat, |
3764 | - (createQName("http://www.w3.org/2005/xpath-functions","","concat"), |
3765 | - lParamTypes, GENV_TYPESYSTEM.STRING_TYPE_ONE, true), |
3766 | - FunctionConsts::FN_CONCAT_N); |
3767 | - |
3768 | - } |
3769 | - |
3770 | - |
3771 | - { |
3772 | - |
3773 | - |
3774 | - DECL_WITH_KIND(sctx, fn_string_join_3_0, |
3775 | - (createQName("http://www.w3.org/2005/xpath-functions","","string-join"), |
3776 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
3777 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3778 | - FunctionConsts::FN_STRING_JOIN_1); |
3779 | - |
3780 | - } |
3781 | - |
3782 | - |
3783 | - { |
3784 | - |
3785 | - |
3786 | - DECL_WITH_KIND(sctx, fn_string_join, |
3787 | - (createQName("http://www.w3.org/2005/xpath-functions","","string-join"), |
3788 | - GENV_TYPESYSTEM.STRING_TYPE_STAR, |
3789 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
3790 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3791 | - FunctionConsts::FN_STRING_JOIN_2); |
3792 | - |
3793 | - } |
3794 | - |
3795 | - |
3796 | - { |
3797 | - |
3798 | - |
3799 | - DECL_WITH_KIND(sctx, fn_substring, |
3800 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring"), |
3801 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3802 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
3803 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3804 | - FunctionConsts::FN_SUBSTRING_2); |
3805 | - |
3806 | - } |
3807 | - |
3808 | - |
3809 | - { |
3810 | - |
3811 | - |
3812 | - DECL_WITH_KIND(sctx, fn_substring, |
3813 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring"), |
3814 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3815 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
3816 | - GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
3817 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3818 | - FunctionConsts::FN_SUBSTRING_3); |
3819 | - |
3820 | - } |
3821 | - |
3822 | - |
3823 | - { |
3824 | - |
3825 | - |
3826 | - DECL_WITH_KIND(sctx, op_substring_int, |
3827 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int"), |
3828 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3829 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
3830 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3831 | - FunctionConsts::OP_SUBSTRING_INT_2); |
3832 | - |
3833 | - } |
3834 | - |
3835 | - |
3836 | - { |
3837 | - |
3838 | - |
3839 | - DECL_WITH_KIND(sctx, op_substring_int, |
3840 | - (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int"), |
3841 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3842 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
3843 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
3844 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3845 | - FunctionConsts::OP_SUBSTRING_INT_3); |
3846 | - |
3847 | - } |
3848 | - |
3849 | - |
3850 | - { |
3851 | - |
3852 | - |
3853 | - DECL_WITH_KIND(sctx, fn_string_length, |
3854 | - (createQName("http://www.w3.org/2005/xpath-functions","","string-length"), |
3855 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
3856 | - FunctionConsts::FN_STRING_LENGTH_0); |
3857 | - |
3858 | - } |
3859 | - |
3860 | - |
3861 | - { |
3862 | - |
3863 | - |
3864 | - DECL_WITH_KIND(sctx, fn_string_length, |
3865 | - (createQName("http://www.w3.org/2005/xpath-functions","","string-length"), |
3866 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3867 | - GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
3868 | - FunctionConsts::FN_STRING_LENGTH_1); |
3869 | - |
3870 | - } |
3871 | - |
3872 | - |
3873 | - { |
3874 | - |
3875 | - |
3876 | - DECL_WITH_KIND(sctx, fn_normalize_space, |
3877 | - (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space"), |
3878 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3879 | - FunctionConsts::FN_NORMALIZE_SPACE_0); |
3880 | - |
3881 | - } |
3882 | - |
3883 | - |
3884 | - { |
3885 | - |
3886 | - |
3887 | - DECL_WITH_KIND(sctx, fn_normalize_space, |
3888 | - (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space"), |
3889 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3890 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3891 | - FunctionConsts::FN_NORMALIZE_SPACE_1); |
3892 | - |
3893 | - } |
3894 | - |
3895 | - |
3896 | - { |
3897 | - |
3898 | - |
3899 | - DECL_WITH_KIND(sctx, fn_normalize_unicode, |
3900 | - (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode"), |
3901 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3902 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3903 | - FunctionConsts::FN_NORMALIZE_UNICODE_1); |
3904 | - |
3905 | - } |
3906 | - |
3907 | - |
3908 | - { |
3909 | - |
3910 | - |
3911 | - DECL_WITH_KIND(sctx, fn_normalize_unicode, |
3912 | - (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode"), |
3913 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3914 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
3915 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3916 | - FunctionConsts::FN_NORMALIZE_UNICODE_2); |
3917 | - |
3918 | - } |
3919 | - |
3920 | - |
3921 | - { |
3922 | - |
3923 | - |
3924 | - DECL_WITH_KIND(sctx, fn_upper_case, |
3925 | - (createQName("http://www.w3.org/2005/xpath-functions","","upper-case"), |
3926 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3927 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3928 | - FunctionConsts::FN_UPPER_CASE_1); |
3929 | - |
3930 | - } |
3931 | - |
3932 | - |
3933 | - { |
3934 | - |
3935 | - |
3936 | - DECL_WITH_KIND(sctx, fn_lower_case, |
3937 | - (createQName("http://www.w3.org/2005/xpath-functions","","lower-case"), |
3938 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3939 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3940 | - FunctionConsts::FN_LOWER_CASE_1); |
3941 | - |
3942 | - } |
3943 | - |
3944 | - |
3945 | - { |
3946 | - |
3947 | - |
3948 | - DECL_WITH_KIND(sctx, fn_translate, |
3949 | - (createQName("http://www.w3.org/2005/xpath-functions","","translate"), |
3950 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3951 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
3952 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
3953 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3954 | - FunctionConsts::FN_TRANSLATE_3); |
3955 | - |
3956 | - } |
3957 | - |
3958 | - |
3959 | - { |
3960 | - |
3961 | - |
3962 | - DECL_WITH_KIND(sctx, fn_encode_for_uri, |
3963 | - (createQName("http://www.w3.org/2005/xpath-functions","","encode-for-uri"), |
3964 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3965 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3966 | - FunctionConsts::FN_ENCODE_FOR_URI_1); |
3967 | - |
3968 | - } |
3969 | - |
3970 | - |
3971 | - { |
3972 | - |
3973 | - |
3974 | - DECL_WITH_KIND(sctx, fn_iri_to_uri, |
3975 | - (createQName("http://www.w3.org/2005/xpath-functions","","iri-to-uri"), |
3976 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3977 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3978 | - FunctionConsts::FN_IRI_TO_URI_1); |
3979 | - |
3980 | - } |
3981 | - |
3982 | - |
3983 | - { |
3984 | - |
3985 | - |
3986 | - DECL_WITH_KIND(sctx, fn_escape_html_uri, |
3987 | - (createQName("http://www.w3.org/2005/xpath-functions","","escape-html-uri"), |
3988 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
3989 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
3990 | - FunctionConsts::FN_ESCAPE_HTML_URI_1); |
3991 | - |
3992 | - } |
3993 | - |
3994 | - |
3995 | - { |
3996 | - |
3997 | - |
3998 | - DECL_WITH_KIND(sctx, fn_contains, |
3999 | - (createQName("http://www.w3.org/2005/xpath-functions","","contains"), |
4000 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4001 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4002 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4003 | - FunctionConsts::FN_CONTAINS_2); |
4004 | - |
4005 | - } |
4006 | - |
4007 | - |
4008 | - { |
4009 | - |
4010 | - |
4011 | - DECL_WITH_KIND(sctx, fn_contains, |
4012 | - (createQName("http://www.w3.org/2005/xpath-functions","","contains"), |
4013 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4014 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4015 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4016 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4017 | - FunctionConsts::FN_CONTAINS_3); |
4018 | - |
4019 | - } |
4020 | - |
4021 | - |
4022 | - { |
4023 | - |
4024 | - |
4025 | - DECL_WITH_KIND(sctx, fn_starts_with, |
4026 | - (createQName("http://www.w3.org/2005/xpath-functions","","starts-with"), |
4027 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4028 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4029 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4030 | - FunctionConsts::FN_STARTS_WITH_2); |
4031 | - |
4032 | - } |
4033 | - |
4034 | - |
4035 | - { |
4036 | - |
4037 | - |
4038 | - DECL_WITH_KIND(sctx, fn_starts_with, |
4039 | - (createQName("http://www.w3.org/2005/xpath-functions","","starts-with"), |
4040 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4041 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4042 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4043 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4044 | - FunctionConsts::FN_STARTS_WITH_3); |
4045 | - |
4046 | - } |
4047 | - |
4048 | - |
4049 | - { |
4050 | - |
4051 | - |
4052 | - DECL_WITH_KIND(sctx, fn_ends_with, |
4053 | - (createQName("http://www.w3.org/2005/xpath-functions","","ends-with"), |
4054 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4055 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4056 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4057 | - FunctionConsts::FN_ENDS_WITH_2); |
4058 | - |
4059 | - } |
4060 | - |
4061 | - |
4062 | - { |
4063 | - |
4064 | - |
4065 | - DECL_WITH_KIND(sctx, fn_ends_with, |
4066 | - (createQName("http://www.w3.org/2005/xpath-functions","","ends-with"), |
4067 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4068 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4069 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4070 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4071 | - FunctionConsts::FN_ENDS_WITH_3); |
4072 | - |
4073 | - } |
4074 | - |
4075 | - |
4076 | - { |
4077 | - |
4078 | - |
4079 | - DECL_WITH_KIND(sctx, fn_substring_before, |
4080 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring-before"), |
4081 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4082 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4083 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4084 | - FunctionConsts::FN_SUBSTRING_BEFORE_2); |
4085 | - |
4086 | - } |
4087 | - |
4088 | - |
4089 | - { |
4090 | - |
4091 | - |
4092 | - DECL_WITH_KIND(sctx, fn_substring_before, |
4093 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring-before"), |
4094 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4095 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4096 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4097 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4098 | - FunctionConsts::FN_SUBSTRING_BEFORE_3); |
4099 | - |
4100 | - } |
4101 | - |
4102 | - |
4103 | - { |
4104 | - |
4105 | - |
4106 | - DECL_WITH_KIND(sctx, fn_substring_after, |
4107 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring-after"), |
4108 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4109 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4110 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4111 | - FunctionConsts::FN_SUBSTRING_AFTER_2); |
4112 | - |
4113 | - } |
4114 | - |
4115 | - |
4116 | - { |
4117 | - |
4118 | - |
4119 | - DECL_WITH_KIND(sctx, fn_substring_after, |
4120 | - (createQName("http://www.w3.org/2005/xpath-functions","","substring-after"), |
4121 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4122 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4123 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4124 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4125 | - FunctionConsts::FN_SUBSTRING_AFTER_3); |
4126 | - |
4127 | - } |
4128 | - |
4129 | - |
4130 | - { |
4131 | - |
4132 | - |
4133 | - DECL_WITH_KIND(sctx, fn_matches, |
4134 | - (createQName("http://www.w3.org/2005/xpath-functions","","matches"), |
4135 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4136 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4137 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4138 | - FunctionConsts::FN_MATCHES_2); |
4139 | - |
4140 | - } |
4141 | - |
4142 | - |
4143 | - { |
4144 | - |
4145 | - |
4146 | - DECL_WITH_KIND(sctx, fn_matches, |
4147 | - (createQName("http://www.w3.org/2005/xpath-functions","","matches"), |
4148 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4149 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4150 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4151 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4152 | - FunctionConsts::FN_MATCHES_3); |
4153 | - |
4154 | - } |
4155 | - |
4156 | - |
4157 | - { |
4158 | - |
4159 | - |
4160 | - DECL_WITH_KIND(sctx, fn_replace, |
4161 | - (createQName("http://www.w3.org/2005/xpath-functions","","replace"), |
4162 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4163 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4164 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4165 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4166 | - FunctionConsts::FN_REPLACE_3); |
4167 | - |
4168 | - } |
4169 | - |
4170 | - |
4171 | - { |
4172 | - |
4173 | - |
4174 | - DECL_WITH_KIND(sctx, fn_replace, |
4175 | - (createQName("http://www.w3.org/2005/xpath-functions","","replace"), |
4176 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4177 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4178 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4179 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4180 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4181 | - FunctionConsts::FN_REPLACE_4); |
4182 | - |
4183 | - } |
4184 | - |
4185 | - |
4186 | - { |
4187 | - |
4188 | - |
4189 | - DECL_WITH_KIND(sctx, fn_tokenize, |
4190 | - (createQName("http://www.w3.org/2005/xpath-functions","","tokenize"), |
4191 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4192 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4193 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
4194 | - FunctionConsts::FN_TOKENIZE_2); |
4195 | - |
4196 | - } |
4197 | - |
4198 | - |
4199 | - { |
4200 | - |
4201 | - |
4202 | - DECL_WITH_KIND(sctx, fn_tokenize, |
4203 | - (createQName("http://www.w3.org/2005/xpath-functions","","tokenize"), |
4204 | - GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4205 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4206 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4207 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
4208 | - FunctionConsts::FN_TOKENIZE_3); |
4209 | - |
4210 | - } |
4211 | - |
4212 | - |
4213 | - { |
4214 | - |
4215 | - |
4216 | - DECL_WITH_KIND(sctx, fn_zorba_string_materialize, |
4217 | - (createQName("http://www.zorba-xquery.com/modules/string","","materialize"), |
4218 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4219 | - GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4220 | - FunctionConsts::FN_ZORBA_STRING_MATERIALIZE_1); |
4221 | - |
4222 | - } |
4223 | - |
4224 | - |
4225 | - { |
4226 | - |
4227 | - |
4228 | - DECL_WITH_KIND(sctx, fn_zorba_string_is_streamable, |
4229 | - (createQName("http://www.zorba-xquery.com/modules/string","","is-streamable"), |
4230 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4231 | - GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4232 | - FunctionConsts::FN_ZORBA_STRING_IS_STREAMABLE_1); |
4233 | - |
4234 | - } |
4235 | - |
4236 | - |
4237 | - { |
4238 | - |
4239 | - |
4240 | - DECL_WITH_KIND(sctx, fn_zorba_string_split, |
4241 | - (createQName("http://www.zorba-xquery.com/modules/string","","split"), |
4242 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4243 | - GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4244 | - GENV_TYPESYSTEM.STRING_TYPE_STAR), |
4245 | - FunctionConsts::FN_ZORBA_STRING_SPLIT_2); |
4246 | - |
4247 | - } |
4248 | - |
4249 | -} |
4250 | - |
4251 | - |
4252 | -} |
4253 | - |
4254 | - |
4255 | - |
4256 | +/* |
4257 | + * Copyright 2006-2008 The FLWOR Foundation. |
4258 | + * |
4259 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
4260 | + * you may not use this file except in compliance with the License. |
4261 | + * You may obtain a copy of the License at |
4262 | + * |
4263 | + * http://www.apache.org/licenses/LICENSE-2.0 |
4264 | + * |
4265 | + * Unless required by applicable law or agreed to in writing, software |
4266 | + * distributed under the License is distributed on an "AS IS" BASIS, |
4267 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
4268 | + * See the License for the specific language governing permissions and |
4269 | + * limitations under the License. |
4270 | + */ |
4271 | + |
4272 | +// ****************************************** |
4273 | +// * * |
4274 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
4275 | +// * SEE .xml FILE WITH SAME NAME * |
4276 | +// * * |
4277 | +// ****************************************** |
4278 | + |
4279 | + |
4280 | +#include "stdafx.h" |
4281 | +#include "runtime/strings/strings.h" |
4282 | +#include "functions/func_strings.h" |
4283 | + |
4284 | + |
4285 | +namespace zorba{ |
4286 | + |
4287 | + |
4288 | + |
4289 | +PlanIter_t fn_codepoints_to_string::codegen( |
4290 | + CompilerCB*, |
4291 | + static_context* sctx, |
4292 | + const QueryLoc& loc, |
4293 | + std::vector<PlanIter_t>& argv, |
4294 | + expr& ann) const |
4295 | +{ |
4296 | + return new CodepointsToStringIterator(sctx, loc, argv); |
4297 | +} |
4298 | + |
4299 | +PlanIter_t fn_string_to_codepoints::codegen( |
4300 | + CompilerCB*, |
4301 | + static_context* sctx, |
4302 | + const QueryLoc& loc, |
4303 | + std::vector<PlanIter_t>& argv, |
4304 | + expr& ann) const |
4305 | +{ |
4306 | + return new StringToCodepointsIterator(sctx, loc, argv); |
4307 | +} |
4308 | + |
4309 | +PlanIter_t fn_compare::codegen( |
4310 | + CompilerCB*, |
4311 | + static_context* sctx, |
4312 | + const QueryLoc& loc, |
4313 | + std::vector<PlanIter_t>& argv, |
4314 | + expr& ann) const |
4315 | +{ |
4316 | + return new CompareStrIterator(sctx, loc, argv); |
4317 | +} |
4318 | + |
4319 | +PlanIter_t fn_codepoint_equal::codegen( |
4320 | + CompilerCB*, |
4321 | + static_context* sctx, |
4322 | + const QueryLoc& loc, |
4323 | + std::vector<PlanIter_t>& argv, |
4324 | + expr& ann) const |
4325 | +{ |
4326 | + return new CodepointEqualIterator(sctx, loc, argv); |
4327 | +} |
4328 | + |
4329 | +PlanIter_t fn_concat::codegen( |
4330 | + CompilerCB*, |
4331 | + static_context* sctx, |
4332 | + const QueryLoc& loc, |
4333 | + std::vector<PlanIter_t>& argv, |
4334 | + expr& ann) const |
4335 | +{ |
4336 | + return new ConcatStrIterator(sctx, loc, argv); |
4337 | +} |
4338 | + |
4339 | +PlanIter_t fn_string_join_3_0::codegen( |
4340 | + CompilerCB*, |
4341 | + static_context* sctx, |
4342 | + const QueryLoc& loc, |
4343 | + std::vector<PlanIter_t>& argv, |
4344 | + expr& ann) const |
4345 | +{ |
4346 | + return new StringJoinIterator(sctx, loc, argv); |
4347 | +} |
4348 | +PlanIter_t fn_string_join::codegen( |
4349 | + CompilerCB*, |
4350 | + static_context* sctx, |
4351 | + const QueryLoc& loc, |
4352 | + std::vector<PlanIter_t>& argv, |
4353 | + expr& ann) const |
4354 | +{ |
4355 | + return new StringJoinIterator(sctx, loc, argv); |
4356 | +} |
4357 | + |
4358 | +PlanIter_t fn_substring::codegen( |
4359 | + CompilerCB*, |
4360 | + static_context* sctx, |
4361 | + const QueryLoc& loc, |
4362 | + std::vector<PlanIter_t>& argv, |
4363 | + expr& ann) const |
4364 | +{ |
4365 | + return new SubstringIterator(sctx, loc, argv); |
4366 | +} |
4367 | + |
4368 | +PlanIter_t op_substring_int::codegen( |
4369 | + CompilerCB*, |
4370 | + static_context* sctx, |
4371 | + const QueryLoc& loc, |
4372 | + std::vector<PlanIter_t>& argv, |
4373 | + expr& ann) const |
4374 | +{ |
4375 | + return new SubstringIntOptIterator(sctx, loc, argv); |
4376 | +} |
4377 | + |
4378 | +PlanIter_t fn_string_length::codegen( |
4379 | + CompilerCB*, |
4380 | + static_context* sctx, |
4381 | + const QueryLoc& loc, |
4382 | + std::vector<PlanIter_t>& argv, |
4383 | + expr& ann) const |
4384 | +{ |
4385 | + return new StringLengthIterator(sctx, loc, argv); |
4386 | +} |
4387 | + |
4388 | +PlanIter_t fn_normalize_space::codegen( |
4389 | + CompilerCB*, |
4390 | + static_context* sctx, |
4391 | + const QueryLoc& loc, |
4392 | + std::vector<PlanIter_t>& argv, |
4393 | + expr& ann) const |
4394 | +{ |
4395 | + return new NormalizeSpaceIterator(sctx, loc, argv); |
4396 | +} |
4397 | + |
4398 | +PlanIter_t fn_normalize_unicode::codegen( |
4399 | + CompilerCB*, |
4400 | + static_context* sctx, |
4401 | + const QueryLoc& loc, |
4402 | + std::vector<PlanIter_t>& argv, |
4403 | + expr& ann) const |
4404 | +{ |
4405 | + return new NormalizeUnicodeIterator(sctx, loc, argv); |
4406 | +} |
4407 | + |
4408 | +PlanIter_t fn_upper_case::codegen( |
4409 | + CompilerCB*, |
4410 | + static_context* sctx, |
4411 | + const QueryLoc& loc, |
4412 | + std::vector<PlanIter_t>& argv, |
4413 | + expr& ann) const |
4414 | +{ |
4415 | + return new UpperCaseIterator(sctx, loc, argv); |
4416 | +} |
4417 | + |
4418 | +PlanIter_t fn_lower_case::codegen( |
4419 | + CompilerCB*, |
4420 | + static_context* sctx, |
4421 | + const QueryLoc& loc, |
4422 | + std::vector<PlanIter_t>& argv, |
4423 | + expr& ann) const |
4424 | +{ |
4425 | + return new LowerCaseIterator(sctx, loc, argv); |
4426 | +} |
4427 | + |
4428 | +PlanIter_t fn_translate::codegen( |
4429 | + CompilerCB*, |
4430 | + static_context* sctx, |
4431 | + const QueryLoc& loc, |
4432 | + std::vector<PlanIter_t>& argv, |
4433 | + expr& ann) const |
4434 | +{ |
4435 | + return new TranslateIterator(sctx, loc, argv); |
4436 | +} |
4437 | + |
4438 | +PlanIter_t fn_encode_for_uri::codegen( |
4439 | + CompilerCB*, |
4440 | + static_context* sctx, |
4441 | + const QueryLoc& loc, |
4442 | + std::vector<PlanIter_t>& argv, |
4443 | + expr& ann) const |
4444 | +{ |
4445 | + return new EncodeForUriIterator(sctx, loc, argv); |
4446 | +} |
4447 | + |
4448 | +PlanIter_t fn_iri_to_uri::codegen( |
4449 | + CompilerCB*, |
4450 | + static_context* sctx, |
4451 | + const QueryLoc& loc, |
4452 | + std::vector<PlanIter_t>& argv, |
4453 | + expr& ann) const |
4454 | +{ |
4455 | + return new IriToUriIterator(sctx, loc, argv); |
4456 | +} |
4457 | + |
4458 | +PlanIter_t fn_escape_html_uri::codegen( |
4459 | + CompilerCB*, |
4460 | + static_context* sctx, |
4461 | + const QueryLoc& loc, |
4462 | + std::vector<PlanIter_t>& argv, |
4463 | + expr& ann) const |
4464 | +{ |
4465 | + return new EscapeHtmlUriIterator(sctx, loc, argv); |
4466 | +} |
4467 | + |
4468 | +PlanIter_t fn_contains::codegen( |
4469 | + CompilerCB*, |
4470 | + static_context* sctx, |
4471 | + const QueryLoc& loc, |
4472 | + std::vector<PlanIter_t>& argv, |
4473 | + expr& ann) const |
4474 | +{ |
4475 | + return new ContainsIterator(sctx, loc, argv); |
4476 | +} |
4477 | + |
4478 | +PlanIter_t fn_starts_with::codegen( |
4479 | + CompilerCB*, |
4480 | + static_context* sctx, |
4481 | + const QueryLoc& loc, |
4482 | + std::vector<PlanIter_t>& argv, |
4483 | + expr& ann) const |
4484 | +{ |
4485 | + return new StartsWithIterator(sctx, loc, argv); |
4486 | +} |
4487 | + |
4488 | +PlanIter_t fn_ends_with::codegen( |
4489 | + CompilerCB*, |
4490 | + static_context* sctx, |
4491 | + const QueryLoc& loc, |
4492 | + std::vector<PlanIter_t>& argv, |
4493 | + expr& ann) const |
4494 | +{ |
4495 | + return new EndsWithIterator(sctx, loc, argv); |
4496 | +} |
4497 | + |
4498 | +PlanIter_t fn_substring_before::codegen( |
4499 | + CompilerCB*, |
4500 | + static_context* sctx, |
4501 | + const QueryLoc& loc, |
4502 | + std::vector<PlanIter_t>& argv, |
4503 | + expr& ann) const |
4504 | +{ |
4505 | + return new SubstringBeforeIterator(sctx, loc, argv); |
4506 | +} |
4507 | + |
4508 | +PlanIter_t fn_substring_after::codegen( |
4509 | + CompilerCB*, |
4510 | + static_context* sctx, |
4511 | + const QueryLoc& loc, |
4512 | + std::vector<PlanIter_t>& argv, |
4513 | + expr& ann) const |
4514 | +{ |
4515 | + return new SubstringAfterIterator(sctx, loc, argv); |
4516 | +} |
4517 | + |
4518 | +PlanIter_t fn_matches::codegen( |
4519 | + CompilerCB*, |
4520 | + static_context* sctx, |
4521 | + const QueryLoc& loc, |
4522 | + std::vector<PlanIter_t>& argv, |
4523 | + expr& ann) const |
4524 | +{ |
4525 | + return new FnMatchesIterator(sctx, loc, argv); |
4526 | +} |
4527 | + |
4528 | +PlanIter_t fn_replace::codegen( |
4529 | + CompilerCB*, |
4530 | + static_context* sctx, |
4531 | + const QueryLoc& loc, |
4532 | + std::vector<PlanIter_t>& argv, |
4533 | + expr& ann) const |
4534 | +{ |
4535 | + return new FnReplaceIterator(sctx, loc, argv); |
4536 | +} |
4537 | + |
4538 | +PlanIter_t fn_tokenize::codegen( |
4539 | + CompilerCB*, |
4540 | + static_context* sctx, |
4541 | + const QueryLoc& loc, |
4542 | + std::vector<PlanIter_t>& argv, |
4543 | + expr& ann) const |
4544 | +{ |
4545 | + return new FnTokenizeIterator(sctx, loc, argv); |
4546 | +} |
4547 | + |
4548 | +PlanIter_t fn_analyze_string_3_0::codegen( |
4549 | + CompilerCB*, |
4550 | + static_context* sctx, |
4551 | + const QueryLoc& loc, |
4552 | + std::vector<PlanIter_t>& argv, |
4553 | + expr& ann) const |
4554 | +{ |
4555 | + return new FnAnalyzeStringIterator(sctx, loc, argv); |
4556 | +} |
4557 | + |
4558 | +PlanIter_t fn_zorba_string_materialize::codegen( |
4559 | + CompilerCB*, |
4560 | + static_context* sctx, |
4561 | + const QueryLoc& loc, |
4562 | + std::vector<PlanIter_t>& argv, |
4563 | + expr& ann) const |
4564 | +{ |
4565 | + return new StringMaterializeIterator(sctx, loc, argv); |
4566 | +} |
4567 | + |
4568 | +PlanIter_t fn_zorba_string_is_streamable::codegen( |
4569 | + CompilerCB*, |
4570 | + static_context* sctx, |
4571 | + const QueryLoc& loc, |
4572 | + std::vector<PlanIter_t>& argv, |
4573 | + expr& ann) const |
4574 | +{ |
4575 | + return new StringIsStreamableIterator(sctx, loc, argv); |
4576 | +} |
4577 | + |
4578 | +PlanIter_t fn_zorba_string_split::codegen( |
4579 | + CompilerCB*, |
4580 | + static_context* sctx, |
4581 | + const QueryLoc& loc, |
4582 | + std::vector<PlanIter_t>& argv, |
4583 | + expr& ann) const |
4584 | +{ |
4585 | + return new StringSplitIterator(sctx, loc, argv); |
4586 | +} |
4587 | + |
4588 | +void populate_context_strings(static_context* sctx) |
4589 | +{ |
4590 | + { |
4591 | + |
4592 | + |
4593 | + DECL_WITH_KIND(sctx, fn_codepoints_to_string, |
4594 | + (createQName("http://www.w3.org/2005/xpath-functions","","codepoints-to-string"), |
4595 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR, |
4596 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4597 | + FunctionConsts::FN_CODEPOINTS_TO_STRING_1); |
4598 | + |
4599 | + } |
4600 | + |
4601 | + |
4602 | + { |
4603 | + |
4604 | + |
4605 | + DECL_WITH_KIND(sctx, fn_string_to_codepoints, |
4606 | + (createQName("http://www.w3.org/2005/xpath-functions","","string-to-codepoints"), |
4607 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4608 | + GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
4609 | + FunctionConsts::FN_STRING_TO_CODEPOINTS_1); |
4610 | + |
4611 | + } |
4612 | + |
4613 | + |
4614 | + { |
4615 | + |
4616 | + |
4617 | + DECL_WITH_KIND(sctx, fn_compare, |
4618 | + (createQName("http://www.w3.org/2005/xpath-functions","","compare"), |
4619 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4620 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4621 | + GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION), |
4622 | + FunctionConsts::FN_COMPARE_2); |
4623 | + |
4624 | + } |
4625 | + |
4626 | + |
4627 | + { |
4628 | + |
4629 | + |
4630 | + DECL_WITH_KIND(sctx, fn_compare, |
4631 | + (createQName("http://www.w3.org/2005/xpath-functions","","compare"), |
4632 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4633 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4634 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4635 | + GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION), |
4636 | + FunctionConsts::FN_COMPARE_3); |
4637 | + |
4638 | + } |
4639 | + |
4640 | + |
4641 | + { |
4642 | + |
4643 | + |
4644 | + DECL_WITH_KIND(sctx, fn_codepoint_equal, |
4645 | + (createQName("http://www.w3.org/2005/xpath-functions","","codepoint-equal"), |
4646 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4647 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4648 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION), |
4649 | + FunctionConsts::FN_CODEPOINT_EQUAL_2); |
4650 | + |
4651 | + } |
4652 | + |
4653 | + |
4654 | + { |
4655 | + std::vector<xqtref_t> lParamTypes; |
4656 | + lParamTypes.push_back(GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION); |
4657 | + |
4658 | + DECL_WITH_KIND(sctx, fn_concat, |
4659 | + (createQName("http://www.w3.org/2005/xpath-functions","","concat"), |
4660 | + lParamTypes, GENV_TYPESYSTEM.STRING_TYPE_ONE, true), |
4661 | + FunctionConsts::FN_CONCAT_N); |
4662 | + |
4663 | + } |
4664 | + |
4665 | + |
4666 | + { |
4667 | + |
4668 | + |
4669 | + DECL_WITH_KIND(sctx, fn_string_join_3_0, |
4670 | + (createQName("http://www.w3.org/2005/xpath-functions","","string-join"), |
4671 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
4672 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4673 | + FunctionConsts::FN_STRING_JOIN_1); |
4674 | + |
4675 | + } |
4676 | + |
4677 | + |
4678 | + { |
4679 | + |
4680 | + |
4681 | + DECL_WITH_KIND(sctx, fn_string_join, |
4682 | + (createQName("http://www.w3.org/2005/xpath-functions","","string-join"), |
4683 | + GENV_TYPESYSTEM.STRING_TYPE_STAR, |
4684 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4685 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4686 | + FunctionConsts::FN_STRING_JOIN_2); |
4687 | + |
4688 | + } |
4689 | + |
4690 | + |
4691 | + { |
4692 | + |
4693 | + |
4694 | + DECL_WITH_KIND(sctx, fn_substring, |
4695 | + (createQName("http://www.w3.org/2005/xpath-functions","","substring"), |
4696 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4697 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
4698 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4699 | + FunctionConsts::FN_SUBSTRING_2); |
4700 | + |
4701 | + } |
4702 | + |
4703 | + |
4704 | + { |
4705 | + |
4706 | + |
4707 | + DECL_WITH_KIND(sctx, fn_substring, |
4708 | + (createQName("http://www.w3.org/2005/xpath-functions","","substring"), |
4709 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4710 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
4711 | + GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
4712 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4713 | + FunctionConsts::FN_SUBSTRING_3); |
4714 | + |
4715 | + } |
4716 | + |
4717 | + |
4718 | + { |
4719 | + |
4720 | + |
4721 | + DECL_WITH_KIND(sctx, op_substring_int, |
4722 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int"), |
4723 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4724 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
4725 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4726 | + FunctionConsts::OP_SUBSTRING_INT_2); |
4727 | + |
4728 | + } |
4729 | + |
4730 | + |
4731 | + { |
4732 | + |
4733 | + |
4734 | + DECL_WITH_KIND(sctx, op_substring_int, |
4735 | + (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int"), |
4736 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4737 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
4738 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
4739 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4740 | + FunctionConsts::OP_SUBSTRING_INT_3); |
4741 | + |
4742 | + } |
4743 | + |
4744 | + |
4745 | + { |
4746 | + |
4747 | + |
4748 | + DECL_WITH_KIND(sctx, fn_string_length, |
4749 | + (createQName("http://www.w3.org/2005/xpath-functions","","string-length"), |
4750 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
4751 | + FunctionConsts::FN_STRING_LENGTH_0); |
4752 | + |
4753 | + } |
4754 | + |
4755 | + |
4756 | + { |
4757 | + |
4758 | + |
4759 | + DECL_WITH_KIND(sctx, fn_string_length, |
4760 | + (createQName("http://www.w3.org/2005/xpath-functions","","string-length"), |
4761 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4762 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
4763 | + FunctionConsts::FN_STRING_LENGTH_1); |
4764 | + |
4765 | + } |
4766 | + |
4767 | + |
4768 | + { |
4769 | + |
4770 | + |
4771 | + DECL_WITH_KIND(sctx, fn_normalize_space, |
4772 | + (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space"), |
4773 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4774 | + FunctionConsts::FN_NORMALIZE_SPACE_0); |
4775 | + |
4776 | + } |
4777 | + |
4778 | + |
4779 | + { |
4780 | + |
4781 | + |
4782 | + DECL_WITH_KIND(sctx, fn_normalize_space, |
4783 | + (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space"), |
4784 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4785 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4786 | + FunctionConsts::FN_NORMALIZE_SPACE_1); |
4787 | + |
4788 | + } |
4789 | + |
4790 | + |
4791 | + { |
4792 | + |
4793 | + |
4794 | + DECL_WITH_KIND(sctx, fn_normalize_unicode, |
4795 | + (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode"), |
4796 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4797 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4798 | + FunctionConsts::FN_NORMALIZE_UNICODE_1); |
4799 | + |
4800 | + } |
4801 | + |
4802 | + |
4803 | + { |
4804 | + |
4805 | + |
4806 | + DECL_WITH_KIND(sctx, fn_normalize_unicode, |
4807 | + (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode"), |
4808 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4809 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4810 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4811 | + FunctionConsts::FN_NORMALIZE_UNICODE_2); |
4812 | + |
4813 | + } |
4814 | + |
4815 | + |
4816 | + { |
4817 | + |
4818 | + |
4819 | + DECL_WITH_KIND(sctx, fn_upper_case, |
4820 | + (createQName("http://www.w3.org/2005/xpath-functions","","upper-case"), |
4821 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4822 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4823 | + FunctionConsts::FN_UPPER_CASE_1); |
4824 | + |
4825 | + } |
4826 | + |
4827 | + |
4828 | + { |
4829 | + |
4830 | + |
4831 | + DECL_WITH_KIND(sctx, fn_lower_case, |
4832 | + (createQName("http://www.w3.org/2005/xpath-functions","","lower-case"), |
4833 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4834 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4835 | + FunctionConsts::FN_LOWER_CASE_1); |
4836 | + |
4837 | + } |
4838 | + |
4839 | + |
4840 | + { |
4841 | + |
4842 | + |
4843 | + DECL_WITH_KIND(sctx, fn_translate, |
4844 | + (createQName("http://www.w3.org/2005/xpath-functions","","translate"), |
4845 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4846 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4847 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4848 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4849 | + FunctionConsts::FN_TRANSLATE_3); |
4850 | + |
4851 | + } |
4852 | + |
4853 | + |
4854 | + { |
4855 | + |
4856 | + |
4857 | + DECL_WITH_KIND(sctx, fn_encode_for_uri, |
4858 | + (createQName("http://www.w3.org/2005/xpath-functions","","encode-for-uri"), |
4859 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4860 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4861 | + FunctionConsts::FN_ENCODE_FOR_URI_1); |
4862 | + |
4863 | + } |
4864 | + |
4865 | + |
4866 | + { |
4867 | + |
4868 | + |
4869 | + DECL_WITH_KIND(sctx, fn_iri_to_uri, |
4870 | + (createQName("http://www.w3.org/2005/xpath-functions","","iri-to-uri"), |
4871 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4872 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4873 | + FunctionConsts::FN_IRI_TO_URI_1); |
4874 | + |
4875 | + } |
4876 | + |
4877 | + |
4878 | + { |
4879 | + |
4880 | + |
4881 | + DECL_WITH_KIND(sctx, fn_escape_html_uri, |
4882 | + (createQName("http://www.w3.org/2005/xpath-functions","","escape-html-uri"), |
4883 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4884 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4885 | + FunctionConsts::FN_ESCAPE_HTML_URI_1); |
4886 | + |
4887 | + } |
4888 | + |
4889 | + |
4890 | + { |
4891 | + |
4892 | + |
4893 | + DECL_WITH_KIND(sctx, fn_contains, |
4894 | + (createQName("http://www.w3.org/2005/xpath-functions","","contains"), |
4895 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4896 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4897 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4898 | + FunctionConsts::FN_CONTAINS_2); |
4899 | + |
4900 | + } |
4901 | + |
4902 | + |
4903 | + { |
4904 | + |
4905 | + |
4906 | + DECL_WITH_KIND(sctx, fn_contains, |
4907 | + (createQName("http://www.w3.org/2005/xpath-functions","","contains"), |
4908 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4909 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4910 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4911 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4912 | + FunctionConsts::FN_CONTAINS_3); |
4913 | + |
4914 | + } |
4915 | + |
4916 | + |
4917 | + { |
4918 | + |
4919 | + |
4920 | + DECL_WITH_KIND(sctx, fn_starts_with, |
4921 | + (createQName("http://www.w3.org/2005/xpath-functions","","starts-with"), |
4922 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4923 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4924 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4925 | + FunctionConsts::FN_STARTS_WITH_2); |
4926 | + |
4927 | + } |
4928 | + |
4929 | + |
4930 | + { |
4931 | + |
4932 | + |
4933 | + DECL_WITH_KIND(sctx, fn_starts_with, |
4934 | + (createQName("http://www.w3.org/2005/xpath-functions","","starts-with"), |
4935 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4936 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4937 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4938 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4939 | + FunctionConsts::FN_STARTS_WITH_3); |
4940 | + |
4941 | + } |
4942 | + |
4943 | + |
4944 | + { |
4945 | + |
4946 | + |
4947 | + DECL_WITH_KIND(sctx, fn_ends_with, |
4948 | + (createQName("http://www.w3.org/2005/xpath-functions","","ends-with"), |
4949 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4950 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4951 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4952 | + FunctionConsts::FN_ENDS_WITH_2); |
4953 | + |
4954 | + } |
4955 | + |
4956 | + |
4957 | + { |
4958 | + |
4959 | + |
4960 | + DECL_WITH_KIND(sctx, fn_ends_with, |
4961 | + (createQName("http://www.w3.org/2005/xpath-functions","","ends-with"), |
4962 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4963 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4964 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4965 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
4966 | + FunctionConsts::FN_ENDS_WITH_3); |
4967 | + |
4968 | + } |
4969 | + |
4970 | + |
4971 | + { |
4972 | + |
4973 | + |
4974 | + DECL_WITH_KIND(sctx, fn_substring_before, |
4975 | + (createQName("http://www.w3.org/2005/xpath-functions","","substring-before"), |
4976 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4977 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4978 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4979 | + FunctionConsts::FN_SUBSTRING_BEFORE_2); |
4980 | + |
4981 | + } |
4982 | + |
4983 | + |
4984 | + { |
4985 | + |
4986 | + |
4987 | + DECL_WITH_KIND(sctx, fn_substring_before, |
4988 | + (createQName("http://www.w3.org/2005/xpath-functions","","substring-before"), |
4989 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4990 | + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, |
4991 | + GENV_TYPESYSTEM.STRING_TYPE_ONE, |
4992 | + GENV_TYPESYSTEM.STRING_TYPE_ONE), |
4993 | + FunctionConsts::FN_SUBSTRING_BEFORE_3); |
4994 | + |
4995 | + } |
4996 | + |
4997 | + |
4998 | + { |
4999 | + |
5000 | + |
- The fn:path functions returns a wrong result for the following doc/query:
doc.xml
<a><b/><b/></a>
fn:path( doc("doc. xml")/a/ b[2])
/"":a[2]/"":b[1]
- As far as I understood from the spec, fn:parse- xml-fragment should return true for the query
fn:parse- xml-fragment( "<alpha> abcd</alpha> <beta>abcd< /beta>" ) instance of document-node()