1 /*
2  * Copyright 2006-2012 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 // ******************************************
18 // *                                        *
19 // * THIS IS A GENERATED FILE. DO NOT EDIT! *
20 // * SEE .xml FILE WITH SAME NAME           *
21 // *                                        *
22 // ******************************************
23 
24 
25 #include "stdafx.h"
26 #include "runtime/numerics/numerics.h"
27 #include "functions/func_numerics.h"
28 
29 
30 namespace zorba{
31 
32 
33 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const34 PlanIter_t fn_abs::codegen(
35   CompilerCB*,
36   static_context* sctx,
37   const QueryLoc& loc,
38   std::vector<PlanIter_t>& argv,
39   expr& ann) const
40 {
41   return new AbsIterator(sctx, loc, argv);
42 }
43 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const44 PlanIter_t fn_ceiling::codegen(
45   CompilerCB*,
46   static_context* sctx,
47   const QueryLoc& loc,
48   std::vector<PlanIter_t>& argv,
49   expr& ann) const
50 {
51   return new CeilingIterator(sctx, loc, argv);
52 }
53 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const54 PlanIter_t fn_floor::codegen(
55   CompilerCB*,
56   static_context* sctx,
57   const QueryLoc& loc,
58   std::vector<PlanIter_t>& argv,
59   expr& ann) const
60 {
61   return new FloorIterator(sctx, loc, argv);
62 }
63 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const64 PlanIter_t fn_round_3_0::codegen(
65   CompilerCB*,
66   static_context* sctx,
67   const QueryLoc& loc,
68   std::vector<PlanIter_t>& argv,
69   expr& ann) const
70 {
71   return new RoundIterator(sctx, loc, argv);
72 }
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const73 PlanIter_t fn_round::codegen(
74   CompilerCB*,
75   static_context* sctx,
76   const QueryLoc& loc,
77   std::vector<PlanIter_t>& argv,
78   expr& ann) const
79 {
80   return new RoundIterator(sctx, loc, argv);
81 }
82 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const83 PlanIter_t fn_round_half_to_even::codegen(
84   CompilerCB*,
85   static_context* sctx,
86   const QueryLoc& loc,
87   std::vector<PlanIter_t>& argv,
88   expr& ann) const
89 {
90   return new RoundHalfToEvenIterator(sctx, loc, argv);
91 }
92 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const93 PlanIter_t fn_format_number_3_0::codegen(
94   CompilerCB*,
95   static_context* sctx,
96   const QueryLoc& loc,
97   std::vector<PlanIter_t>& argv,
98   expr& ann) const
99 {
100   return new FormatNumberIterator(sctx, loc, argv);
101 }
102 
codegen(CompilerCB *,static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & argv,expr & ann) const103 PlanIter_t fn_format_integer_3_0::codegen(
104   CompilerCB*,
105   static_context* sctx,
106   const QueryLoc& loc,
107   std::vector<PlanIter_t>& argv,
108   expr& ann) const
109 {
110   return new FormatIntegerIterator(sctx, loc, argv);
111 }
112 
populate_context_numerics(static_context * sctx)113 void populate_context_numerics(static_context* sctx)
114 {
115 
116 
117       {
118     DECL_WITH_KIND(sctx, fn_abs,
119         (createQName("http://www.w3.org/2005/xpath-functions","","abs"),
120         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
121         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
122         FunctionConsts::FN_ABS_1);
123 
124   }
125 
126 
127 
128 
129       {
130     DECL_WITH_KIND(sctx, fn_ceiling,
131         (createQName("http://www.w3.org/2005/xpath-functions","","ceiling"),
132         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
133         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
134         FunctionConsts::FN_CEILING_1);
135 
136   }
137 
138 
139 
140 
141       {
142     DECL_WITH_KIND(sctx, fn_floor,
143         (createQName("http://www.w3.org/2005/xpath-functions","","floor"),
144         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
145         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
146         FunctionConsts::FN_FLOOR_1);
147 
148   }
149 
150 
151 
152 
153       {
154     DECL_WITH_KIND(sctx, fn_round,
155         (createQName("http://www.w3.org/2005/xpath-functions","","round"),
156         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
157         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
158         FunctionConsts::FN_ROUND_1);
159 
160   }
161 
162 
163 
164 
165       {
166     DECL_WITH_KIND(sctx, fn_round_3_0,
167         (createQName("http://www.w3.org/2005/xpath-functions","","round"),
168         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
169         GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
170         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
171         FunctionConsts::FN_ROUND_2);
172 
173   }
174 
175 
176 
177 
178       {
179     DECL_WITH_KIND(sctx, fn_round_half_to_even,
180         (createQName("http://www.w3.org/2005/xpath-functions","","round-half-to-even"),
181         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
182         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
183         FunctionConsts::FN_ROUND_HALF_TO_EVEN_1);
184 
185   }
186 
187 
188 
189 
190       {
191     DECL_WITH_KIND(sctx, fn_round_half_to_even,
192         (createQName("http://www.w3.org/2005/xpath-functions","","round-half-to-even"),
193         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
194         GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
195         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
196         FunctionConsts::FN_ROUND_HALF_TO_EVEN_2);
197 
198   }
199 
200 
201 
202 
203       {
204     DECL_WITH_KIND(sctx, fn_format_number_3_0,
205         (createQName("http://www.w3.org/2005/xpath-functions","","format-number"),
206         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
207         GENV_TYPESYSTEM.STRING_TYPE_ONE,
208         GENV_TYPESYSTEM.STRING_TYPE_ONE),
209         FunctionConsts::FN_FORMAT_NUMBER_2);
210 
211   }
212 
213 
214 
215 
216       {
217     DECL_WITH_KIND(sctx, fn_format_number_3_0,
218         (createQName("http://www.w3.org/2005/xpath-functions","","format-number"),
219         GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION,
220         GENV_TYPESYSTEM.STRING_TYPE_ONE,
221         GENV_TYPESYSTEM.STRING_TYPE_ONE,
222         GENV_TYPESYSTEM.STRING_TYPE_ONE),
223         FunctionConsts::FN_FORMAT_NUMBER_3);
224 
225   }
226 
227 
228 
229 
230       {
231     DECL_WITH_KIND(sctx, fn_format_integer_3_0,
232         (createQName("http://www.w3.org/2005/xpath-functions","","format-integer"),
233         GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION,
234         GENV_TYPESYSTEM.STRING_TYPE_ONE,
235         GENV_TYPESYSTEM.STRING_TYPE_ONE),
236         FunctionConsts::FN_FORMAT_INTEGER_2);
237 
238   }
239 
240 
241 
242 
243       {
244     DECL_WITH_KIND(sctx, fn_format_integer_3_0,
245         (createQName("http://www.w3.org/2005/xpath-functions","","format-integer"),
246         GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION,
247         GENV_TYPESYSTEM.STRING_TYPE_ONE,
248         GENV_TYPESYSTEM.STRING_TYPE_ONE,
249         GENV_TYPESYSTEM.STRING_TYPE_ONE),
250         FunctionConsts::FN_FORMAT_INTEGER_3);
251 
252   }
253 
254 }
255 
256 
257 }
258 
259 
260 
261