|
1 |
|
2 /**** |
|
3 * IEC 61131-3 standard function lib |
|
4 * generated code, do not edit by hand |
|
5 */ |
|
6 switch(current_function_type){ |
|
7 |
|
8 /**** |
|
9 *REAL_TO_REAL |
|
10 */ |
|
11 case function_real_to_real : |
|
12 { |
|
13 symbol_c *last_type_symbol = NULL; |
|
14 |
|
15 { |
|
16 identifier_c param_name("IN"); |
|
17 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
18 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
19 |
|
20 /* Get the value from a foo(<param_value>) style call */ |
|
21 if (IN_param_value == NULL) |
|
22 IN_param_value = function_call_param_iterator.next(); |
|
23 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
24 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
25 |
|
26 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
27 { |
|
28 |
|
29 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
30 return return_type_symbol; |
|
31 |
|
32 } |
|
33 |
|
34 ERROR; |
|
35 } |
|
36 |
|
37 }/*function_real_to_real*/ |
|
38 break; |
|
39 |
|
40 /**** |
|
41 *REAL_TO_SINT |
|
42 */ |
|
43 case function_real_to_sint : |
|
44 { |
|
45 symbol_c *last_type_symbol = NULL; |
|
46 |
|
47 { |
|
48 identifier_c param_name("IN"); |
|
49 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
50 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
51 |
|
52 /* Get the value from a foo(<param_value>) style call */ |
|
53 if (IN_param_value == NULL) |
|
54 IN_param_value = function_call_param_iterator.next(); |
|
55 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
56 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
57 |
|
58 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
59 { |
|
60 |
|
61 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
62 return return_type_symbol; |
|
63 |
|
64 } |
|
65 |
|
66 ERROR; |
|
67 } |
|
68 |
|
69 }/*function_real_to_sint*/ |
|
70 break; |
|
71 |
|
72 /**** |
|
73 *REAL_TO_LINT |
|
74 */ |
|
75 case function_real_to_lint : |
|
76 { |
|
77 symbol_c *last_type_symbol = NULL; |
|
78 |
|
79 { |
|
80 identifier_c param_name("IN"); |
|
81 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
82 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
83 |
|
84 /* Get the value from a foo(<param_value>) style call */ |
|
85 if (IN_param_value == NULL) |
|
86 IN_param_value = function_call_param_iterator.next(); |
|
87 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
88 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
89 |
|
90 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
91 { |
|
92 |
|
93 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
94 return return_type_symbol; |
|
95 |
|
96 } |
|
97 |
|
98 ERROR; |
|
99 } |
|
100 |
|
101 }/*function_real_to_lint*/ |
|
102 break; |
|
103 |
|
104 /**** |
|
105 *REAL_TO_DINT |
|
106 */ |
|
107 case function_real_to_dint : |
|
108 { |
|
109 symbol_c *last_type_symbol = NULL; |
|
110 |
|
111 { |
|
112 identifier_c param_name("IN"); |
|
113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
115 |
|
116 /* Get the value from a foo(<param_value>) style call */ |
|
117 if (IN_param_value == NULL) |
|
118 IN_param_value = function_call_param_iterator.next(); |
|
119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
121 |
|
122 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
123 { |
|
124 |
|
125 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
126 return return_type_symbol; |
|
127 |
|
128 } |
|
129 |
|
130 ERROR; |
|
131 } |
|
132 |
|
133 }/*function_real_to_dint*/ |
|
134 break; |
|
135 |
|
136 /**** |
|
137 *REAL_TO_DATE |
|
138 */ |
|
139 case function_real_to_date : |
|
140 { |
|
141 symbol_c *last_type_symbol = NULL; |
|
142 |
|
143 { |
|
144 identifier_c param_name("IN"); |
|
145 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
146 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
147 |
|
148 /* Get the value from a foo(<param_value>) style call */ |
|
149 if (IN_param_value == NULL) |
|
150 IN_param_value = function_call_param_iterator.next(); |
|
151 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
152 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
153 |
|
154 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
155 { |
|
156 |
|
157 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
158 return return_type_symbol; |
|
159 |
|
160 } |
|
161 |
|
162 ERROR; |
|
163 } |
|
164 |
|
165 }/*function_real_to_date*/ |
|
166 break; |
|
167 |
|
168 /**** |
|
169 *REAL_TO_DWORD |
|
170 */ |
|
171 case function_real_to_dword : |
|
172 { |
|
173 symbol_c *last_type_symbol = NULL; |
|
174 |
|
175 { |
|
176 identifier_c param_name("IN"); |
|
177 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
178 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
179 |
|
180 /* Get the value from a foo(<param_value>) style call */ |
|
181 if (IN_param_value == NULL) |
|
182 IN_param_value = function_call_param_iterator.next(); |
|
183 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
184 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
185 |
|
186 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
187 { |
|
188 |
|
189 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
190 return return_type_symbol; |
|
191 |
|
192 } |
|
193 |
|
194 ERROR; |
|
195 } |
|
196 |
|
197 }/*function_real_to_dword*/ |
|
198 break; |
|
199 |
|
200 /**** |
|
201 *REAL_TO_DT |
|
202 */ |
|
203 case function_real_to_dt : |
|
204 { |
|
205 symbol_c *last_type_symbol = NULL; |
|
206 |
|
207 { |
|
208 identifier_c param_name("IN"); |
|
209 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
210 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
211 |
|
212 /* Get the value from a foo(<param_value>) style call */ |
|
213 if (IN_param_value == NULL) |
|
214 IN_param_value = function_call_param_iterator.next(); |
|
215 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
216 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
217 |
|
218 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
219 { |
|
220 |
|
221 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
222 return return_type_symbol; |
|
223 |
|
224 } |
|
225 |
|
226 ERROR; |
|
227 } |
|
228 |
|
229 }/*function_real_to_dt*/ |
|
230 break; |
|
231 |
|
232 /**** |
|
233 *REAL_TO_TOD |
|
234 */ |
|
235 case function_real_to_tod : |
|
236 { |
|
237 symbol_c *last_type_symbol = NULL; |
|
238 |
|
239 { |
|
240 identifier_c param_name("IN"); |
|
241 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
242 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
243 |
|
244 /* Get the value from a foo(<param_value>) style call */ |
|
245 if (IN_param_value == NULL) |
|
246 IN_param_value = function_call_param_iterator.next(); |
|
247 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
248 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
249 |
|
250 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
251 { |
|
252 |
|
253 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
254 return return_type_symbol; |
|
255 |
|
256 } |
|
257 |
|
258 ERROR; |
|
259 } |
|
260 |
|
261 }/*function_real_to_tod*/ |
|
262 break; |
|
263 |
|
264 /**** |
|
265 *REAL_TO_UDINT |
|
266 */ |
|
267 case function_real_to_udint : |
|
268 { |
|
269 symbol_c *last_type_symbol = NULL; |
|
270 |
|
271 { |
|
272 identifier_c param_name("IN"); |
|
273 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
274 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
275 |
|
276 /* Get the value from a foo(<param_value>) style call */ |
|
277 if (IN_param_value == NULL) |
|
278 IN_param_value = function_call_param_iterator.next(); |
|
279 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
280 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
281 |
|
282 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
283 { |
|
284 |
|
285 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
286 return return_type_symbol; |
|
287 |
|
288 } |
|
289 |
|
290 ERROR; |
|
291 } |
|
292 |
|
293 }/*function_real_to_udint*/ |
|
294 break; |
|
295 |
|
296 /**** |
|
297 *REAL_TO_WORD |
|
298 */ |
|
299 case function_real_to_word : |
|
300 { |
|
301 symbol_c *last_type_symbol = NULL; |
|
302 |
|
303 { |
|
304 identifier_c param_name("IN"); |
|
305 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
306 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
307 |
|
308 /* Get the value from a foo(<param_value>) style call */ |
|
309 if (IN_param_value == NULL) |
|
310 IN_param_value = function_call_param_iterator.next(); |
|
311 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
312 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
313 |
|
314 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
315 { |
|
316 |
|
317 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
318 return return_type_symbol; |
|
319 |
|
320 } |
|
321 |
|
322 ERROR; |
|
323 } |
|
324 |
|
325 }/*function_real_to_word*/ |
|
326 break; |
|
327 |
|
328 /**** |
|
329 *REAL_TO_WSTRING |
|
330 */ |
|
331 case function_real_to_wstring : |
|
332 { |
|
333 symbol_c *last_type_symbol = NULL; |
|
334 |
|
335 { |
|
336 identifier_c param_name("IN"); |
|
337 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
338 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
339 |
|
340 /* Get the value from a foo(<param_value>) style call */ |
|
341 if (IN_param_value == NULL) |
|
342 IN_param_value = function_call_param_iterator.next(); |
|
343 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
344 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
345 |
|
346 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
347 { |
|
348 |
|
349 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
350 return return_type_symbol; |
|
351 |
|
352 } |
|
353 |
|
354 ERROR; |
|
355 } |
|
356 |
|
357 }/*function_real_to_wstring*/ |
|
358 break; |
|
359 |
|
360 /**** |
|
361 *REAL_TO_STRING |
|
362 */ |
|
363 case function_real_to_string : |
|
364 { |
|
365 symbol_c *last_type_symbol = NULL; |
|
366 |
|
367 { |
|
368 identifier_c param_name("IN"); |
|
369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
370 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
371 |
|
372 /* Get the value from a foo(<param_value>) style call */ |
|
373 if (IN_param_value == NULL) |
|
374 IN_param_value = function_call_param_iterator.next(); |
|
375 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
376 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
377 |
|
378 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
379 { |
|
380 |
|
381 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
382 return return_type_symbol; |
|
383 |
|
384 } |
|
385 |
|
386 ERROR; |
|
387 } |
|
388 |
|
389 }/*function_real_to_string*/ |
|
390 break; |
|
391 |
|
392 /**** |
|
393 *REAL_TO_LWORD |
|
394 */ |
|
395 case function_real_to_lword : |
|
396 { |
|
397 symbol_c *last_type_symbol = NULL; |
|
398 |
|
399 { |
|
400 identifier_c param_name("IN"); |
|
401 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
402 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
403 |
|
404 /* Get the value from a foo(<param_value>) style call */ |
|
405 if (IN_param_value == NULL) |
|
406 IN_param_value = function_call_param_iterator.next(); |
|
407 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
408 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
409 |
|
410 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
411 { |
|
412 |
|
413 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
414 return return_type_symbol; |
|
415 |
|
416 } |
|
417 |
|
418 ERROR; |
|
419 } |
|
420 |
|
421 }/*function_real_to_lword*/ |
|
422 break; |
|
423 |
|
424 /**** |
|
425 *REAL_TO_UINT |
|
426 */ |
|
427 case function_real_to_uint : |
|
428 { |
|
429 symbol_c *last_type_symbol = NULL; |
|
430 |
|
431 { |
|
432 identifier_c param_name("IN"); |
|
433 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
434 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
435 |
|
436 /* Get the value from a foo(<param_value>) style call */ |
|
437 if (IN_param_value == NULL) |
|
438 IN_param_value = function_call_param_iterator.next(); |
|
439 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
440 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
441 |
|
442 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
443 { |
|
444 |
|
445 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
446 return return_type_symbol; |
|
447 |
|
448 } |
|
449 |
|
450 ERROR; |
|
451 } |
|
452 |
|
453 }/*function_real_to_uint*/ |
|
454 break; |
|
455 |
|
456 /**** |
|
457 *REAL_TO_LREAL |
|
458 */ |
|
459 case function_real_to_lreal : |
|
460 { |
|
461 symbol_c *last_type_symbol = NULL; |
|
462 |
|
463 { |
|
464 identifier_c param_name("IN"); |
|
465 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
466 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
467 |
|
468 /* Get the value from a foo(<param_value>) style call */ |
|
469 if (IN_param_value == NULL) |
|
470 IN_param_value = function_call_param_iterator.next(); |
|
471 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
472 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
473 |
|
474 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
475 { |
|
476 |
|
477 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
478 return return_type_symbol; |
|
479 |
|
480 } |
|
481 |
|
482 ERROR; |
|
483 } |
|
484 |
|
485 }/*function_real_to_lreal*/ |
|
486 break; |
|
487 |
|
488 /**** |
|
489 *REAL_TO_BYTE |
|
490 */ |
|
491 case function_real_to_byte : |
|
492 { |
|
493 symbol_c *last_type_symbol = NULL; |
|
494 |
|
495 { |
|
496 identifier_c param_name("IN"); |
|
497 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
498 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
499 |
|
500 /* Get the value from a foo(<param_value>) style call */ |
|
501 if (IN_param_value == NULL) |
|
502 IN_param_value = function_call_param_iterator.next(); |
|
503 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
504 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
505 |
|
506 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
507 { |
|
508 |
|
509 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
510 return return_type_symbol; |
|
511 |
|
512 } |
|
513 |
|
514 ERROR; |
|
515 } |
|
516 |
|
517 }/*function_real_to_byte*/ |
|
518 break; |
|
519 |
|
520 /**** |
|
521 *REAL_TO_USINT |
|
522 */ |
|
523 case function_real_to_usint : |
|
524 { |
|
525 symbol_c *last_type_symbol = NULL; |
|
526 |
|
527 { |
|
528 identifier_c param_name("IN"); |
|
529 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
530 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
531 |
|
532 /* Get the value from a foo(<param_value>) style call */ |
|
533 if (IN_param_value == NULL) |
|
534 IN_param_value = function_call_param_iterator.next(); |
|
535 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
536 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
537 |
|
538 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
539 { |
|
540 |
|
541 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
542 return return_type_symbol; |
|
543 |
|
544 } |
|
545 |
|
546 ERROR; |
|
547 } |
|
548 |
|
549 }/*function_real_to_usint*/ |
|
550 break; |
|
551 |
|
552 /**** |
|
553 *REAL_TO_ULINT |
|
554 */ |
|
555 case function_real_to_ulint : |
|
556 { |
|
557 symbol_c *last_type_symbol = NULL; |
|
558 |
|
559 { |
|
560 identifier_c param_name("IN"); |
|
561 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
562 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
563 |
|
564 /* Get the value from a foo(<param_value>) style call */ |
|
565 if (IN_param_value == NULL) |
|
566 IN_param_value = function_call_param_iterator.next(); |
|
567 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
568 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
569 |
|
570 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
571 { |
|
572 |
|
573 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
574 return return_type_symbol; |
|
575 |
|
576 } |
|
577 |
|
578 ERROR; |
|
579 } |
|
580 |
|
581 }/*function_real_to_ulint*/ |
|
582 break; |
|
583 |
|
584 /**** |
|
585 *REAL_TO_BOOL |
|
586 */ |
|
587 case function_real_to_bool : |
|
588 { |
|
589 symbol_c *last_type_symbol = NULL; |
|
590 |
|
591 { |
|
592 identifier_c param_name("IN"); |
|
593 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
594 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
595 |
|
596 /* Get the value from a foo(<param_value>) style call */ |
|
597 if (IN_param_value == NULL) |
|
598 IN_param_value = function_call_param_iterator.next(); |
|
599 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
601 |
|
602 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
603 { |
|
604 |
|
605 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
606 return return_type_symbol; |
|
607 |
|
608 } |
|
609 |
|
610 ERROR; |
|
611 } |
|
612 |
|
613 }/*function_real_to_bool*/ |
|
614 break; |
|
615 |
|
616 /**** |
|
617 *REAL_TO_TIME |
|
618 */ |
|
619 case function_real_to_time : |
|
620 { |
|
621 symbol_c *last_type_symbol = NULL; |
|
622 |
|
623 { |
|
624 identifier_c param_name("IN"); |
|
625 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
626 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
627 |
|
628 /* Get the value from a foo(<param_value>) style call */ |
|
629 if (IN_param_value == NULL) |
|
630 IN_param_value = function_call_param_iterator.next(); |
|
631 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
632 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
633 |
|
634 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
635 { |
|
636 |
|
637 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
638 return return_type_symbol; |
|
639 |
|
640 } |
|
641 |
|
642 ERROR; |
|
643 } |
|
644 |
|
645 }/*function_real_to_time*/ |
|
646 break; |
|
647 |
|
648 /**** |
|
649 *REAL_TO_INT |
|
650 */ |
|
651 case function_real_to_int : |
|
652 { |
|
653 symbol_c *last_type_symbol = NULL; |
|
654 |
|
655 { |
|
656 identifier_c param_name("IN"); |
|
657 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
658 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
659 |
|
660 /* Get the value from a foo(<param_value>) style call */ |
|
661 if (IN_param_value == NULL) |
|
662 IN_param_value = function_call_param_iterator.next(); |
|
663 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
664 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
665 |
|
666 if (typeid(*last_type_symbol) == typeid(real_type_name_c)) |
|
667 { |
|
668 |
|
669 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
670 return return_type_symbol; |
|
671 |
|
672 } |
|
673 |
|
674 ERROR; |
|
675 } |
|
676 |
|
677 }/*function_real_to_int*/ |
|
678 break; |
|
679 |
|
680 /**** |
|
681 *SINT_TO_REAL |
|
682 */ |
|
683 case function_sint_to_real : |
|
684 { |
|
685 symbol_c *last_type_symbol = NULL; |
|
686 |
|
687 { |
|
688 identifier_c param_name("IN"); |
|
689 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
690 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
691 |
|
692 /* Get the value from a foo(<param_value>) style call */ |
|
693 if (IN_param_value == NULL) |
|
694 IN_param_value = function_call_param_iterator.next(); |
|
695 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
696 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
697 |
|
698 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
699 { |
|
700 |
|
701 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
702 return return_type_symbol; |
|
703 |
|
704 } |
|
705 |
|
706 ERROR; |
|
707 } |
|
708 |
|
709 }/*function_sint_to_real*/ |
|
710 break; |
|
711 |
|
712 /**** |
|
713 *SINT_TO_SINT |
|
714 */ |
|
715 case function_sint_to_sint : |
|
716 { |
|
717 symbol_c *last_type_symbol = NULL; |
|
718 |
|
719 { |
|
720 identifier_c param_name("IN"); |
|
721 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
722 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
723 |
|
724 /* Get the value from a foo(<param_value>) style call */ |
|
725 if (IN_param_value == NULL) |
|
726 IN_param_value = function_call_param_iterator.next(); |
|
727 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
728 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
729 |
|
730 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
731 { |
|
732 |
|
733 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
734 return return_type_symbol; |
|
735 |
|
736 } |
|
737 |
|
738 ERROR; |
|
739 } |
|
740 |
|
741 }/*function_sint_to_sint*/ |
|
742 break; |
|
743 |
|
744 /**** |
|
745 *SINT_TO_LINT |
|
746 */ |
|
747 case function_sint_to_lint : |
|
748 { |
|
749 symbol_c *last_type_symbol = NULL; |
|
750 |
|
751 { |
|
752 identifier_c param_name("IN"); |
|
753 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
754 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
755 |
|
756 /* Get the value from a foo(<param_value>) style call */ |
|
757 if (IN_param_value == NULL) |
|
758 IN_param_value = function_call_param_iterator.next(); |
|
759 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
760 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
761 |
|
762 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
763 { |
|
764 |
|
765 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
766 return return_type_symbol; |
|
767 |
|
768 } |
|
769 |
|
770 ERROR; |
|
771 } |
|
772 |
|
773 }/*function_sint_to_lint*/ |
|
774 break; |
|
775 |
|
776 /**** |
|
777 *SINT_TO_DINT |
|
778 */ |
|
779 case function_sint_to_dint : |
|
780 { |
|
781 symbol_c *last_type_symbol = NULL; |
|
782 |
|
783 { |
|
784 identifier_c param_name("IN"); |
|
785 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
786 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
787 |
|
788 /* Get the value from a foo(<param_value>) style call */ |
|
789 if (IN_param_value == NULL) |
|
790 IN_param_value = function_call_param_iterator.next(); |
|
791 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
792 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
793 |
|
794 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
795 { |
|
796 |
|
797 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
798 return return_type_symbol; |
|
799 |
|
800 } |
|
801 |
|
802 ERROR; |
|
803 } |
|
804 |
|
805 }/*function_sint_to_dint*/ |
|
806 break; |
|
807 |
|
808 /**** |
|
809 *SINT_TO_DATE |
|
810 */ |
|
811 case function_sint_to_date : |
|
812 { |
|
813 symbol_c *last_type_symbol = NULL; |
|
814 |
|
815 { |
|
816 identifier_c param_name("IN"); |
|
817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
819 |
|
820 /* Get the value from a foo(<param_value>) style call */ |
|
821 if (IN_param_value == NULL) |
|
822 IN_param_value = function_call_param_iterator.next(); |
|
823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
825 |
|
826 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
827 { |
|
828 |
|
829 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
830 return return_type_symbol; |
|
831 |
|
832 } |
|
833 |
|
834 ERROR; |
|
835 } |
|
836 |
|
837 }/*function_sint_to_date*/ |
|
838 break; |
|
839 |
|
840 /**** |
|
841 *SINT_TO_DWORD |
|
842 */ |
|
843 case function_sint_to_dword : |
|
844 { |
|
845 symbol_c *last_type_symbol = NULL; |
|
846 |
|
847 { |
|
848 identifier_c param_name("IN"); |
|
849 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
850 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
851 |
|
852 /* Get the value from a foo(<param_value>) style call */ |
|
853 if (IN_param_value == NULL) |
|
854 IN_param_value = function_call_param_iterator.next(); |
|
855 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
856 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
857 |
|
858 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
859 { |
|
860 |
|
861 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
862 return return_type_symbol; |
|
863 |
|
864 } |
|
865 |
|
866 ERROR; |
|
867 } |
|
868 |
|
869 }/*function_sint_to_dword*/ |
|
870 break; |
|
871 |
|
872 /**** |
|
873 *SINT_TO_DT |
|
874 */ |
|
875 case function_sint_to_dt : |
|
876 { |
|
877 symbol_c *last_type_symbol = NULL; |
|
878 |
|
879 { |
|
880 identifier_c param_name("IN"); |
|
881 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
882 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
883 |
|
884 /* Get the value from a foo(<param_value>) style call */ |
|
885 if (IN_param_value == NULL) |
|
886 IN_param_value = function_call_param_iterator.next(); |
|
887 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
888 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
889 |
|
890 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
891 { |
|
892 |
|
893 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
894 return return_type_symbol; |
|
895 |
|
896 } |
|
897 |
|
898 ERROR; |
|
899 } |
|
900 |
|
901 }/*function_sint_to_dt*/ |
|
902 break; |
|
903 |
|
904 /**** |
|
905 *SINT_TO_TOD |
|
906 */ |
|
907 case function_sint_to_tod : |
|
908 { |
|
909 symbol_c *last_type_symbol = NULL; |
|
910 |
|
911 { |
|
912 identifier_c param_name("IN"); |
|
913 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
914 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
915 |
|
916 /* Get the value from a foo(<param_value>) style call */ |
|
917 if (IN_param_value == NULL) |
|
918 IN_param_value = function_call_param_iterator.next(); |
|
919 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
920 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
921 |
|
922 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
923 { |
|
924 |
|
925 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
926 return return_type_symbol; |
|
927 |
|
928 } |
|
929 |
|
930 ERROR; |
|
931 } |
|
932 |
|
933 }/*function_sint_to_tod*/ |
|
934 break; |
|
935 |
|
936 /**** |
|
937 *SINT_TO_UDINT |
|
938 */ |
|
939 case function_sint_to_udint : |
|
940 { |
|
941 symbol_c *last_type_symbol = NULL; |
|
942 |
|
943 { |
|
944 identifier_c param_name("IN"); |
|
945 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
946 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
947 |
|
948 /* Get the value from a foo(<param_value>) style call */ |
|
949 if (IN_param_value == NULL) |
|
950 IN_param_value = function_call_param_iterator.next(); |
|
951 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
952 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
953 |
|
954 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
955 { |
|
956 |
|
957 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
958 return return_type_symbol; |
|
959 |
|
960 } |
|
961 |
|
962 ERROR; |
|
963 } |
|
964 |
|
965 }/*function_sint_to_udint*/ |
|
966 break; |
|
967 |
|
968 /**** |
|
969 *SINT_TO_WORD |
|
970 */ |
|
971 case function_sint_to_word : |
|
972 { |
|
973 symbol_c *last_type_symbol = NULL; |
|
974 |
|
975 { |
|
976 identifier_c param_name("IN"); |
|
977 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
978 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
979 |
|
980 /* Get the value from a foo(<param_value>) style call */ |
|
981 if (IN_param_value == NULL) |
|
982 IN_param_value = function_call_param_iterator.next(); |
|
983 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
984 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
985 |
|
986 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
987 { |
|
988 |
|
989 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
990 return return_type_symbol; |
|
991 |
|
992 } |
|
993 |
|
994 ERROR; |
|
995 } |
|
996 |
|
997 }/*function_sint_to_word*/ |
|
998 break; |
|
999 |
|
1000 /**** |
|
1001 *SINT_TO_WSTRING |
|
1002 */ |
|
1003 case function_sint_to_wstring : |
|
1004 { |
|
1005 symbol_c *last_type_symbol = NULL; |
|
1006 |
|
1007 { |
|
1008 identifier_c param_name("IN"); |
|
1009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1010 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1011 |
|
1012 /* Get the value from a foo(<param_value>) style call */ |
|
1013 if (IN_param_value == NULL) |
|
1014 IN_param_value = function_call_param_iterator.next(); |
|
1015 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1016 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1017 |
|
1018 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1019 { |
|
1020 |
|
1021 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
1022 return return_type_symbol; |
|
1023 |
|
1024 } |
|
1025 |
|
1026 ERROR; |
|
1027 } |
|
1028 |
|
1029 }/*function_sint_to_wstring*/ |
|
1030 break; |
|
1031 |
|
1032 /**** |
|
1033 *SINT_TO_STRING |
|
1034 */ |
|
1035 case function_sint_to_string : |
|
1036 { |
|
1037 symbol_c *last_type_symbol = NULL; |
|
1038 |
|
1039 { |
|
1040 identifier_c param_name("IN"); |
|
1041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1042 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1043 |
|
1044 /* Get the value from a foo(<param_value>) style call */ |
|
1045 if (IN_param_value == NULL) |
|
1046 IN_param_value = function_call_param_iterator.next(); |
|
1047 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1048 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1049 |
|
1050 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1051 { |
|
1052 |
|
1053 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
1054 return return_type_symbol; |
|
1055 |
|
1056 } |
|
1057 |
|
1058 ERROR; |
|
1059 } |
|
1060 |
|
1061 }/*function_sint_to_string*/ |
|
1062 break; |
|
1063 |
|
1064 /**** |
|
1065 *SINT_TO_LWORD |
|
1066 */ |
|
1067 case function_sint_to_lword : |
|
1068 { |
|
1069 symbol_c *last_type_symbol = NULL; |
|
1070 |
|
1071 { |
|
1072 identifier_c param_name("IN"); |
|
1073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1074 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1075 |
|
1076 /* Get the value from a foo(<param_value>) style call */ |
|
1077 if (IN_param_value == NULL) |
|
1078 IN_param_value = function_call_param_iterator.next(); |
|
1079 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1080 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1081 |
|
1082 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1083 { |
|
1084 |
|
1085 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
1086 return return_type_symbol; |
|
1087 |
|
1088 } |
|
1089 |
|
1090 ERROR; |
|
1091 } |
|
1092 |
|
1093 }/*function_sint_to_lword*/ |
|
1094 break; |
|
1095 |
|
1096 /**** |
|
1097 *SINT_TO_UINT |
|
1098 */ |
|
1099 case function_sint_to_uint : |
|
1100 { |
|
1101 symbol_c *last_type_symbol = NULL; |
|
1102 |
|
1103 { |
|
1104 identifier_c param_name("IN"); |
|
1105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1106 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1107 |
|
1108 /* Get the value from a foo(<param_value>) style call */ |
|
1109 if (IN_param_value == NULL) |
|
1110 IN_param_value = function_call_param_iterator.next(); |
|
1111 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1112 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1113 |
|
1114 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1115 { |
|
1116 |
|
1117 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
1118 return return_type_symbol; |
|
1119 |
|
1120 } |
|
1121 |
|
1122 ERROR; |
|
1123 } |
|
1124 |
|
1125 }/*function_sint_to_uint*/ |
|
1126 break; |
|
1127 |
|
1128 /**** |
|
1129 *SINT_TO_LREAL |
|
1130 */ |
|
1131 case function_sint_to_lreal : |
|
1132 { |
|
1133 symbol_c *last_type_symbol = NULL; |
|
1134 |
|
1135 { |
|
1136 identifier_c param_name("IN"); |
|
1137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1138 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1139 |
|
1140 /* Get the value from a foo(<param_value>) style call */ |
|
1141 if (IN_param_value == NULL) |
|
1142 IN_param_value = function_call_param_iterator.next(); |
|
1143 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1144 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1145 |
|
1146 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1147 { |
|
1148 |
|
1149 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
1150 return return_type_symbol; |
|
1151 |
|
1152 } |
|
1153 |
|
1154 ERROR; |
|
1155 } |
|
1156 |
|
1157 }/*function_sint_to_lreal*/ |
|
1158 break; |
|
1159 |
|
1160 /**** |
|
1161 *SINT_TO_BYTE |
|
1162 */ |
|
1163 case function_sint_to_byte : |
|
1164 { |
|
1165 symbol_c *last_type_symbol = NULL; |
|
1166 |
|
1167 { |
|
1168 identifier_c param_name("IN"); |
|
1169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1170 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1171 |
|
1172 /* Get the value from a foo(<param_value>) style call */ |
|
1173 if (IN_param_value == NULL) |
|
1174 IN_param_value = function_call_param_iterator.next(); |
|
1175 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1176 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1177 |
|
1178 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1179 { |
|
1180 |
|
1181 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
1182 return return_type_symbol; |
|
1183 |
|
1184 } |
|
1185 |
|
1186 ERROR; |
|
1187 } |
|
1188 |
|
1189 }/*function_sint_to_byte*/ |
|
1190 break; |
|
1191 |
|
1192 /**** |
|
1193 *SINT_TO_USINT |
|
1194 */ |
|
1195 case function_sint_to_usint : |
|
1196 { |
|
1197 symbol_c *last_type_symbol = NULL; |
|
1198 |
|
1199 { |
|
1200 identifier_c param_name("IN"); |
|
1201 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1202 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1203 |
|
1204 /* Get the value from a foo(<param_value>) style call */ |
|
1205 if (IN_param_value == NULL) |
|
1206 IN_param_value = function_call_param_iterator.next(); |
|
1207 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1208 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1209 |
|
1210 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1211 { |
|
1212 |
|
1213 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
1214 return return_type_symbol; |
|
1215 |
|
1216 } |
|
1217 |
|
1218 ERROR; |
|
1219 } |
|
1220 |
|
1221 }/*function_sint_to_usint*/ |
|
1222 break; |
|
1223 |
|
1224 /**** |
|
1225 *SINT_TO_ULINT |
|
1226 */ |
|
1227 case function_sint_to_ulint : |
|
1228 { |
|
1229 symbol_c *last_type_symbol = NULL; |
|
1230 |
|
1231 { |
|
1232 identifier_c param_name("IN"); |
|
1233 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1234 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1235 |
|
1236 /* Get the value from a foo(<param_value>) style call */ |
|
1237 if (IN_param_value == NULL) |
|
1238 IN_param_value = function_call_param_iterator.next(); |
|
1239 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1240 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1241 |
|
1242 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1243 { |
|
1244 |
|
1245 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
1246 return return_type_symbol; |
|
1247 |
|
1248 } |
|
1249 |
|
1250 ERROR; |
|
1251 } |
|
1252 |
|
1253 }/*function_sint_to_ulint*/ |
|
1254 break; |
|
1255 |
|
1256 /**** |
|
1257 *SINT_TO_BOOL |
|
1258 */ |
|
1259 case function_sint_to_bool : |
|
1260 { |
|
1261 symbol_c *last_type_symbol = NULL; |
|
1262 |
|
1263 { |
|
1264 identifier_c param_name("IN"); |
|
1265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1266 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1267 |
|
1268 /* Get the value from a foo(<param_value>) style call */ |
|
1269 if (IN_param_value == NULL) |
|
1270 IN_param_value = function_call_param_iterator.next(); |
|
1271 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1272 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1273 |
|
1274 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1275 { |
|
1276 |
|
1277 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
1278 return return_type_symbol; |
|
1279 |
|
1280 } |
|
1281 |
|
1282 ERROR; |
|
1283 } |
|
1284 |
|
1285 }/*function_sint_to_bool*/ |
|
1286 break; |
|
1287 |
|
1288 /**** |
|
1289 *SINT_TO_TIME |
|
1290 */ |
|
1291 case function_sint_to_time : |
|
1292 { |
|
1293 symbol_c *last_type_symbol = NULL; |
|
1294 |
|
1295 { |
|
1296 identifier_c param_name("IN"); |
|
1297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1299 |
|
1300 /* Get the value from a foo(<param_value>) style call */ |
|
1301 if (IN_param_value == NULL) |
|
1302 IN_param_value = function_call_param_iterator.next(); |
|
1303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1305 |
|
1306 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1307 { |
|
1308 |
|
1309 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
1310 return return_type_symbol; |
|
1311 |
|
1312 } |
|
1313 |
|
1314 ERROR; |
|
1315 } |
|
1316 |
|
1317 }/*function_sint_to_time*/ |
|
1318 break; |
|
1319 |
|
1320 /**** |
|
1321 *SINT_TO_INT |
|
1322 */ |
|
1323 case function_sint_to_int : |
|
1324 { |
|
1325 symbol_c *last_type_symbol = NULL; |
|
1326 |
|
1327 { |
|
1328 identifier_c param_name("IN"); |
|
1329 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1330 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1331 |
|
1332 /* Get the value from a foo(<param_value>) style call */ |
|
1333 if (IN_param_value == NULL) |
|
1334 IN_param_value = function_call_param_iterator.next(); |
|
1335 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1336 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1337 |
|
1338 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
1339 { |
|
1340 |
|
1341 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
1342 return return_type_symbol; |
|
1343 |
|
1344 } |
|
1345 |
|
1346 ERROR; |
|
1347 } |
|
1348 |
|
1349 }/*function_sint_to_int*/ |
|
1350 break; |
|
1351 |
|
1352 /**** |
|
1353 *LINT_TO_REAL |
|
1354 */ |
|
1355 case function_lint_to_real : |
|
1356 { |
|
1357 symbol_c *last_type_symbol = NULL; |
|
1358 |
|
1359 { |
|
1360 identifier_c param_name("IN"); |
|
1361 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1362 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1363 |
|
1364 /* Get the value from a foo(<param_value>) style call */ |
|
1365 if (IN_param_value == NULL) |
|
1366 IN_param_value = function_call_param_iterator.next(); |
|
1367 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1368 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1369 |
|
1370 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1371 { |
|
1372 |
|
1373 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
1374 return return_type_symbol; |
|
1375 |
|
1376 } |
|
1377 |
|
1378 ERROR; |
|
1379 } |
|
1380 |
|
1381 }/*function_lint_to_real*/ |
|
1382 break; |
|
1383 |
|
1384 /**** |
|
1385 *LINT_TO_SINT |
|
1386 */ |
|
1387 case function_lint_to_sint : |
|
1388 { |
|
1389 symbol_c *last_type_symbol = NULL; |
|
1390 |
|
1391 { |
|
1392 identifier_c param_name("IN"); |
|
1393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1394 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1395 |
|
1396 /* Get the value from a foo(<param_value>) style call */ |
|
1397 if (IN_param_value == NULL) |
|
1398 IN_param_value = function_call_param_iterator.next(); |
|
1399 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1400 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1401 |
|
1402 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1403 { |
|
1404 |
|
1405 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
1406 return return_type_symbol; |
|
1407 |
|
1408 } |
|
1409 |
|
1410 ERROR; |
|
1411 } |
|
1412 |
|
1413 }/*function_lint_to_sint*/ |
|
1414 break; |
|
1415 |
|
1416 /**** |
|
1417 *LINT_TO_LINT |
|
1418 */ |
|
1419 case function_lint_to_lint : |
|
1420 { |
|
1421 symbol_c *last_type_symbol = NULL; |
|
1422 |
|
1423 { |
|
1424 identifier_c param_name("IN"); |
|
1425 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1426 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1427 |
|
1428 /* Get the value from a foo(<param_value>) style call */ |
|
1429 if (IN_param_value == NULL) |
|
1430 IN_param_value = function_call_param_iterator.next(); |
|
1431 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1432 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1433 |
|
1434 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1435 { |
|
1436 |
|
1437 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
1438 return return_type_symbol; |
|
1439 |
|
1440 } |
|
1441 |
|
1442 ERROR; |
|
1443 } |
|
1444 |
|
1445 }/*function_lint_to_lint*/ |
|
1446 break; |
|
1447 |
|
1448 /**** |
|
1449 *LINT_TO_DINT |
|
1450 */ |
|
1451 case function_lint_to_dint : |
|
1452 { |
|
1453 symbol_c *last_type_symbol = NULL; |
|
1454 |
|
1455 { |
|
1456 identifier_c param_name("IN"); |
|
1457 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1458 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1459 |
|
1460 /* Get the value from a foo(<param_value>) style call */ |
|
1461 if (IN_param_value == NULL) |
|
1462 IN_param_value = function_call_param_iterator.next(); |
|
1463 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1464 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1465 |
|
1466 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1467 { |
|
1468 |
|
1469 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
1470 return return_type_symbol; |
|
1471 |
|
1472 } |
|
1473 |
|
1474 ERROR; |
|
1475 } |
|
1476 |
|
1477 }/*function_lint_to_dint*/ |
|
1478 break; |
|
1479 |
|
1480 /**** |
|
1481 *LINT_TO_DATE |
|
1482 */ |
|
1483 case function_lint_to_date : |
|
1484 { |
|
1485 symbol_c *last_type_symbol = NULL; |
|
1486 |
|
1487 { |
|
1488 identifier_c param_name("IN"); |
|
1489 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1490 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1491 |
|
1492 /* Get the value from a foo(<param_value>) style call */ |
|
1493 if (IN_param_value == NULL) |
|
1494 IN_param_value = function_call_param_iterator.next(); |
|
1495 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1496 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1497 |
|
1498 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1499 { |
|
1500 |
|
1501 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
1502 return return_type_symbol; |
|
1503 |
|
1504 } |
|
1505 |
|
1506 ERROR; |
|
1507 } |
|
1508 |
|
1509 }/*function_lint_to_date*/ |
|
1510 break; |
|
1511 |
|
1512 /**** |
|
1513 *LINT_TO_DWORD |
|
1514 */ |
|
1515 case function_lint_to_dword : |
|
1516 { |
|
1517 symbol_c *last_type_symbol = NULL; |
|
1518 |
|
1519 { |
|
1520 identifier_c param_name("IN"); |
|
1521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1523 |
|
1524 /* Get the value from a foo(<param_value>) style call */ |
|
1525 if (IN_param_value == NULL) |
|
1526 IN_param_value = function_call_param_iterator.next(); |
|
1527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1529 |
|
1530 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1531 { |
|
1532 |
|
1533 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
1534 return return_type_symbol; |
|
1535 |
|
1536 } |
|
1537 |
|
1538 ERROR; |
|
1539 } |
|
1540 |
|
1541 }/*function_lint_to_dword*/ |
|
1542 break; |
|
1543 |
|
1544 /**** |
|
1545 *LINT_TO_DT |
|
1546 */ |
|
1547 case function_lint_to_dt : |
|
1548 { |
|
1549 symbol_c *last_type_symbol = NULL; |
|
1550 |
|
1551 { |
|
1552 identifier_c param_name("IN"); |
|
1553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1554 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1555 |
|
1556 /* Get the value from a foo(<param_value>) style call */ |
|
1557 if (IN_param_value == NULL) |
|
1558 IN_param_value = function_call_param_iterator.next(); |
|
1559 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1560 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1561 |
|
1562 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1563 { |
|
1564 |
|
1565 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
1566 return return_type_symbol; |
|
1567 |
|
1568 } |
|
1569 |
|
1570 ERROR; |
|
1571 } |
|
1572 |
|
1573 }/*function_lint_to_dt*/ |
|
1574 break; |
|
1575 |
|
1576 /**** |
|
1577 *LINT_TO_TOD |
|
1578 */ |
|
1579 case function_lint_to_tod : |
|
1580 { |
|
1581 symbol_c *last_type_symbol = NULL; |
|
1582 |
|
1583 { |
|
1584 identifier_c param_name("IN"); |
|
1585 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1586 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1587 |
|
1588 /* Get the value from a foo(<param_value>) style call */ |
|
1589 if (IN_param_value == NULL) |
|
1590 IN_param_value = function_call_param_iterator.next(); |
|
1591 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1592 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1593 |
|
1594 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1595 { |
|
1596 |
|
1597 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
1598 return return_type_symbol; |
|
1599 |
|
1600 } |
|
1601 |
|
1602 ERROR; |
|
1603 } |
|
1604 |
|
1605 }/*function_lint_to_tod*/ |
|
1606 break; |
|
1607 |
|
1608 /**** |
|
1609 *LINT_TO_UDINT |
|
1610 */ |
|
1611 case function_lint_to_udint : |
|
1612 { |
|
1613 symbol_c *last_type_symbol = NULL; |
|
1614 |
|
1615 { |
|
1616 identifier_c param_name("IN"); |
|
1617 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1618 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1619 |
|
1620 /* Get the value from a foo(<param_value>) style call */ |
|
1621 if (IN_param_value == NULL) |
|
1622 IN_param_value = function_call_param_iterator.next(); |
|
1623 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1624 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1625 |
|
1626 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1627 { |
|
1628 |
|
1629 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
1630 return return_type_symbol; |
|
1631 |
|
1632 } |
|
1633 |
|
1634 ERROR; |
|
1635 } |
|
1636 |
|
1637 }/*function_lint_to_udint*/ |
|
1638 break; |
|
1639 |
|
1640 /**** |
|
1641 *LINT_TO_WORD |
|
1642 */ |
|
1643 case function_lint_to_word : |
|
1644 { |
|
1645 symbol_c *last_type_symbol = NULL; |
|
1646 |
|
1647 { |
|
1648 identifier_c param_name("IN"); |
|
1649 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1650 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1651 |
|
1652 /* Get the value from a foo(<param_value>) style call */ |
|
1653 if (IN_param_value == NULL) |
|
1654 IN_param_value = function_call_param_iterator.next(); |
|
1655 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1656 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1657 |
|
1658 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1659 { |
|
1660 |
|
1661 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
1662 return return_type_symbol; |
|
1663 |
|
1664 } |
|
1665 |
|
1666 ERROR; |
|
1667 } |
|
1668 |
|
1669 }/*function_lint_to_word*/ |
|
1670 break; |
|
1671 |
|
1672 /**** |
|
1673 *LINT_TO_WSTRING |
|
1674 */ |
|
1675 case function_lint_to_wstring : |
|
1676 { |
|
1677 symbol_c *last_type_symbol = NULL; |
|
1678 |
|
1679 { |
|
1680 identifier_c param_name("IN"); |
|
1681 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1682 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1683 |
|
1684 /* Get the value from a foo(<param_value>) style call */ |
|
1685 if (IN_param_value == NULL) |
|
1686 IN_param_value = function_call_param_iterator.next(); |
|
1687 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1688 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1689 |
|
1690 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1691 { |
|
1692 |
|
1693 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
1694 return return_type_symbol; |
|
1695 |
|
1696 } |
|
1697 |
|
1698 ERROR; |
|
1699 } |
|
1700 |
|
1701 }/*function_lint_to_wstring*/ |
|
1702 break; |
|
1703 |
|
1704 /**** |
|
1705 *LINT_TO_STRING |
|
1706 */ |
|
1707 case function_lint_to_string : |
|
1708 { |
|
1709 symbol_c *last_type_symbol = NULL; |
|
1710 |
|
1711 { |
|
1712 identifier_c param_name("IN"); |
|
1713 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1714 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1715 |
|
1716 /* Get the value from a foo(<param_value>) style call */ |
|
1717 if (IN_param_value == NULL) |
|
1718 IN_param_value = function_call_param_iterator.next(); |
|
1719 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1720 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1721 |
|
1722 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1723 { |
|
1724 |
|
1725 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
1726 return return_type_symbol; |
|
1727 |
|
1728 } |
|
1729 |
|
1730 ERROR; |
|
1731 } |
|
1732 |
|
1733 }/*function_lint_to_string*/ |
|
1734 break; |
|
1735 |
|
1736 /**** |
|
1737 *LINT_TO_LWORD |
|
1738 */ |
|
1739 case function_lint_to_lword : |
|
1740 { |
|
1741 symbol_c *last_type_symbol = NULL; |
|
1742 |
|
1743 { |
|
1744 identifier_c param_name("IN"); |
|
1745 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1746 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1747 |
|
1748 /* Get the value from a foo(<param_value>) style call */ |
|
1749 if (IN_param_value == NULL) |
|
1750 IN_param_value = function_call_param_iterator.next(); |
|
1751 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1752 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1753 |
|
1754 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1755 { |
|
1756 |
|
1757 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
1758 return return_type_symbol; |
|
1759 |
|
1760 } |
|
1761 |
|
1762 ERROR; |
|
1763 } |
|
1764 |
|
1765 }/*function_lint_to_lword*/ |
|
1766 break; |
|
1767 |
|
1768 /**** |
|
1769 *LINT_TO_UINT |
|
1770 */ |
|
1771 case function_lint_to_uint : |
|
1772 { |
|
1773 symbol_c *last_type_symbol = NULL; |
|
1774 |
|
1775 { |
|
1776 identifier_c param_name("IN"); |
|
1777 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1778 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1779 |
|
1780 /* Get the value from a foo(<param_value>) style call */ |
|
1781 if (IN_param_value == NULL) |
|
1782 IN_param_value = function_call_param_iterator.next(); |
|
1783 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1784 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1785 |
|
1786 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1787 { |
|
1788 |
|
1789 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
1790 return return_type_symbol; |
|
1791 |
|
1792 } |
|
1793 |
|
1794 ERROR; |
|
1795 } |
|
1796 |
|
1797 }/*function_lint_to_uint*/ |
|
1798 break; |
|
1799 |
|
1800 /**** |
|
1801 *LINT_TO_LREAL |
|
1802 */ |
|
1803 case function_lint_to_lreal : |
|
1804 { |
|
1805 symbol_c *last_type_symbol = NULL; |
|
1806 |
|
1807 { |
|
1808 identifier_c param_name("IN"); |
|
1809 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1810 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1811 |
|
1812 /* Get the value from a foo(<param_value>) style call */ |
|
1813 if (IN_param_value == NULL) |
|
1814 IN_param_value = function_call_param_iterator.next(); |
|
1815 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1816 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1817 |
|
1818 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1819 { |
|
1820 |
|
1821 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
1822 return return_type_symbol; |
|
1823 |
|
1824 } |
|
1825 |
|
1826 ERROR; |
|
1827 } |
|
1828 |
|
1829 }/*function_lint_to_lreal*/ |
|
1830 break; |
|
1831 |
|
1832 /**** |
|
1833 *LINT_TO_BYTE |
|
1834 */ |
|
1835 case function_lint_to_byte : |
|
1836 { |
|
1837 symbol_c *last_type_symbol = NULL; |
|
1838 |
|
1839 { |
|
1840 identifier_c param_name("IN"); |
|
1841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1842 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1843 |
|
1844 /* Get the value from a foo(<param_value>) style call */ |
|
1845 if (IN_param_value == NULL) |
|
1846 IN_param_value = function_call_param_iterator.next(); |
|
1847 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1848 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1849 |
|
1850 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1851 { |
|
1852 |
|
1853 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
1854 return return_type_symbol; |
|
1855 |
|
1856 } |
|
1857 |
|
1858 ERROR; |
|
1859 } |
|
1860 |
|
1861 }/*function_lint_to_byte*/ |
|
1862 break; |
|
1863 |
|
1864 /**** |
|
1865 *LINT_TO_USINT |
|
1866 */ |
|
1867 case function_lint_to_usint : |
|
1868 { |
|
1869 symbol_c *last_type_symbol = NULL; |
|
1870 |
|
1871 { |
|
1872 identifier_c param_name("IN"); |
|
1873 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1874 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1875 |
|
1876 /* Get the value from a foo(<param_value>) style call */ |
|
1877 if (IN_param_value == NULL) |
|
1878 IN_param_value = function_call_param_iterator.next(); |
|
1879 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1880 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1881 |
|
1882 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1883 { |
|
1884 |
|
1885 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
1886 return return_type_symbol; |
|
1887 |
|
1888 } |
|
1889 |
|
1890 ERROR; |
|
1891 } |
|
1892 |
|
1893 }/*function_lint_to_usint*/ |
|
1894 break; |
|
1895 |
|
1896 /**** |
|
1897 *LINT_TO_ULINT |
|
1898 */ |
|
1899 case function_lint_to_ulint : |
|
1900 { |
|
1901 symbol_c *last_type_symbol = NULL; |
|
1902 |
|
1903 { |
|
1904 identifier_c param_name("IN"); |
|
1905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1906 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1907 |
|
1908 /* Get the value from a foo(<param_value>) style call */ |
|
1909 if (IN_param_value == NULL) |
|
1910 IN_param_value = function_call_param_iterator.next(); |
|
1911 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1912 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1913 |
|
1914 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1915 { |
|
1916 |
|
1917 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
1918 return return_type_symbol; |
|
1919 |
|
1920 } |
|
1921 |
|
1922 ERROR; |
|
1923 } |
|
1924 |
|
1925 }/*function_lint_to_ulint*/ |
|
1926 break; |
|
1927 |
|
1928 /**** |
|
1929 *LINT_TO_BOOL |
|
1930 */ |
|
1931 case function_lint_to_bool : |
|
1932 { |
|
1933 symbol_c *last_type_symbol = NULL; |
|
1934 |
|
1935 { |
|
1936 identifier_c param_name("IN"); |
|
1937 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1938 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1939 |
|
1940 /* Get the value from a foo(<param_value>) style call */ |
|
1941 if (IN_param_value == NULL) |
|
1942 IN_param_value = function_call_param_iterator.next(); |
|
1943 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1944 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1945 |
|
1946 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1947 { |
|
1948 |
|
1949 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
1950 return return_type_symbol; |
|
1951 |
|
1952 } |
|
1953 |
|
1954 ERROR; |
|
1955 } |
|
1956 |
|
1957 }/*function_lint_to_bool*/ |
|
1958 break; |
|
1959 |
|
1960 /**** |
|
1961 *LINT_TO_TIME |
|
1962 */ |
|
1963 case function_lint_to_time : |
|
1964 { |
|
1965 symbol_c *last_type_symbol = NULL; |
|
1966 |
|
1967 { |
|
1968 identifier_c param_name("IN"); |
|
1969 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1970 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
1971 |
|
1972 /* Get the value from a foo(<param_value>) style call */ |
|
1973 if (IN_param_value == NULL) |
|
1974 IN_param_value = function_call_param_iterator.next(); |
|
1975 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1976 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1977 |
|
1978 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
1979 { |
|
1980 |
|
1981 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
1982 return return_type_symbol; |
|
1983 |
|
1984 } |
|
1985 |
|
1986 ERROR; |
|
1987 } |
|
1988 |
|
1989 }/*function_lint_to_time*/ |
|
1990 break; |
|
1991 |
|
1992 /**** |
|
1993 *LINT_TO_INT |
|
1994 */ |
|
1995 case function_lint_to_int : |
|
1996 { |
|
1997 symbol_c *last_type_symbol = NULL; |
|
1998 |
|
1999 { |
|
2000 identifier_c param_name("IN"); |
|
2001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2003 |
|
2004 /* Get the value from a foo(<param_value>) style call */ |
|
2005 if (IN_param_value == NULL) |
|
2006 IN_param_value = function_call_param_iterator.next(); |
|
2007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2009 |
|
2010 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
2011 { |
|
2012 |
|
2013 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
2014 return return_type_symbol; |
|
2015 |
|
2016 } |
|
2017 |
|
2018 ERROR; |
|
2019 } |
|
2020 |
|
2021 }/*function_lint_to_int*/ |
|
2022 break; |
|
2023 |
|
2024 /**** |
|
2025 *DINT_TO_REAL |
|
2026 */ |
|
2027 case function_dint_to_real : |
|
2028 { |
|
2029 symbol_c *last_type_symbol = NULL; |
|
2030 |
|
2031 { |
|
2032 identifier_c param_name("IN"); |
|
2033 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2034 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2035 |
|
2036 /* Get the value from a foo(<param_value>) style call */ |
|
2037 if (IN_param_value == NULL) |
|
2038 IN_param_value = function_call_param_iterator.next(); |
|
2039 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2040 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2041 |
|
2042 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2043 { |
|
2044 |
|
2045 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
2046 return return_type_symbol; |
|
2047 |
|
2048 } |
|
2049 |
|
2050 ERROR; |
|
2051 } |
|
2052 |
|
2053 }/*function_dint_to_real*/ |
|
2054 break; |
|
2055 |
|
2056 /**** |
|
2057 *DINT_TO_SINT |
|
2058 */ |
|
2059 case function_dint_to_sint : |
|
2060 { |
|
2061 symbol_c *last_type_symbol = NULL; |
|
2062 |
|
2063 { |
|
2064 identifier_c param_name("IN"); |
|
2065 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2066 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2067 |
|
2068 /* Get the value from a foo(<param_value>) style call */ |
|
2069 if (IN_param_value == NULL) |
|
2070 IN_param_value = function_call_param_iterator.next(); |
|
2071 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2072 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2073 |
|
2074 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2075 { |
|
2076 |
|
2077 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
2078 return return_type_symbol; |
|
2079 |
|
2080 } |
|
2081 |
|
2082 ERROR; |
|
2083 } |
|
2084 |
|
2085 }/*function_dint_to_sint*/ |
|
2086 break; |
|
2087 |
|
2088 /**** |
|
2089 *DINT_TO_LINT |
|
2090 */ |
|
2091 case function_dint_to_lint : |
|
2092 { |
|
2093 symbol_c *last_type_symbol = NULL; |
|
2094 |
|
2095 { |
|
2096 identifier_c param_name("IN"); |
|
2097 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2098 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2099 |
|
2100 /* Get the value from a foo(<param_value>) style call */ |
|
2101 if (IN_param_value == NULL) |
|
2102 IN_param_value = function_call_param_iterator.next(); |
|
2103 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2104 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2105 |
|
2106 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2107 { |
|
2108 |
|
2109 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
2110 return return_type_symbol; |
|
2111 |
|
2112 } |
|
2113 |
|
2114 ERROR; |
|
2115 } |
|
2116 |
|
2117 }/*function_dint_to_lint*/ |
|
2118 break; |
|
2119 |
|
2120 /**** |
|
2121 *DINT_TO_DINT |
|
2122 */ |
|
2123 case function_dint_to_dint : |
|
2124 { |
|
2125 symbol_c *last_type_symbol = NULL; |
|
2126 |
|
2127 { |
|
2128 identifier_c param_name("IN"); |
|
2129 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2130 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2131 |
|
2132 /* Get the value from a foo(<param_value>) style call */ |
|
2133 if (IN_param_value == NULL) |
|
2134 IN_param_value = function_call_param_iterator.next(); |
|
2135 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2137 |
|
2138 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2139 { |
|
2140 |
|
2141 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
2142 return return_type_symbol; |
|
2143 |
|
2144 } |
|
2145 |
|
2146 ERROR; |
|
2147 } |
|
2148 |
|
2149 }/*function_dint_to_dint*/ |
|
2150 break; |
|
2151 |
|
2152 /**** |
|
2153 *DINT_TO_DATE |
|
2154 */ |
|
2155 case function_dint_to_date : |
|
2156 { |
|
2157 symbol_c *last_type_symbol = NULL; |
|
2158 |
|
2159 { |
|
2160 identifier_c param_name("IN"); |
|
2161 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2162 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2163 |
|
2164 /* Get the value from a foo(<param_value>) style call */ |
|
2165 if (IN_param_value == NULL) |
|
2166 IN_param_value = function_call_param_iterator.next(); |
|
2167 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2168 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2169 |
|
2170 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2171 { |
|
2172 |
|
2173 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
2174 return return_type_symbol; |
|
2175 |
|
2176 } |
|
2177 |
|
2178 ERROR; |
|
2179 } |
|
2180 |
|
2181 }/*function_dint_to_date*/ |
|
2182 break; |
|
2183 |
|
2184 /**** |
|
2185 *DINT_TO_DWORD |
|
2186 */ |
|
2187 case function_dint_to_dword : |
|
2188 { |
|
2189 symbol_c *last_type_symbol = NULL; |
|
2190 |
|
2191 { |
|
2192 identifier_c param_name("IN"); |
|
2193 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2194 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2195 |
|
2196 /* Get the value from a foo(<param_value>) style call */ |
|
2197 if (IN_param_value == NULL) |
|
2198 IN_param_value = function_call_param_iterator.next(); |
|
2199 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2200 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2201 |
|
2202 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2203 { |
|
2204 |
|
2205 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
2206 return return_type_symbol; |
|
2207 |
|
2208 } |
|
2209 |
|
2210 ERROR; |
|
2211 } |
|
2212 |
|
2213 }/*function_dint_to_dword*/ |
|
2214 break; |
|
2215 |
|
2216 /**** |
|
2217 *DINT_TO_DT |
|
2218 */ |
|
2219 case function_dint_to_dt : |
|
2220 { |
|
2221 symbol_c *last_type_symbol = NULL; |
|
2222 |
|
2223 { |
|
2224 identifier_c param_name("IN"); |
|
2225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2227 |
|
2228 /* Get the value from a foo(<param_value>) style call */ |
|
2229 if (IN_param_value == NULL) |
|
2230 IN_param_value = function_call_param_iterator.next(); |
|
2231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2233 |
|
2234 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2235 { |
|
2236 |
|
2237 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
2238 return return_type_symbol; |
|
2239 |
|
2240 } |
|
2241 |
|
2242 ERROR; |
|
2243 } |
|
2244 |
|
2245 }/*function_dint_to_dt*/ |
|
2246 break; |
|
2247 |
|
2248 /**** |
|
2249 *DINT_TO_TOD |
|
2250 */ |
|
2251 case function_dint_to_tod : |
|
2252 { |
|
2253 symbol_c *last_type_symbol = NULL; |
|
2254 |
|
2255 { |
|
2256 identifier_c param_name("IN"); |
|
2257 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2258 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2259 |
|
2260 /* Get the value from a foo(<param_value>) style call */ |
|
2261 if (IN_param_value == NULL) |
|
2262 IN_param_value = function_call_param_iterator.next(); |
|
2263 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2264 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2265 |
|
2266 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2267 { |
|
2268 |
|
2269 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
2270 return return_type_symbol; |
|
2271 |
|
2272 } |
|
2273 |
|
2274 ERROR; |
|
2275 } |
|
2276 |
|
2277 }/*function_dint_to_tod*/ |
|
2278 break; |
|
2279 |
|
2280 /**** |
|
2281 *DINT_TO_UDINT |
|
2282 */ |
|
2283 case function_dint_to_udint : |
|
2284 { |
|
2285 symbol_c *last_type_symbol = NULL; |
|
2286 |
|
2287 { |
|
2288 identifier_c param_name("IN"); |
|
2289 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2290 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2291 |
|
2292 /* Get the value from a foo(<param_value>) style call */ |
|
2293 if (IN_param_value == NULL) |
|
2294 IN_param_value = function_call_param_iterator.next(); |
|
2295 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2296 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2297 |
|
2298 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2299 { |
|
2300 |
|
2301 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
2302 return return_type_symbol; |
|
2303 |
|
2304 } |
|
2305 |
|
2306 ERROR; |
|
2307 } |
|
2308 |
|
2309 }/*function_dint_to_udint*/ |
|
2310 break; |
|
2311 |
|
2312 /**** |
|
2313 *DINT_TO_WORD |
|
2314 */ |
|
2315 case function_dint_to_word : |
|
2316 { |
|
2317 symbol_c *last_type_symbol = NULL; |
|
2318 |
|
2319 { |
|
2320 identifier_c param_name("IN"); |
|
2321 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2322 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2323 |
|
2324 /* Get the value from a foo(<param_value>) style call */ |
|
2325 if (IN_param_value == NULL) |
|
2326 IN_param_value = function_call_param_iterator.next(); |
|
2327 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2328 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2329 |
|
2330 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2331 { |
|
2332 |
|
2333 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
2334 return return_type_symbol; |
|
2335 |
|
2336 } |
|
2337 |
|
2338 ERROR; |
|
2339 } |
|
2340 |
|
2341 }/*function_dint_to_word*/ |
|
2342 break; |
|
2343 |
|
2344 /**** |
|
2345 *DINT_TO_WSTRING |
|
2346 */ |
|
2347 case function_dint_to_wstring : |
|
2348 { |
|
2349 symbol_c *last_type_symbol = NULL; |
|
2350 |
|
2351 { |
|
2352 identifier_c param_name("IN"); |
|
2353 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2354 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2355 |
|
2356 /* Get the value from a foo(<param_value>) style call */ |
|
2357 if (IN_param_value == NULL) |
|
2358 IN_param_value = function_call_param_iterator.next(); |
|
2359 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2360 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2361 |
|
2362 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2363 { |
|
2364 |
|
2365 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
2366 return return_type_symbol; |
|
2367 |
|
2368 } |
|
2369 |
|
2370 ERROR; |
|
2371 } |
|
2372 |
|
2373 }/*function_dint_to_wstring*/ |
|
2374 break; |
|
2375 |
|
2376 /**** |
|
2377 *DINT_TO_STRING |
|
2378 */ |
|
2379 case function_dint_to_string : |
|
2380 { |
|
2381 symbol_c *last_type_symbol = NULL; |
|
2382 |
|
2383 { |
|
2384 identifier_c param_name("IN"); |
|
2385 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2386 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2387 |
|
2388 /* Get the value from a foo(<param_value>) style call */ |
|
2389 if (IN_param_value == NULL) |
|
2390 IN_param_value = function_call_param_iterator.next(); |
|
2391 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2392 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2393 |
|
2394 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2395 { |
|
2396 |
|
2397 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
2398 return return_type_symbol; |
|
2399 |
|
2400 } |
|
2401 |
|
2402 ERROR; |
|
2403 } |
|
2404 |
|
2405 }/*function_dint_to_string*/ |
|
2406 break; |
|
2407 |
|
2408 /**** |
|
2409 *DINT_TO_LWORD |
|
2410 */ |
|
2411 case function_dint_to_lword : |
|
2412 { |
|
2413 symbol_c *last_type_symbol = NULL; |
|
2414 |
|
2415 { |
|
2416 identifier_c param_name("IN"); |
|
2417 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2418 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2419 |
|
2420 /* Get the value from a foo(<param_value>) style call */ |
|
2421 if (IN_param_value == NULL) |
|
2422 IN_param_value = function_call_param_iterator.next(); |
|
2423 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2424 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2425 |
|
2426 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2427 { |
|
2428 |
|
2429 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
2430 return return_type_symbol; |
|
2431 |
|
2432 } |
|
2433 |
|
2434 ERROR; |
|
2435 } |
|
2436 |
|
2437 }/*function_dint_to_lword*/ |
|
2438 break; |
|
2439 |
|
2440 /**** |
|
2441 *DINT_TO_UINT |
|
2442 */ |
|
2443 case function_dint_to_uint : |
|
2444 { |
|
2445 symbol_c *last_type_symbol = NULL; |
|
2446 |
|
2447 { |
|
2448 identifier_c param_name("IN"); |
|
2449 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2450 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2451 |
|
2452 /* Get the value from a foo(<param_value>) style call */ |
|
2453 if (IN_param_value == NULL) |
|
2454 IN_param_value = function_call_param_iterator.next(); |
|
2455 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2456 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2457 |
|
2458 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2459 { |
|
2460 |
|
2461 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
2462 return return_type_symbol; |
|
2463 |
|
2464 } |
|
2465 |
|
2466 ERROR; |
|
2467 } |
|
2468 |
|
2469 }/*function_dint_to_uint*/ |
|
2470 break; |
|
2471 |
|
2472 /**** |
|
2473 *DINT_TO_LREAL |
|
2474 */ |
|
2475 case function_dint_to_lreal : |
|
2476 { |
|
2477 symbol_c *last_type_symbol = NULL; |
|
2478 |
|
2479 { |
|
2480 identifier_c param_name("IN"); |
|
2481 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2482 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2483 |
|
2484 /* Get the value from a foo(<param_value>) style call */ |
|
2485 if (IN_param_value == NULL) |
|
2486 IN_param_value = function_call_param_iterator.next(); |
|
2487 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2488 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2489 |
|
2490 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2491 { |
|
2492 |
|
2493 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
2494 return return_type_symbol; |
|
2495 |
|
2496 } |
|
2497 |
|
2498 ERROR; |
|
2499 } |
|
2500 |
|
2501 }/*function_dint_to_lreal*/ |
|
2502 break; |
|
2503 |
|
2504 /**** |
|
2505 *DINT_TO_BYTE |
|
2506 */ |
|
2507 case function_dint_to_byte : |
|
2508 { |
|
2509 symbol_c *last_type_symbol = NULL; |
|
2510 |
|
2511 { |
|
2512 identifier_c param_name("IN"); |
|
2513 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2514 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2515 |
|
2516 /* Get the value from a foo(<param_value>) style call */ |
|
2517 if (IN_param_value == NULL) |
|
2518 IN_param_value = function_call_param_iterator.next(); |
|
2519 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2520 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2521 |
|
2522 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2523 { |
|
2524 |
|
2525 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
2526 return return_type_symbol; |
|
2527 |
|
2528 } |
|
2529 |
|
2530 ERROR; |
|
2531 } |
|
2532 |
|
2533 }/*function_dint_to_byte*/ |
|
2534 break; |
|
2535 |
|
2536 /**** |
|
2537 *DINT_TO_USINT |
|
2538 */ |
|
2539 case function_dint_to_usint : |
|
2540 { |
|
2541 symbol_c *last_type_symbol = NULL; |
|
2542 |
|
2543 { |
|
2544 identifier_c param_name("IN"); |
|
2545 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2546 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2547 |
|
2548 /* Get the value from a foo(<param_value>) style call */ |
|
2549 if (IN_param_value == NULL) |
|
2550 IN_param_value = function_call_param_iterator.next(); |
|
2551 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2552 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2553 |
|
2554 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2555 { |
|
2556 |
|
2557 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
2558 return return_type_symbol; |
|
2559 |
|
2560 } |
|
2561 |
|
2562 ERROR; |
|
2563 } |
|
2564 |
|
2565 }/*function_dint_to_usint*/ |
|
2566 break; |
|
2567 |
|
2568 /**** |
|
2569 *DINT_TO_ULINT |
|
2570 */ |
|
2571 case function_dint_to_ulint : |
|
2572 { |
|
2573 symbol_c *last_type_symbol = NULL; |
|
2574 |
|
2575 { |
|
2576 identifier_c param_name("IN"); |
|
2577 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2578 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2579 |
|
2580 /* Get the value from a foo(<param_value>) style call */ |
|
2581 if (IN_param_value == NULL) |
|
2582 IN_param_value = function_call_param_iterator.next(); |
|
2583 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2584 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2585 |
|
2586 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2587 { |
|
2588 |
|
2589 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
2590 return return_type_symbol; |
|
2591 |
|
2592 } |
|
2593 |
|
2594 ERROR; |
|
2595 } |
|
2596 |
|
2597 }/*function_dint_to_ulint*/ |
|
2598 break; |
|
2599 |
|
2600 /**** |
|
2601 *DINT_TO_BOOL |
|
2602 */ |
|
2603 case function_dint_to_bool : |
|
2604 { |
|
2605 symbol_c *last_type_symbol = NULL; |
|
2606 |
|
2607 { |
|
2608 identifier_c param_name("IN"); |
|
2609 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2610 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2611 |
|
2612 /* Get the value from a foo(<param_value>) style call */ |
|
2613 if (IN_param_value == NULL) |
|
2614 IN_param_value = function_call_param_iterator.next(); |
|
2615 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2616 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2617 |
|
2618 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2619 { |
|
2620 |
|
2621 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
2622 return return_type_symbol; |
|
2623 |
|
2624 } |
|
2625 |
|
2626 ERROR; |
|
2627 } |
|
2628 |
|
2629 }/*function_dint_to_bool*/ |
|
2630 break; |
|
2631 |
|
2632 /**** |
|
2633 *DINT_TO_TIME |
|
2634 */ |
|
2635 case function_dint_to_time : |
|
2636 { |
|
2637 symbol_c *last_type_symbol = NULL; |
|
2638 |
|
2639 { |
|
2640 identifier_c param_name("IN"); |
|
2641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2642 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2643 |
|
2644 /* Get the value from a foo(<param_value>) style call */ |
|
2645 if (IN_param_value == NULL) |
|
2646 IN_param_value = function_call_param_iterator.next(); |
|
2647 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2648 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2649 |
|
2650 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2651 { |
|
2652 |
|
2653 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
2654 return return_type_symbol; |
|
2655 |
|
2656 } |
|
2657 |
|
2658 ERROR; |
|
2659 } |
|
2660 |
|
2661 }/*function_dint_to_time*/ |
|
2662 break; |
|
2663 |
|
2664 /**** |
|
2665 *DINT_TO_INT |
|
2666 */ |
|
2667 case function_dint_to_int : |
|
2668 { |
|
2669 symbol_c *last_type_symbol = NULL; |
|
2670 |
|
2671 { |
|
2672 identifier_c param_name("IN"); |
|
2673 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2674 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2675 |
|
2676 /* Get the value from a foo(<param_value>) style call */ |
|
2677 if (IN_param_value == NULL) |
|
2678 IN_param_value = function_call_param_iterator.next(); |
|
2679 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2680 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2681 |
|
2682 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
2683 { |
|
2684 |
|
2685 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
2686 return return_type_symbol; |
|
2687 |
|
2688 } |
|
2689 |
|
2690 ERROR; |
|
2691 } |
|
2692 |
|
2693 }/*function_dint_to_int*/ |
|
2694 break; |
|
2695 |
|
2696 /**** |
|
2697 *DATE_TO_REAL |
|
2698 */ |
|
2699 case function_date_to_real : |
|
2700 { |
|
2701 symbol_c *last_type_symbol = NULL; |
|
2702 |
|
2703 { |
|
2704 identifier_c param_name("IN"); |
|
2705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2707 |
|
2708 /* Get the value from a foo(<param_value>) style call */ |
|
2709 if (IN_param_value == NULL) |
|
2710 IN_param_value = function_call_param_iterator.next(); |
|
2711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2713 |
|
2714 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2715 { |
|
2716 |
|
2717 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
2718 return return_type_symbol; |
|
2719 |
|
2720 } |
|
2721 |
|
2722 ERROR; |
|
2723 } |
|
2724 |
|
2725 }/*function_date_to_real*/ |
|
2726 break; |
|
2727 |
|
2728 /**** |
|
2729 *DATE_TO_SINT |
|
2730 */ |
|
2731 case function_date_to_sint : |
|
2732 { |
|
2733 symbol_c *last_type_symbol = NULL; |
|
2734 |
|
2735 { |
|
2736 identifier_c param_name("IN"); |
|
2737 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2738 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2739 |
|
2740 /* Get the value from a foo(<param_value>) style call */ |
|
2741 if (IN_param_value == NULL) |
|
2742 IN_param_value = function_call_param_iterator.next(); |
|
2743 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2744 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2745 |
|
2746 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2747 { |
|
2748 |
|
2749 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
2750 return return_type_symbol; |
|
2751 |
|
2752 } |
|
2753 |
|
2754 ERROR; |
|
2755 } |
|
2756 |
|
2757 }/*function_date_to_sint*/ |
|
2758 break; |
|
2759 |
|
2760 /**** |
|
2761 *DATE_TO_LINT |
|
2762 */ |
|
2763 case function_date_to_lint : |
|
2764 { |
|
2765 symbol_c *last_type_symbol = NULL; |
|
2766 |
|
2767 { |
|
2768 identifier_c param_name("IN"); |
|
2769 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2770 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2771 |
|
2772 /* Get the value from a foo(<param_value>) style call */ |
|
2773 if (IN_param_value == NULL) |
|
2774 IN_param_value = function_call_param_iterator.next(); |
|
2775 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2776 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2777 |
|
2778 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2779 { |
|
2780 |
|
2781 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
2782 return return_type_symbol; |
|
2783 |
|
2784 } |
|
2785 |
|
2786 ERROR; |
|
2787 } |
|
2788 |
|
2789 }/*function_date_to_lint*/ |
|
2790 break; |
|
2791 |
|
2792 /**** |
|
2793 *DATE_TO_DINT |
|
2794 */ |
|
2795 case function_date_to_dint : |
|
2796 { |
|
2797 symbol_c *last_type_symbol = NULL; |
|
2798 |
|
2799 { |
|
2800 identifier_c param_name("IN"); |
|
2801 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2802 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2803 |
|
2804 /* Get the value from a foo(<param_value>) style call */ |
|
2805 if (IN_param_value == NULL) |
|
2806 IN_param_value = function_call_param_iterator.next(); |
|
2807 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2808 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2809 |
|
2810 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2811 { |
|
2812 |
|
2813 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
2814 return return_type_symbol; |
|
2815 |
|
2816 } |
|
2817 |
|
2818 ERROR; |
|
2819 } |
|
2820 |
|
2821 }/*function_date_to_dint*/ |
|
2822 break; |
|
2823 |
|
2824 /**** |
|
2825 *DATE_TO_DATE |
|
2826 */ |
|
2827 case function_date_to_date : |
|
2828 { |
|
2829 symbol_c *last_type_symbol = NULL; |
|
2830 |
|
2831 { |
|
2832 identifier_c param_name("IN"); |
|
2833 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2834 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2835 |
|
2836 /* Get the value from a foo(<param_value>) style call */ |
|
2837 if (IN_param_value == NULL) |
|
2838 IN_param_value = function_call_param_iterator.next(); |
|
2839 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2840 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2841 |
|
2842 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2843 { |
|
2844 |
|
2845 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
2846 return return_type_symbol; |
|
2847 |
|
2848 } |
|
2849 |
|
2850 ERROR; |
|
2851 } |
|
2852 |
|
2853 }/*function_date_to_date*/ |
|
2854 break; |
|
2855 |
|
2856 /**** |
|
2857 *DATE_TO_DWORD |
|
2858 */ |
|
2859 case function_date_to_dword : |
|
2860 { |
|
2861 symbol_c *last_type_symbol = NULL; |
|
2862 |
|
2863 { |
|
2864 identifier_c param_name("IN"); |
|
2865 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2866 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2867 |
|
2868 /* Get the value from a foo(<param_value>) style call */ |
|
2869 if (IN_param_value == NULL) |
|
2870 IN_param_value = function_call_param_iterator.next(); |
|
2871 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2872 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2873 |
|
2874 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2875 { |
|
2876 |
|
2877 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
2878 return return_type_symbol; |
|
2879 |
|
2880 } |
|
2881 |
|
2882 ERROR; |
|
2883 } |
|
2884 |
|
2885 }/*function_date_to_dword*/ |
|
2886 break; |
|
2887 |
|
2888 /**** |
|
2889 *DATE_TO_DT |
|
2890 */ |
|
2891 case function_date_to_dt : |
|
2892 { |
|
2893 symbol_c *last_type_symbol = NULL; |
|
2894 |
|
2895 { |
|
2896 identifier_c param_name("IN"); |
|
2897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2898 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2899 |
|
2900 /* Get the value from a foo(<param_value>) style call */ |
|
2901 if (IN_param_value == NULL) |
|
2902 IN_param_value = function_call_param_iterator.next(); |
|
2903 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2905 |
|
2906 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2907 { |
|
2908 |
|
2909 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
2910 return return_type_symbol; |
|
2911 |
|
2912 } |
|
2913 |
|
2914 ERROR; |
|
2915 } |
|
2916 |
|
2917 }/*function_date_to_dt*/ |
|
2918 break; |
|
2919 |
|
2920 /**** |
|
2921 *DATE_TO_TOD |
|
2922 */ |
|
2923 case function_date_to_tod : |
|
2924 { |
|
2925 symbol_c *last_type_symbol = NULL; |
|
2926 |
|
2927 { |
|
2928 identifier_c param_name("IN"); |
|
2929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2931 |
|
2932 /* Get the value from a foo(<param_value>) style call */ |
|
2933 if (IN_param_value == NULL) |
|
2934 IN_param_value = function_call_param_iterator.next(); |
|
2935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2937 |
|
2938 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2939 { |
|
2940 |
|
2941 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
2942 return return_type_symbol; |
|
2943 |
|
2944 } |
|
2945 |
|
2946 ERROR; |
|
2947 } |
|
2948 |
|
2949 }/*function_date_to_tod*/ |
|
2950 break; |
|
2951 |
|
2952 /**** |
|
2953 *DATE_TO_UDINT |
|
2954 */ |
|
2955 case function_date_to_udint : |
|
2956 { |
|
2957 symbol_c *last_type_symbol = NULL; |
|
2958 |
|
2959 { |
|
2960 identifier_c param_name("IN"); |
|
2961 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2962 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2963 |
|
2964 /* Get the value from a foo(<param_value>) style call */ |
|
2965 if (IN_param_value == NULL) |
|
2966 IN_param_value = function_call_param_iterator.next(); |
|
2967 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
2968 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
2969 |
|
2970 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
2971 { |
|
2972 |
|
2973 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
2974 return return_type_symbol; |
|
2975 |
|
2976 } |
|
2977 |
|
2978 ERROR; |
|
2979 } |
|
2980 |
|
2981 }/*function_date_to_udint*/ |
|
2982 break; |
|
2983 |
|
2984 /**** |
|
2985 *DATE_TO_WORD |
|
2986 */ |
|
2987 case function_date_to_word : |
|
2988 { |
|
2989 symbol_c *last_type_symbol = NULL; |
|
2990 |
|
2991 { |
|
2992 identifier_c param_name("IN"); |
|
2993 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2994 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
2995 |
|
2996 /* Get the value from a foo(<param_value>) style call */ |
|
2997 if (IN_param_value == NULL) |
|
2998 IN_param_value = function_call_param_iterator.next(); |
|
2999 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3000 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3001 |
|
3002 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3003 { |
|
3004 |
|
3005 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
3006 return return_type_symbol; |
|
3007 |
|
3008 } |
|
3009 |
|
3010 ERROR; |
|
3011 } |
|
3012 |
|
3013 }/*function_date_to_word*/ |
|
3014 break; |
|
3015 |
|
3016 /**** |
|
3017 *DATE_TO_WSTRING |
|
3018 */ |
|
3019 case function_date_to_wstring : |
|
3020 { |
|
3021 symbol_c *last_type_symbol = NULL; |
|
3022 |
|
3023 { |
|
3024 identifier_c param_name("IN"); |
|
3025 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3026 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3027 |
|
3028 /* Get the value from a foo(<param_value>) style call */ |
|
3029 if (IN_param_value == NULL) |
|
3030 IN_param_value = function_call_param_iterator.next(); |
|
3031 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3032 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3033 |
|
3034 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3035 { |
|
3036 |
|
3037 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
3038 return return_type_symbol; |
|
3039 |
|
3040 } |
|
3041 |
|
3042 ERROR; |
|
3043 } |
|
3044 |
|
3045 }/*function_date_to_wstring*/ |
|
3046 break; |
|
3047 |
|
3048 /**** |
|
3049 *DATE_TO_STRING |
|
3050 */ |
|
3051 case function_date_to_string : |
|
3052 { |
|
3053 symbol_c *last_type_symbol = NULL; |
|
3054 |
|
3055 { |
|
3056 identifier_c param_name("IN"); |
|
3057 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3058 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3059 |
|
3060 /* Get the value from a foo(<param_value>) style call */ |
|
3061 if (IN_param_value == NULL) |
|
3062 IN_param_value = function_call_param_iterator.next(); |
|
3063 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3064 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3065 |
|
3066 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3067 { |
|
3068 |
|
3069 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
3070 return return_type_symbol; |
|
3071 |
|
3072 } |
|
3073 |
|
3074 ERROR; |
|
3075 } |
|
3076 |
|
3077 }/*function_date_to_string*/ |
|
3078 break; |
|
3079 |
|
3080 /**** |
|
3081 *DATE_TO_LWORD |
|
3082 */ |
|
3083 case function_date_to_lword : |
|
3084 { |
|
3085 symbol_c *last_type_symbol = NULL; |
|
3086 |
|
3087 { |
|
3088 identifier_c param_name("IN"); |
|
3089 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3090 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3091 |
|
3092 /* Get the value from a foo(<param_value>) style call */ |
|
3093 if (IN_param_value == NULL) |
|
3094 IN_param_value = function_call_param_iterator.next(); |
|
3095 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3096 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3097 |
|
3098 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3099 { |
|
3100 |
|
3101 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
3102 return return_type_symbol; |
|
3103 |
|
3104 } |
|
3105 |
|
3106 ERROR; |
|
3107 } |
|
3108 |
|
3109 }/*function_date_to_lword*/ |
|
3110 break; |
|
3111 |
|
3112 /**** |
|
3113 *DATE_TO_UINT |
|
3114 */ |
|
3115 case function_date_to_uint : |
|
3116 { |
|
3117 symbol_c *last_type_symbol = NULL; |
|
3118 |
|
3119 { |
|
3120 identifier_c param_name("IN"); |
|
3121 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3122 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3123 |
|
3124 /* Get the value from a foo(<param_value>) style call */ |
|
3125 if (IN_param_value == NULL) |
|
3126 IN_param_value = function_call_param_iterator.next(); |
|
3127 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3128 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3129 |
|
3130 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3131 { |
|
3132 |
|
3133 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
3134 return return_type_symbol; |
|
3135 |
|
3136 } |
|
3137 |
|
3138 ERROR; |
|
3139 } |
|
3140 |
|
3141 }/*function_date_to_uint*/ |
|
3142 break; |
|
3143 |
|
3144 /**** |
|
3145 *DATE_TO_LREAL |
|
3146 */ |
|
3147 case function_date_to_lreal : |
|
3148 { |
|
3149 symbol_c *last_type_symbol = NULL; |
|
3150 |
|
3151 { |
|
3152 identifier_c param_name("IN"); |
|
3153 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3154 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3155 |
|
3156 /* Get the value from a foo(<param_value>) style call */ |
|
3157 if (IN_param_value == NULL) |
|
3158 IN_param_value = function_call_param_iterator.next(); |
|
3159 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3160 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3161 |
|
3162 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3163 { |
|
3164 |
|
3165 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
3166 return return_type_symbol; |
|
3167 |
|
3168 } |
|
3169 |
|
3170 ERROR; |
|
3171 } |
|
3172 |
|
3173 }/*function_date_to_lreal*/ |
|
3174 break; |
|
3175 |
|
3176 /**** |
|
3177 *DATE_TO_BYTE |
|
3178 */ |
|
3179 case function_date_to_byte : |
|
3180 { |
|
3181 symbol_c *last_type_symbol = NULL; |
|
3182 |
|
3183 { |
|
3184 identifier_c param_name("IN"); |
|
3185 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3186 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3187 |
|
3188 /* Get the value from a foo(<param_value>) style call */ |
|
3189 if (IN_param_value == NULL) |
|
3190 IN_param_value = function_call_param_iterator.next(); |
|
3191 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3192 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3193 |
|
3194 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3195 { |
|
3196 |
|
3197 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
3198 return return_type_symbol; |
|
3199 |
|
3200 } |
|
3201 |
|
3202 ERROR; |
|
3203 } |
|
3204 |
|
3205 }/*function_date_to_byte*/ |
|
3206 break; |
|
3207 |
|
3208 /**** |
|
3209 *DATE_TO_USINT |
|
3210 */ |
|
3211 case function_date_to_usint : |
|
3212 { |
|
3213 symbol_c *last_type_symbol = NULL; |
|
3214 |
|
3215 { |
|
3216 identifier_c param_name("IN"); |
|
3217 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3218 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3219 |
|
3220 /* Get the value from a foo(<param_value>) style call */ |
|
3221 if (IN_param_value == NULL) |
|
3222 IN_param_value = function_call_param_iterator.next(); |
|
3223 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3224 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3225 |
|
3226 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3227 { |
|
3228 |
|
3229 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
3230 return return_type_symbol; |
|
3231 |
|
3232 } |
|
3233 |
|
3234 ERROR; |
|
3235 } |
|
3236 |
|
3237 }/*function_date_to_usint*/ |
|
3238 break; |
|
3239 |
|
3240 /**** |
|
3241 *DATE_TO_ULINT |
|
3242 */ |
|
3243 case function_date_to_ulint : |
|
3244 { |
|
3245 symbol_c *last_type_symbol = NULL; |
|
3246 |
|
3247 { |
|
3248 identifier_c param_name("IN"); |
|
3249 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3250 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3251 |
|
3252 /* Get the value from a foo(<param_value>) style call */ |
|
3253 if (IN_param_value == NULL) |
|
3254 IN_param_value = function_call_param_iterator.next(); |
|
3255 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3256 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3257 |
|
3258 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3259 { |
|
3260 |
|
3261 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
3262 return return_type_symbol; |
|
3263 |
|
3264 } |
|
3265 |
|
3266 ERROR; |
|
3267 } |
|
3268 |
|
3269 }/*function_date_to_ulint*/ |
|
3270 break; |
|
3271 |
|
3272 /**** |
|
3273 *DATE_TO_BOOL |
|
3274 */ |
|
3275 case function_date_to_bool : |
|
3276 { |
|
3277 symbol_c *last_type_symbol = NULL; |
|
3278 |
|
3279 { |
|
3280 identifier_c param_name("IN"); |
|
3281 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3282 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3283 |
|
3284 /* Get the value from a foo(<param_value>) style call */ |
|
3285 if (IN_param_value == NULL) |
|
3286 IN_param_value = function_call_param_iterator.next(); |
|
3287 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3288 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3289 |
|
3290 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3291 { |
|
3292 |
|
3293 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
3294 return return_type_symbol; |
|
3295 |
|
3296 } |
|
3297 |
|
3298 ERROR; |
|
3299 } |
|
3300 |
|
3301 }/*function_date_to_bool*/ |
|
3302 break; |
|
3303 |
|
3304 /**** |
|
3305 *DATE_TO_TIME |
|
3306 */ |
|
3307 case function_date_to_time : |
|
3308 { |
|
3309 symbol_c *last_type_symbol = NULL; |
|
3310 |
|
3311 { |
|
3312 identifier_c param_name("IN"); |
|
3313 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3314 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3315 |
|
3316 /* Get the value from a foo(<param_value>) style call */ |
|
3317 if (IN_param_value == NULL) |
|
3318 IN_param_value = function_call_param_iterator.next(); |
|
3319 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3320 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3321 |
|
3322 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3323 { |
|
3324 |
|
3325 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
3326 return return_type_symbol; |
|
3327 |
|
3328 } |
|
3329 |
|
3330 ERROR; |
|
3331 } |
|
3332 |
|
3333 }/*function_date_to_time*/ |
|
3334 break; |
|
3335 |
|
3336 /**** |
|
3337 *DATE_TO_INT |
|
3338 */ |
|
3339 case function_date_to_int : |
|
3340 { |
|
3341 symbol_c *last_type_symbol = NULL; |
|
3342 |
|
3343 { |
|
3344 identifier_c param_name("IN"); |
|
3345 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3346 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3347 |
|
3348 /* Get the value from a foo(<param_value>) style call */ |
|
3349 if (IN_param_value == NULL) |
|
3350 IN_param_value = function_call_param_iterator.next(); |
|
3351 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3352 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3353 |
|
3354 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
3355 { |
|
3356 |
|
3357 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
3358 return return_type_symbol; |
|
3359 |
|
3360 } |
|
3361 |
|
3362 ERROR; |
|
3363 } |
|
3364 |
|
3365 }/*function_date_to_int*/ |
|
3366 break; |
|
3367 |
|
3368 /**** |
|
3369 *DWORD_TO_REAL |
|
3370 */ |
|
3371 case function_dword_to_real : |
|
3372 { |
|
3373 symbol_c *last_type_symbol = NULL; |
|
3374 |
|
3375 { |
|
3376 identifier_c param_name("IN"); |
|
3377 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3378 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3379 |
|
3380 /* Get the value from a foo(<param_value>) style call */ |
|
3381 if (IN_param_value == NULL) |
|
3382 IN_param_value = function_call_param_iterator.next(); |
|
3383 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3384 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3385 |
|
3386 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3387 { |
|
3388 |
|
3389 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
3390 return return_type_symbol; |
|
3391 |
|
3392 } |
|
3393 |
|
3394 ERROR; |
|
3395 } |
|
3396 |
|
3397 }/*function_dword_to_real*/ |
|
3398 break; |
|
3399 |
|
3400 /**** |
|
3401 *DWORD_TO_SINT |
|
3402 */ |
|
3403 case function_dword_to_sint : |
|
3404 { |
|
3405 symbol_c *last_type_symbol = NULL; |
|
3406 |
|
3407 { |
|
3408 identifier_c param_name("IN"); |
|
3409 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3410 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3411 |
|
3412 /* Get the value from a foo(<param_value>) style call */ |
|
3413 if (IN_param_value == NULL) |
|
3414 IN_param_value = function_call_param_iterator.next(); |
|
3415 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3416 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3417 |
|
3418 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3419 { |
|
3420 |
|
3421 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
3422 return return_type_symbol; |
|
3423 |
|
3424 } |
|
3425 |
|
3426 ERROR; |
|
3427 } |
|
3428 |
|
3429 }/*function_dword_to_sint*/ |
|
3430 break; |
|
3431 |
|
3432 /**** |
|
3433 *DWORD_TO_LINT |
|
3434 */ |
|
3435 case function_dword_to_lint : |
|
3436 { |
|
3437 symbol_c *last_type_symbol = NULL; |
|
3438 |
|
3439 { |
|
3440 identifier_c param_name("IN"); |
|
3441 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3442 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3443 |
|
3444 /* Get the value from a foo(<param_value>) style call */ |
|
3445 if (IN_param_value == NULL) |
|
3446 IN_param_value = function_call_param_iterator.next(); |
|
3447 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3448 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3449 |
|
3450 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3451 { |
|
3452 |
|
3453 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
3454 return return_type_symbol; |
|
3455 |
|
3456 } |
|
3457 |
|
3458 ERROR; |
|
3459 } |
|
3460 |
|
3461 }/*function_dword_to_lint*/ |
|
3462 break; |
|
3463 |
|
3464 /**** |
|
3465 *DWORD_TO_DINT |
|
3466 */ |
|
3467 case function_dword_to_dint : |
|
3468 { |
|
3469 symbol_c *last_type_symbol = NULL; |
|
3470 |
|
3471 { |
|
3472 identifier_c param_name("IN"); |
|
3473 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3474 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3475 |
|
3476 /* Get the value from a foo(<param_value>) style call */ |
|
3477 if (IN_param_value == NULL) |
|
3478 IN_param_value = function_call_param_iterator.next(); |
|
3479 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3480 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3481 |
|
3482 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3483 { |
|
3484 |
|
3485 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
3486 return return_type_symbol; |
|
3487 |
|
3488 } |
|
3489 |
|
3490 ERROR; |
|
3491 } |
|
3492 |
|
3493 }/*function_dword_to_dint*/ |
|
3494 break; |
|
3495 |
|
3496 /**** |
|
3497 *DWORD_TO_DATE |
|
3498 */ |
|
3499 case function_dword_to_date : |
|
3500 { |
|
3501 symbol_c *last_type_symbol = NULL; |
|
3502 |
|
3503 { |
|
3504 identifier_c param_name("IN"); |
|
3505 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3506 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3507 |
|
3508 /* Get the value from a foo(<param_value>) style call */ |
|
3509 if (IN_param_value == NULL) |
|
3510 IN_param_value = function_call_param_iterator.next(); |
|
3511 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3512 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3513 |
|
3514 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3515 { |
|
3516 |
|
3517 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
3518 return return_type_symbol; |
|
3519 |
|
3520 } |
|
3521 |
|
3522 ERROR; |
|
3523 } |
|
3524 |
|
3525 }/*function_dword_to_date*/ |
|
3526 break; |
|
3527 |
|
3528 /**** |
|
3529 *DWORD_TO_DWORD |
|
3530 */ |
|
3531 case function_dword_to_dword : |
|
3532 { |
|
3533 symbol_c *last_type_symbol = NULL; |
|
3534 |
|
3535 { |
|
3536 identifier_c param_name("IN"); |
|
3537 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3538 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3539 |
|
3540 /* Get the value from a foo(<param_value>) style call */ |
|
3541 if (IN_param_value == NULL) |
|
3542 IN_param_value = function_call_param_iterator.next(); |
|
3543 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3544 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3545 |
|
3546 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3547 { |
|
3548 |
|
3549 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
3550 return return_type_symbol; |
|
3551 |
|
3552 } |
|
3553 |
|
3554 ERROR; |
|
3555 } |
|
3556 |
|
3557 }/*function_dword_to_dword*/ |
|
3558 break; |
|
3559 |
|
3560 /**** |
|
3561 *DWORD_TO_DT |
|
3562 */ |
|
3563 case function_dword_to_dt : |
|
3564 { |
|
3565 symbol_c *last_type_symbol = NULL; |
|
3566 |
|
3567 { |
|
3568 identifier_c param_name("IN"); |
|
3569 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3570 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3571 |
|
3572 /* Get the value from a foo(<param_value>) style call */ |
|
3573 if (IN_param_value == NULL) |
|
3574 IN_param_value = function_call_param_iterator.next(); |
|
3575 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3576 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3577 |
|
3578 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3579 { |
|
3580 |
|
3581 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
3582 return return_type_symbol; |
|
3583 |
|
3584 } |
|
3585 |
|
3586 ERROR; |
|
3587 } |
|
3588 |
|
3589 }/*function_dword_to_dt*/ |
|
3590 break; |
|
3591 |
|
3592 /**** |
|
3593 *DWORD_TO_TOD |
|
3594 */ |
|
3595 case function_dword_to_tod : |
|
3596 { |
|
3597 symbol_c *last_type_symbol = NULL; |
|
3598 |
|
3599 { |
|
3600 identifier_c param_name("IN"); |
|
3601 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3602 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3603 |
|
3604 /* Get the value from a foo(<param_value>) style call */ |
|
3605 if (IN_param_value == NULL) |
|
3606 IN_param_value = function_call_param_iterator.next(); |
|
3607 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3608 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3609 |
|
3610 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3611 { |
|
3612 |
|
3613 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
3614 return return_type_symbol; |
|
3615 |
|
3616 } |
|
3617 |
|
3618 ERROR; |
|
3619 } |
|
3620 |
|
3621 }/*function_dword_to_tod*/ |
|
3622 break; |
|
3623 |
|
3624 /**** |
|
3625 *DWORD_TO_UDINT |
|
3626 */ |
|
3627 case function_dword_to_udint : |
|
3628 { |
|
3629 symbol_c *last_type_symbol = NULL; |
|
3630 |
|
3631 { |
|
3632 identifier_c param_name("IN"); |
|
3633 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3634 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3635 |
|
3636 /* Get the value from a foo(<param_value>) style call */ |
|
3637 if (IN_param_value == NULL) |
|
3638 IN_param_value = function_call_param_iterator.next(); |
|
3639 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3640 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3641 |
|
3642 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3643 { |
|
3644 |
|
3645 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
3646 return return_type_symbol; |
|
3647 |
|
3648 } |
|
3649 |
|
3650 ERROR; |
|
3651 } |
|
3652 |
|
3653 }/*function_dword_to_udint*/ |
|
3654 break; |
|
3655 |
|
3656 /**** |
|
3657 *DWORD_TO_WORD |
|
3658 */ |
|
3659 case function_dword_to_word : |
|
3660 { |
|
3661 symbol_c *last_type_symbol = NULL; |
|
3662 |
|
3663 { |
|
3664 identifier_c param_name("IN"); |
|
3665 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3666 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3667 |
|
3668 /* Get the value from a foo(<param_value>) style call */ |
|
3669 if (IN_param_value == NULL) |
|
3670 IN_param_value = function_call_param_iterator.next(); |
|
3671 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3672 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3673 |
|
3674 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3675 { |
|
3676 |
|
3677 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
3678 return return_type_symbol; |
|
3679 |
|
3680 } |
|
3681 |
|
3682 ERROR; |
|
3683 } |
|
3684 |
|
3685 }/*function_dword_to_word*/ |
|
3686 break; |
|
3687 |
|
3688 /**** |
|
3689 *DWORD_TO_WSTRING |
|
3690 */ |
|
3691 case function_dword_to_wstring : |
|
3692 { |
|
3693 symbol_c *last_type_symbol = NULL; |
|
3694 |
|
3695 { |
|
3696 identifier_c param_name("IN"); |
|
3697 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3698 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3699 |
|
3700 /* Get the value from a foo(<param_value>) style call */ |
|
3701 if (IN_param_value == NULL) |
|
3702 IN_param_value = function_call_param_iterator.next(); |
|
3703 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3704 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3705 |
|
3706 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3707 { |
|
3708 |
|
3709 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
3710 return return_type_symbol; |
|
3711 |
|
3712 } |
|
3713 |
|
3714 ERROR; |
|
3715 } |
|
3716 |
|
3717 }/*function_dword_to_wstring*/ |
|
3718 break; |
|
3719 |
|
3720 /**** |
|
3721 *DWORD_TO_STRING |
|
3722 */ |
|
3723 case function_dword_to_string : |
|
3724 { |
|
3725 symbol_c *last_type_symbol = NULL; |
|
3726 |
|
3727 { |
|
3728 identifier_c param_name("IN"); |
|
3729 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3730 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3731 |
|
3732 /* Get the value from a foo(<param_value>) style call */ |
|
3733 if (IN_param_value == NULL) |
|
3734 IN_param_value = function_call_param_iterator.next(); |
|
3735 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3736 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3737 |
|
3738 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3739 { |
|
3740 |
|
3741 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
3742 return return_type_symbol; |
|
3743 |
|
3744 } |
|
3745 |
|
3746 ERROR; |
|
3747 } |
|
3748 |
|
3749 }/*function_dword_to_string*/ |
|
3750 break; |
|
3751 |
|
3752 /**** |
|
3753 *DWORD_TO_LWORD |
|
3754 */ |
|
3755 case function_dword_to_lword : |
|
3756 { |
|
3757 symbol_c *last_type_symbol = NULL; |
|
3758 |
|
3759 { |
|
3760 identifier_c param_name("IN"); |
|
3761 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3762 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3763 |
|
3764 /* Get the value from a foo(<param_value>) style call */ |
|
3765 if (IN_param_value == NULL) |
|
3766 IN_param_value = function_call_param_iterator.next(); |
|
3767 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3768 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3769 |
|
3770 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3771 { |
|
3772 |
|
3773 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
3774 return return_type_symbol; |
|
3775 |
|
3776 } |
|
3777 |
|
3778 ERROR; |
|
3779 } |
|
3780 |
|
3781 }/*function_dword_to_lword*/ |
|
3782 break; |
|
3783 |
|
3784 /**** |
|
3785 *DWORD_TO_UINT |
|
3786 */ |
|
3787 case function_dword_to_uint : |
|
3788 { |
|
3789 symbol_c *last_type_symbol = NULL; |
|
3790 |
|
3791 { |
|
3792 identifier_c param_name("IN"); |
|
3793 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3794 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3795 |
|
3796 /* Get the value from a foo(<param_value>) style call */ |
|
3797 if (IN_param_value == NULL) |
|
3798 IN_param_value = function_call_param_iterator.next(); |
|
3799 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3800 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3801 |
|
3802 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3803 { |
|
3804 |
|
3805 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
3806 return return_type_symbol; |
|
3807 |
|
3808 } |
|
3809 |
|
3810 ERROR; |
|
3811 } |
|
3812 |
|
3813 }/*function_dword_to_uint*/ |
|
3814 break; |
|
3815 |
|
3816 /**** |
|
3817 *DWORD_TO_LREAL |
|
3818 */ |
|
3819 case function_dword_to_lreal : |
|
3820 { |
|
3821 symbol_c *last_type_symbol = NULL; |
|
3822 |
|
3823 { |
|
3824 identifier_c param_name("IN"); |
|
3825 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3826 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3827 |
|
3828 /* Get the value from a foo(<param_value>) style call */ |
|
3829 if (IN_param_value == NULL) |
|
3830 IN_param_value = function_call_param_iterator.next(); |
|
3831 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3832 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3833 |
|
3834 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3835 { |
|
3836 |
|
3837 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
3838 return return_type_symbol; |
|
3839 |
|
3840 } |
|
3841 |
|
3842 ERROR; |
|
3843 } |
|
3844 |
|
3845 }/*function_dword_to_lreal*/ |
|
3846 break; |
|
3847 |
|
3848 /**** |
|
3849 *DWORD_TO_BYTE |
|
3850 */ |
|
3851 case function_dword_to_byte : |
|
3852 { |
|
3853 symbol_c *last_type_symbol = NULL; |
|
3854 |
|
3855 { |
|
3856 identifier_c param_name("IN"); |
|
3857 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3858 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3859 |
|
3860 /* Get the value from a foo(<param_value>) style call */ |
|
3861 if (IN_param_value == NULL) |
|
3862 IN_param_value = function_call_param_iterator.next(); |
|
3863 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3864 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3865 |
|
3866 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3867 { |
|
3868 |
|
3869 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
3870 return return_type_symbol; |
|
3871 |
|
3872 } |
|
3873 |
|
3874 ERROR; |
|
3875 } |
|
3876 |
|
3877 }/*function_dword_to_byte*/ |
|
3878 break; |
|
3879 |
|
3880 /**** |
|
3881 *DWORD_TO_USINT |
|
3882 */ |
|
3883 case function_dword_to_usint : |
|
3884 { |
|
3885 symbol_c *last_type_symbol = NULL; |
|
3886 |
|
3887 { |
|
3888 identifier_c param_name("IN"); |
|
3889 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3890 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3891 |
|
3892 /* Get the value from a foo(<param_value>) style call */ |
|
3893 if (IN_param_value == NULL) |
|
3894 IN_param_value = function_call_param_iterator.next(); |
|
3895 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3896 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3897 |
|
3898 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3899 { |
|
3900 |
|
3901 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
3902 return return_type_symbol; |
|
3903 |
|
3904 } |
|
3905 |
|
3906 ERROR; |
|
3907 } |
|
3908 |
|
3909 }/*function_dword_to_usint*/ |
|
3910 break; |
|
3911 |
|
3912 /**** |
|
3913 *DWORD_TO_ULINT |
|
3914 */ |
|
3915 case function_dword_to_ulint : |
|
3916 { |
|
3917 symbol_c *last_type_symbol = NULL; |
|
3918 |
|
3919 { |
|
3920 identifier_c param_name("IN"); |
|
3921 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3922 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3923 |
|
3924 /* Get the value from a foo(<param_value>) style call */ |
|
3925 if (IN_param_value == NULL) |
|
3926 IN_param_value = function_call_param_iterator.next(); |
|
3927 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3928 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3929 |
|
3930 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3931 { |
|
3932 |
|
3933 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
3934 return return_type_symbol; |
|
3935 |
|
3936 } |
|
3937 |
|
3938 ERROR; |
|
3939 } |
|
3940 |
|
3941 }/*function_dword_to_ulint*/ |
|
3942 break; |
|
3943 |
|
3944 /**** |
|
3945 *DWORD_TO_BOOL |
|
3946 */ |
|
3947 case function_dword_to_bool : |
|
3948 { |
|
3949 symbol_c *last_type_symbol = NULL; |
|
3950 |
|
3951 { |
|
3952 identifier_c param_name("IN"); |
|
3953 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3954 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3955 |
|
3956 /* Get the value from a foo(<param_value>) style call */ |
|
3957 if (IN_param_value == NULL) |
|
3958 IN_param_value = function_call_param_iterator.next(); |
|
3959 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3960 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3961 |
|
3962 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3963 { |
|
3964 |
|
3965 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
3966 return return_type_symbol; |
|
3967 |
|
3968 } |
|
3969 |
|
3970 ERROR; |
|
3971 } |
|
3972 |
|
3973 }/*function_dword_to_bool*/ |
|
3974 break; |
|
3975 |
|
3976 /**** |
|
3977 *DWORD_TO_TIME |
|
3978 */ |
|
3979 case function_dword_to_time : |
|
3980 { |
|
3981 symbol_c *last_type_symbol = NULL; |
|
3982 |
|
3983 { |
|
3984 identifier_c param_name("IN"); |
|
3985 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3986 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
3987 |
|
3988 /* Get the value from a foo(<param_value>) style call */ |
|
3989 if (IN_param_value == NULL) |
|
3990 IN_param_value = function_call_param_iterator.next(); |
|
3991 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
3992 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
3993 |
|
3994 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
3995 { |
|
3996 |
|
3997 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
3998 return return_type_symbol; |
|
3999 |
|
4000 } |
|
4001 |
|
4002 ERROR; |
|
4003 } |
|
4004 |
|
4005 }/*function_dword_to_time*/ |
|
4006 break; |
|
4007 |
|
4008 /**** |
|
4009 *DWORD_TO_INT |
|
4010 */ |
|
4011 case function_dword_to_int : |
|
4012 { |
|
4013 symbol_c *last_type_symbol = NULL; |
|
4014 |
|
4015 { |
|
4016 identifier_c param_name("IN"); |
|
4017 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4018 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4019 |
|
4020 /* Get the value from a foo(<param_value>) style call */ |
|
4021 if (IN_param_value == NULL) |
|
4022 IN_param_value = function_call_param_iterator.next(); |
|
4023 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4024 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4025 |
|
4026 if (typeid(*last_type_symbol) == typeid(dword_type_name_c)) |
|
4027 { |
|
4028 |
|
4029 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
4030 return return_type_symbol; |
|
4031 |
|
4032 } |
|
4033 |
|
4034 ERROR; |
|
4035 } |
|
4036 |
|
4037 }/*function_dword_to_int*/ |
|
4038 break; |
|
4039 |
|
4040 /**** |
|
4041 *DT_TO_REAL |
|
4042 */ |
|
4043 case function_dt_to_real : |
|
4044 { |
|
4045 symbol_c *last_type_symbol = NULL; |
|
4046 |
|
4047 { |
|
4048 identifier_c param_name("IN"); |
|
4049 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4050 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4051 |
|
4052 /* Get the value from a foo(<param_value>) style call */ |
|
4053 if (IN_param_value == NULL) |
|
4054 IN_param_value = function_call_param_iterator.next(); |
|
4055 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4056 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4057 |
|
4058 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4059 { |
|
4060 |
|
4061 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
4062 return return_type_symbol; |
|
4063 |
|
4064 } |
|
4065 |
|
4066 ERROR; |
|
4067 } |
|
4068 |
|
4069 }/*function_dt_to_real*/ |
|
4070 break; |
|
4071 |
|
4072 /**** |
|
4073 *DT_TO_SINT |
|
4074 */ |
|
4075 case function_dt_to_sint : |
|
4076 { |
|
4077 symbol_c *last_type_symbol = NULL; |
|
4078 |
|
4079 { |
|
4080 identifier_c param_name("IN"); |
|
4081 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4082 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4083 |
|
4084 /* Get the value from a foo(<param_value>) style call */ |
|
4085 if (IN_param_value == NULL) |
|
4086 IN_param_value = function_call_param_iterator.next(); |
|
4087 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4088 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4089 |
|
4090 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4091 { |
|
4092 |
|
4093 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
4094 return return_type_symbol; |
|
4095 |
|
4096 } |
|
4097 |
|
4098 ERROR; |
|
4099 } |
|
4100 |
|
4101 }/*function_dt_to_sint*/ |
|
4102 break; |
|
4103 |
|
4104 /**** |
|
4105 *DT_TO_LINT |
|
4106 */ |
|
4107 case function_dt_to_lint : |
|
4108 { |
|
4109 symbol_c *last_type_symbol = NULL; |
|
4110 |
|
4111 { |
|
4112 identifier_c param_name("IN"); |
|
4113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4115 |
|
4116 /* Get the value from a foo(<param_value>) style call */ |
|
4117 if (IN_param_value == NULL) |
|
4118 IN_param_value = function_call_param_iterator.next(); |
|
4119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4121 |
|
4122 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4123 { |
|
4124 |
|
4125 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
4126 return return_type_symbol; |
|
4127 |
|
4128 } |
|
4129 |
|
4130 ERROR; |
|
4131 } |
|
4132 |
|
4133 }/*function_dt_to_lint*/ |
|
4134 break; |
|
4135 |
|
4136 /**** |
|
4137 *DT_TO_DINT |
|
4138 */ |
|
4139 case function_dt_to_dint : |
|
4140 { |
|
4141 symbol_c *last_type_symbol = NULL; |
|
4142 |
|
4143 { |
|
4144 identifier_c param_name("IN"); |
|
4145 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4146 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4147 |
|
4148 /* Get the value from a foo(<param_value>) style call */ |
|
4149 if (IN_param_value == NULL) |
|
4150 IN_param_value = function_call_param_iterator.next(); |
|
4151 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4152 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4153 |
|
4154 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4155 { |
|
4156 |
|
4157 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
4158 return return_type_symbol; |
|
4159 |
|
4160 } |
|
4161 |
|
4162 ERROR; |
|
4163 } |
|
4164 |
|
4165 }/*function_dt_to_dint*/ |
|
4166 break; |
|
4167 |
|
4168 /**** |
|
4169 *DT_TO_DATE |
|
4170 */ |
|
4171 case function_dt_to_date : |
|
4172 { |
|
4173 symbol_c *last_type_symbol = NULL; |
|
4174 |
|
4175 { |
|
4176 identifier_c param_name("IN"); |
|
4177 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4178 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4179 |
|
4180 /* Get the value from a foo(<param_value>) style call */ |
|
4181 if (IN_param_value == NULL) |
|
4182 IN_param_value = function_call_param_iterator.next(); |
|
4183 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4184 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4185 |
|
4186 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4187 { |
|
4188 |
|
4189 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
4190 return return_type_symbol; |
|
4191 |
|
4192 } |
|
4193 |
|
4194 ERROR; |
|
4195 } |
|
4196 |
|
4197 }/*function_dt_to_date*/ |
|
4198 break; |
|
4199 |
|
4200 /**** |
|
4201 *DT_TO_DWORD |
|
4202 */ |
|
4203 case function_dt_to_dword : |
|
4204 { |
|
4205 symbol_c *last_type_symbol = NULL; |
|
4206 |
|
4207 { |
|
4208 identifier_c param_name("IN"); |
|
4209 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4210 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4211 |
|
4212 /* Get the value from a foo(<param_value>) style call */ |
|
4213 if (IN_param_value == NULL) |
|
4214 IN_param_value = function_call_param_iterator.next(); |
|
4215 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4216 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4217 |
|
4218 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4219 { |
|
4220 |
|
4221 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
4222 return return_type_symbol; |
|
4223 |
|
4224 } |
|
4225 |
|
4226 ERROR; |
|
4227 } |
|
4228 |
|
4229 }/*function_dt_to_dword*/ |
|
4230 break; |
|
4231 |
|
4232 /**** |
|
4233 *DT_TO_DT |
|
4234 */ |
|
4235 case function_dt_to_dt : |
|
4236 { |
|
4237 symbol_c *last_type_symbol = NULL; |
|
4238 |
|
4239 { |
|
4240 identifier_c param_name("IN"); |
|
4241 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4242 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4243 |
|
4244 /* Get the value from a foo(<param_value>) style call */ |
|
4245 if (IN_param_value == NULL) |
|
4246 IN_param_value = function_call_param_iterator.next(); |
|
4247 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4248 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4249 |
|
4250 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4251 { |
|
4252 |
|
4253 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
4254 return return_type_symbol; |
|
4255 |
|
4256 } |
|
4257 |
|
4258 ERROR; |
|
4259 } |
|
4260 |
|
4261 }/*function_dt_to_dt*/ |
|
4262 break; |
|
4263 |
|
4264 /**** |
|
4265 *DT_TO_TOD |
|
4266 */ |
|
4267 case function_dt_to_tod : |
|
4268 { |
|
4269 symbol_c *last_type_symbol = NULL; |
|
4270 |
|
4271 { |
|
4272 identifier_c param_name("IN"); |
|
4273 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4274 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4275 |
|
4276 /* Get the value from a foo(<param_value>) style call */ |
|
4277 if (IN_param_value == NULL) |
|
4278 IN_param_value = function_call_param_iterator.next(); |
|
4279 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4280 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4281 |
|
4282 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4283 { |
|
4284 |
|
4285 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
4286 return return_type_symbol; |
|
4287 |
|
4288 } |
|
4289 |
|
4290 ERROR; |
|
4291 } |
|
4292 |
|
4293 }/*function_dt_to_tod*/ |
|
4294 break; |
|
4295 |
|
4296 /**** |
|
4297 *DT_TO_UDINT |
|
4298 */ |
|
4299 case function_dt_to_udint : |
|
4300 { |
|
4301 symbol_c *last_type_symbol = NULL; |
|
4302 |
|
4303 { |
|
4304 identifier_c param_name("IN"); |
|
4305 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4306 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4307 |
|
4308 /* Get the value from a foo(<param_value>) style call */ |
|
4309 if (IN_param_value == NULL) |
|
4310 IN_param_value = function_call_param_iterator.next(); |
|
4311 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4312 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4313 |
|
4314 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4315 { |
|
4316 |
|
4317 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
4318 return return_type_symbol; |
|
4319 |
|
4320 } |
|
4321 |
|
4322 ERROR; |
|
4323 } |
|
4324 |
|
4325 }/*function_dt_to_udint*/ |
|
4326 break; |
|
4327 |
|
4328 /**** |
|
4329 *DT_TO_WORD |
|
4330 */ |
|
4331 case function_dt_to_word : |
|
4332 { |
|
4333 symbol_c *last_type_symbol = NULL; |
|
4334 |
|
4335 { |
|
4336 identifier_c param_name("IN"); |
|
4337 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4338 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4339 |
|
4340 /* Get the value from a foo(<param_value>) style call */ |
|
4341 if (IN_param_value == NULL) |
|
4342 IN_param_value = function_call_param_iterator.next(); |
|
4343 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4344 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4345 |
|
4346 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4347 { |
|
4348 |
|
4349 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
4350 return return_type_symbol; |
|
4351 |
|
4352 } |
|
4353 |
|
4354 ERROR; |
|
4355 } |
|
4356 |
|
4357 }/*function_dt_to_word*/ |
|
4358 break; |
|
4359 |
|
4360 /**** |
|
4361 *DT_TO_WSTRING |
|
4362 */ |
|
4363 case function_dt_to_wstring : |
|
4364 { |
|
4365 symbol_c *last_type_symbol = NULL; |
|
4366 |
|
4367 { |
|
4368 identifier_c param_name("IN"); |
|
4369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4370 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4371 |
|
4372 /* Get the value from a foo(<param_value>) style call */ |
|
4373 if (IN_param_value == NULL) |
|
4374 IN_param_value = function_call_param_iterator.next(); |
|
4375 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4376 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4377 |
|
4378 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4379 { |
|
4380 |
|
4381 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
4382 return return_type_symbol; |
|
4383 |
|
4384 } |
|
4385 |
|
4386 ERROR; |
|
4387 } |
|
4388 |
|
4389 }/*function_dt_to_wstring*/ |
|
4390 break; |
|
4391 |
|
4392 /**** |
|
4393 *DT_TO_STRING |
|
4394 */ |
|
4395 case function_dt_to_string : |
|
4396 { |
|
4397 symbol_c *last_type_symbol = NULL; |
|
4398 |
|
4399 { |
|
4400 identifier_c param_name("IN"); |
|
4401 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4402 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4403 |
|
4404 /* Get the value from a foo(<param_value>) style call */ |
|
4405 if (IN_param_value == NULL) |
|
4406 IN_param_value = function_call_param_iterator.next(); |
|
4407 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4408 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4409 |
|
4410 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4411 { |
|
4412 |
|
4413 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
4414 return return_type_symbol; |
|
4415 |
|
4416 } |
|
4417 |
|
4418 ERROR; |
|
4419 } |
|
4420 |
|
4421 }/*function_dt_to_string*/ |
|
4422 break; |
|
4423 |
|
4424 /**** |
|
4425 *DT_TO_LWORD |
|
4426 */ |
|
4427 case function_dt_to_lword : |
|
4428 { |
|
4429 symbol_c *last_type_symbol = NULL; |
|
4430 |
|
4431 { |
|
4432 identifier_c param_name("IN"); |
|
4433 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4434 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4435 |
|
4436 /* Get the value from a foo(<param_value>) style call */ |
|
4437 if (IN_param_value == NULL) |
|
4438 IN_param_value = function_call_param_iterator.next(); |
|
4439 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4440 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4441 |
|
4442 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4443 { |
|
4444 |
|
4445 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
4446 return return_type_symbol; |
|
4447 |
|
4448 } |
|
4449 |
|
4450 ERROR; |
|
4451 } |
|
4452 |
|
4453 }/*function_dt_to_lword*/ |
|
4454 break; |
|
4455 |
|
4456 /**** |
|
4457 *DT_TO_UINT |
|
4458 */ |
|
4459 case function_dt_to_uint : |
|
4460 { |
|
4461 symbol_c *last_type_symbol = NULL; |
|
4462 |
|
4463 { |
|
4464 identifier_c param_name("IN"); |
|
4465 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4466 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4467 |
|
4468 /* Get the value from a foo(<param_value>) style call */ |
|
4469 if (IN_param_value == NULL) |
|
4470 IN_param_value = function_call_param_iterator.next(); |
|
4471 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4472 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4473 |
|
4474 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4475 { |
|
4476 |
|
4477 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
4478 return return_type_symbol; |
|
4479 |
|
4480 } |
|
4481 |
|
4482 ERROR; |
|
4483 } |
|
4484 |
|
4485 }/*function_dt_to_uint*/ |
|
4486 break; |
|
4487 |
|
4488 /**** |
|
4489 *DT_TO_LREAL |
|
4490 */ |
|
4491 case function_dt_to_lreal : |
|
4492 { |
|
4493 symbol_c *last_type_symbol = NULL; |
|
4494 |
|
4495 { |
|
4496 identifier_c param_name("IN"); |
|
4497 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4498 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4499 |
|
4500 /* Get the value from a foo(<param_value>) style call */ |
|
4501 if (IN_param_value == NULL) |
|
4502 IN_param_value = function_call_param_iterator.next(); |
|
4503 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4504 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4505 |
|
4506 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4507 { |
|
4508 |
|
4509 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
4510 return return_type_symbol; |
|
4511 |
|
4512 } |
|
4513 |
|
4514 ERROR; |
|
4515 } |
|
4516 |
|
4517 }/*function_dt_to_lreal*/ |
|
4518 break; |
|
4519 |
|
4520 /**** |
|
4521 *DT_TO_BYTE |
|
4522 */ |
|
4523 case function_dt_to_byte : |
|
4524 { |
|
4525 symbol_c *last_type_symbol = NULL; |
|
4526 |
|
4527 { |
|
4528 identifier_c param_name("IN"); |
|
4529 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4530 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4531 |
|
4532 /* Get the value from a foo(<param_value>) style call */ |
|
4533 if (IN_param_value == NULL) |
|
4534 IN_param_value = function_call_param_iterator.next(); |
|
4535 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4536 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4537 |
|
4538 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4539 { |
|
4540 |
|
4541 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
4542 return return_type_symbol; |
|
4543 |
|
4544 } |
|
4545 |
|
4546 ERROR; |
|
4547 } |
|
4548 |
|
4549 }/*function_dt_to_byte*/ |
|
4550 break; |
|
4551 |
|
4552 /**** |
|
4553 *DT_TO_USINT |
|
4554 */ |
|
4555 case function_dt_to_usint : |
|
4556 { |
|
4557 symbol_c *last_type_symbol = NULL; |
|
4558 |
|
4559 { |
|
4560 identifier_c param_name("IN"); |
|
4561 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4562 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4563 |
|
4564 /* Get the value from a foo(<param_value>) style call */ |
|
4565 if (IN_param_value == NULL) |
|
4566 IN_param_value = function_call_param_iterator.next(); |
|
4567 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4568 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4569 |
|
4570 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4571 { |
|
4572 |
|
4573 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
4574 return return_type_symbol; |
|
4575 |
|
4576 } |
|
4577 |
|
4578 ERROR; |
|
4579 } |
|
4580 |
|
4581 }/*function_dt_to_usint*/ |
|
4582 break; |
|
4583 |
|
4584 /**** |
|
4585 *DT_TO_ULINT |
|
4586 */ |
|
4587 case function_dt_to_ulint : |
|
4588 { |
|
4589 symbol_c *last_type_symbol = NULL; |
|
4590 |
|
4591 { |
|
4592 identifier_c param_name("IN"); |
|
4593 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4594 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4595 |
|
4596 /* Get the value from a foo(<param_value>) style call */ |
|
4597 if (IN_param_value == NULL) |
|
4598 IN_param_value = function_call_param_iterator.next(); |
|
4599 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4601 |
|
4602 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4603 { |
|
4604 |
|
4605 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
4606 return return_type_symbol; |
|
4607 |
|
4608 } |
|
4609 |
|
4610 ERROR; |
|
4611 } |
|
4612 |
|
4613 }/*function_dt_to_ulint*/ |
|
4614 break; |
|
4615 |
|
4616 /**** |
|
4617 *DT_TO_BOOL |
|
4618 */ |
|
4619 case function_dt_to_bool : |
|
4620 { |
|
4621 symbol_c *last_type_symbol = NULL; |
|
4622 |
|
4623 { |
|
4624 identifier_c param_name("IN"); |
|
4625 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4626 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4627 |
|
4628 /* Get the value from a foo(<param_value>) style call */ |
|
4629 if (IN_param_value == NULL) |
|
4630 IN_param_value = function_call_param_iterator.next(); |
|
4631 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4632 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4633 |
|
4634 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4635 { |
|
4636 |
|
4637 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
4638 return return_type_symbol; |
|
4639 |
|
4640 } |
|
4641 |
|
4642 ERROR; |
|
4643 } |
|
4644 |
|
4645 }/*function_dt_to_bool*/ |
|
4646 break; |
|
4647 |
|
4648 /**** |
|
4649 *DT_TO_TIME |
|
4650 */ |
|
4651 case function_dt_to_time : |
|
4652 { |
|
4653 symbol_c *last_type_symbol = NULL; |
|
4654 |
|
4655 { |
|
4656 identifier_c param_name("IN"); |
|
4657 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4658 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4659 |
|
4660 /* Get the value from a foo(<param_value>) style call */ |
|
4661 if (IN_param_value == NULL) |
|
4662 IN_param_value = function_call_param_iterator.next(); |
|
4663 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4664 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4665 |
|
4666 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4667 { |
|
4668 |
|
4669 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
4670 return return_type_symbol; |
|
4671 |
|
4672 } |
|
4673 |
|
4674 ERROR; |
|
4675 } |
|
4676 |
|
4677 }/*function_dt_to_time*/ |
|
4678 break; |
|
4679 |
|
4680 /**** |
|
4681 *DT_TO_INT |
|
4682 */ |
|
4683 case function_dt_to_int : |
|
4684 { |
|
4685 symbol_c *last_type_symbol = NULL; |
|
4686 |
|
4687 { |
|
4688 identifier_c param_name("IN"); |
|
4689 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4690 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4691 |
|
4692 /* Get the value from a foo(<param_value>) style call */ |
|
4693 if (IN_param_value == NULL) |
|
4694 IN_param_value = function_call_param_iterator.next(); |
|
4695 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4696 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4697 |
|
4698 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
4699 { |
|
4700 |
|
4701 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
4702 return return_type_symbol; |
|
4703 |
|
4704 } |
|
4705 |
|
4706 ERROR; |
|
4707 } |
|
4708 |
|
4709 }/*function_dt_to_int*/ |
|
4710 break; |
|
4711 |
|
4712 /**** |
|
4713 *TOD_TO_REAL |
|
4714 */ |
|
4715 case function_tod_to_real : |
|
4716 { |
|
4717 symbol_c *last_type_symbol = NULL; |
|
4718 |
|
4719 { |
|
4720 identifier_c param_name("IN"); |
|
4721 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4722 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4723 |
|
4724 /* Get the value from a foo(<param_value>) style call */ |
|
4725 if (IN_param_value == NULL) |
|
4726 IN_param_value = function_call_param_iterator.next(); |
|
4727 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4728 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4729 |
|
4730 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4731 { |
|
4732 |
|
4733 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
4734 return return_type_symbol; |
|
4735 |
|
4736 } |
|
4737 |
|
4738 ERROR; |
|
4739 } |
|
4740 |
|
4741 }/*function_tod_to_real*/ |
|
4742 break; |
|
4743 |
|
4744 /**** |
|
4745 *TOD_TO_SINT |
|
4746 */ |
|
4747 case function_tod_to_sint : |
|
4748 { |
|
4749 symbol_c *last_type_symbol = NULL; |
|
4750 |
|
4751 { |
|
4752 identifier_c param_name("IN"); |
|
4753 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4754 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4755 |
|
4756 /* Get the value from a foo(<param_value>) style call */ |
|
4757 if (IN_param_value == NULL) |
|
4758 IN_param_value = function_call_param_iterator.next(); |
|
4759 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4760 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4761 |
|
4762 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4763 { |
|
4764 |
|
4765 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
4766 return return_type_symbol; |
|
4767 |
|
4768 } |
|
4769 |
|
4770 ERROR; |
|
4771 } |
|
4772 |
|
4773 }/*function_tod_to_sint*/ |
|
4774 break; |
|
4775 |
|
4776 /**** |
|
4777 *TOD_TO_LINT |
|
4778 */ |
|
4779 case function_tod_to_lint : |
|
4780 { |
|
4781 symbol_c *last_type_symbol = NULL; |
|
4782 |
|
4783 { |
|
4784 identifier_c param_name("IN"); |
|
4785 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4786 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4787 |
|
4788 /* Get the value from a foo(<param_value>) style call */ |
|
4789 if (IN_param_value == NULL) |
|
4790 IN_param_value = function_call_param_iterator.next(); |
|
4791 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4792 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4793 |
|
4794 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4795 { |
|
4796 |
|
4797 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
4798 return return_type_symbol; |
|
4799 |
|
4800 } |
|
4801 |
|
4802 ERROR; |
|
4803 } |
|
4804 |
|
4805 }/*function_tod_to_lint*/ |
|
4806 break; |
|
4807 |
|
4808 /**** |
|
4809 *TOD_TO_DINT |
|
4810 */ |
|
4811 case function_tod_to_dint : |
|
4812 { |
|
4813 symbol_c *last_type_symbol = NULL; |
|
4814 |
|
4815 { |
|
4816 identifier_c param_name("IN"); |
|
4817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4819 |
|
4820 /* Get the value from a foo(<param_value>) style call */ |
|
4821 if (IN_param_value == NULL) |
|
4822 IN_param_value = function_call_param_iterator.next(); |
|
4823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4825 |
|
4826 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4827 { |
|
4828 |
|
4829 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
4830 return return_type_symbol; |
|
4831 |
|
4832 } |
|
4833 |
|
4834 ERROR; |
|
4835 } |
|
4836 |
|
4837 }/*function_tod_to_dint*/ |
|
4838 break; |
|
4839 |
|
4840 /**** |
|
4841 *TOD_TO_DATE |
|
4842 */ |
|
4843 case function_tod_to_date : |
|
4844 { |
|
4845 symbol_c *last_type_symbol = NULL; |
|
4846 |
|
4847 { |
|
4848 identifier_c param_name("IN"); |
|
4849 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4850 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4851 |
|
4852 /* Get the value from a foo(<param_value>) style call */ |
|
4853 if (IN_param_value == NULL) |
|
4854 IN_param_value = function_call_param_iterator.next(); |
|
4855 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4856 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4857 |
|
4858 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4859 { |
|
4860 |
|
4861 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
4862 return return_type_symbol; |
|
4863 |
|
4864 } |
|
4865 |
|
4866 ERROR; |
|
4867 } |
|
4868 |
|
4869 }/*function_tod_to_date*/ |
|
4870 break; |
|
4871 |
|
4872 /**** |
|
4873 *TOD_TO_DWORD |
|
4874 */ |
|
4875 case function_tod_to_dword : |
|
4876 { |
|
4877 symbol_c *last_type_symbol = NULL; |
|
4878 |
|
4879 { |
|
4880 identifier_c param_name("IN"); |
|
4881 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4882 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4883 |
|
4884 /* Get the value from a foo(<param_value>) style call */ |
|
4885 if (IN_param_value == NULL) |
|
4886 IN_param_value = function_call_param_iterator.next(); |
|
4887 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4888 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4889 |
|
4890 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4891 { |
|
4892 |
|
4893 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
4894 return return_type_symbol; |
|
4895 |
|
4896 } |
|
4897 |
|
4898 ERROR; |
|
4899 } |
|
4900 |
|
4901 }/*function_tod_to_dword*/ |
|
4902 break; |
|
4903 |
|
4904 /**** |
|
4905 *TOD_TO_DT |
|
4906 */ |
|
4907 case function_tod_to_dt : |
|
4908 { |
|
4909 symbol_c *last_type_symbol = NULL; |
|
4910 |
|
4911 { |
|
4912 identifier_c param_name("IN"); |
|
4913 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4914 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4915 |
|
4916 /* Get the value from a foo(<param_value>) style call */ |
|
4917 if (IN_param_value == NULL) |
|
4918 IN_param_value = function_call_param_iterator.next(); |
|
4919 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4920 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4921 |
|
4922 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4923 { |
|
4924 |
|
4925 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
4926 return return_type_symbol; |
|
4927 |
|
4928 } |
|
4929 |
|
4930 ERROR; |
|
4931 } |
|
4932 |
|
4933 }/*function_tod_to_dt*/ |
|
4934 break; |
|
4935 |
|
4936 /**** |
|
4937 *TOD_TO_TOD |
|
4938 */ |
|
4939 case function_tod_to_tod : |
|
4940 { |
|
4941 symbol_c *last_type_symbol = NULL; |
|
4942 |
|
4943 { |
|
4944 identifier_c param_name("IN"); |
|
4945 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4946 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4947 |
|
4948 /* Get the value from a foo(<param_value>) style call */ |
|
4949 if (IN_param_value == NULL) |
|
4950 IN_param_value = function_call_param_iterator.next(); |
|
4951 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4952 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4953 |
|
4954 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4955 { |
|
4956 |
|
4957 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
4958 return return_type_symbol; |
|
4959 |
|
4960 } |
|
4961 |
|
4962 ERROR; |
|
4963 } |
|
4964 |
|
4965 }/*function_tod_to_tod*/ |
|
4966 break; |
|
4967 |
|
4968 /**** |
|
4969 *TOD_TO_UDINT |
|
4970 */ |
|
4971 case function_tod_to_udint : |
|
4972 { |
|
4973 symbol_c *last_type_symbol = NULL; |
|
4974 |
|
4975 { |
|
4976 identifier_c param_name("IN"); |
|
4977 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4978 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
4979 |
|
4980 /* Get the value from a foo(<param_value>) style call */ |
|
4981 if (IN_param_value == NULL) |
|
4982 IN_param_value = function_call_param_iterator.next(); |
|
4983 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
4984 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
4985 |
|
4986 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
4987 { |
|
4988 |
|
4989 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
4990 return return_type_symbol; |
|
4991 |
|
4992 } |
|
4993 |
|
4994 ERROR; |
|
4995 } |
|
4996 |
|
4997 }/*function_tod_to_udint*/ |
|
4998 break; |
|
4999 |
|
5000 /**** |
|
5001 *TOD_TO_WORD |
|
5002 */ |
|
5003 case function_tod_to_word : |
|
5004 { |
|
5005 symbol_c *last_type_symbol = NULL; |
|
5006 |
|
5007 { |
|
5008 identifier_c param_name("IN"); |
|
5009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5010 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5011 |
|
5012 /* Get the value from a foo(<param_value>) style call */ |
|
5013 if (IN_param_value == NULL) |
|
5014 IN_param_value = function_call_param_iterator.next(); |
|
5015 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5016 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5017 |
|
5018 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5019 { |
|
5020 |
|
5021 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
5022 return return_type_symbol; |
|
5023 |
|
5024 } |
|
5025 |
|
5026 ERROR; |
|
5027 } |
|
5028 |
|
5029 }/*function_tod_to_word*/ |
|
5030 break; |
|
5031 |
|
5032 /**** |
|
5033 *TOD_TO_WSTRING |
|
5034 */ |
|
5035 case function_tod_to_wstring : |
|
5036 { |
|
5037 symbol_c *last_type_symbol = NULL; |
|
5038 |
|
5039 { |
|
5040 identifier_c param_name("IN"); |
|
5041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5042 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5043 |
|
5044 /* Get the value from a foo(<param_value>) style call */ |
|
5045 if (IN_param_value == NULL) |
|
5046 IN_param_value = function_call_param_iterator.next(); |
|
5047 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5048 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5049 |
|
5050 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5051 { |
|
5052 |
|
5053 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
5054 return return_type_symbol; |
|
5055 |
|
5056 } |
|
5057 |
|
5058 ERROR; |
|
5059 } |
|
5060 |
|
5061 }/*function_tod_to_wstring*/ |
|
5062 break; |
|
5063 |
|
5064 /**** |
|
5065 *TOD_TO_STRING |
|
5066 */ |
|
5067 case function_tod_to_string : |
|
5068 { |
|
5069 symbol_c *last_type_symbol = NULL; |
|
5070 |
|
5071 { |
|
5072 identifier_c param_name("IN"); |
|
5073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5074 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5075 |
|
5076 /* Get the value from a foo(<param_value>) style call */ |
|
5077 if (IN_param_value == NULL) |
|
5078 IN_param_value = function_call_param_iterator.next(); |
|
5079 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5080 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5081 |
|
5082 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5083 { |
|
5084 |
|
5085 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
5086 return return_type_symbol; |
|
5087 |
|
5088 } |
|
5089 |
|
5090 ERROR; |
|
5091 } |
|
5092 |
|
5093 }/*function_tod_to_string*/ |
|
5094 break; |
|
5095 |
|
5096 /**** |
|
5097 *TOD_TO_LWORD |
|
5098 */ |
|
5099 case function_tod_to_lword : |
|
5100 { |
|
5101 symbol_c *last_type_symbol = NULL; |
|
5102 |
|
5103 { |
|
5104 identifier_c param_name("IN"); |
|
5105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5106 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5107 |
|
5108 /* Get the value from a foo(<param_value>) style call */ |
|
5109 if (IN_param_value == NULL) |
|
5110 IN_param_value = function_call_param_iterator.next(); |
|
5111 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5112 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5113 |
|
5114 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5115 { |
|
5116 |
|
5117 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
5118 return return_type_symbol; |
|
5119 |
|
5120 } |
|
5121 |
|
5122 ERROR; |
|
5123 } |
|
5124 |
|
5125 }/*function_tod_to_lword*/ |
|
5126 break; |
|
5127 |
|
5128 /**** |
|
5129 *TOD_TO_UINT |
|
5130 */ |
|
5131 case function_tod_to_uint : |
|
5132 { |
|
5133 symbol_c *last_type_symbol = NULL; |
|
5134 |
|
5135 { |
|
5136 identifier_c param_name("IN"); |
|
5137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5138 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5139 |
|
5140 /* Get the value from a foo(<param_value>) style call */ |
|
5141 if (IN_param_value == NULL) |
|
5142 IN_param_value = function_call_param_iterator.next(); |
|
5143 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5144 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5145 |
|
5146 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5147 { |
|
5148 |
|
5149 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
5150 return return_type_symbol; |
|
5151 |
|
5152 } |
|
5153 |
|
5154 ERROR; |
|
5155 } |
|
5156 |
|
5157 }/*function_tod_to_uint*/ |
|
5158 break; |
|
5159 |
|
5160 /**** |
|
5161 *TOD_TO_LREAL |
|
5162 */ |
|
5163 case function_tod_to_lreal : |
|
5164 { |
|
5165 symbol_c *last_type_symbol = NULL; |
|
5166 |
|
5167 { |
|
5168 identifier_c param_name("IN"); |
|
5169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5170 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5171 |
|
5172 /* Get the value from a foo(<param_value>) style call */ |
|
5173 if (IN_param_value == NULL) |
|
5174 IN_param_value = function_call_param_iterator.next(); |
|
5175 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5176 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5177 |
|
5178 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5179 { |
|
5180 |
|
5181 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
5182 return return_type_symbol; |
|
5183 |
|
5184 } |
|
5185 |
|
5186 ERROR; |
|
5187 } |
|
5188 |
|
5189 }/*function_tod_to_lreal*/ |
|
5190 break; |
|
5191 |
|
5192 /**** |
|
5193 *TOD_TO_BYTE |
|
5194 */ |
|
5195 case function_tod_to_byte : |
|
5196 { |
|
5197 symbol_c *last_type_symbol = NULL; |
|
5198 |
|
5199 { |
|
5200 identifier_c param_name("IN"); |
|
5201 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5202 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5203 |
|
5204 /* Get the value from a foo(<param_value>) style call */ |
|
5205 if (IN_param_value == NULL) |
|
5206 IN_param_value = function_call_param_iterator.next(); |
|
5207 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5208 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5209 |
|
5210 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5211 { |
|
5212 |
|
5213 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
5214 return return_type_symbol; |
|
5215 |
|
5216 } |
|
5217 |
|
5218 ERROR; |
|
5219 } |
|
5220 |
|
5221 }/*function_tod_to_byte*/ |
|
5222 break; |
|
5223 |
|
5224 /**** |
|
5225 *TOD_TO_USINT |
|
5226 */ |
|
5227 case function_tod_to_usint : |
|
5228 { |
|
5229 symbol_c *last_type_symbol = NULL; |
|
5230 |
|
5231 { |
|
5232 identifier_c param_name("IN"); |
|
5233 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5234 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5235 |
|
5236 /* Get the value from a foo(<param_value>) style call */ |
|
5237 if (IN_param_value == NULL) |
|
5238 IN_param_value = function_call_param_iterator.next(); |
|
5239 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5240 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5241 |
|
5242 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5243 { |
|
5244 |
|
5245 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
5246 return return_type_symbol; |
|
5247 |
|
5248 } |
|
5249 |
|
5250 ERROR; |
|
5251 } |
|
5252 |
|
5253 }/*function_tod_to_usint*/ |
|
5254 break; |
|
5255 |
|
5256 /**** |
|
5257 *TOD_TO_ULINT |
|
5258 */ |
|
5259 case function_tod_to_ulint : |
|
5260 { |
|
5261 symbol_c *last_type_symbol = NULL; |
|
5262 |
|
5263 { |
|
5264 identifier_c param_name("IN"); |
|
5265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5266 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5267 |
|
5268 /* Get the value from a foo(<param_value>) style call */ |
|
5269 if (IN_param_value == NULL) |
|
5270 IN_param_value = function_call_param_iterator.next(); |
|
5271 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5272 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5273 |
|
5274 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5275 { |
|
5276 |
|
5277 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
5278 return return_type_symbol; |
|
5279 |
|
5280 } |
|
5281 |
|
5282 ERROR; |
|
5283 } |
|
5284 |
|
5285 }/*function_tod_to_ulint*/ |
|
5286 break; |
|
5287 |
|
5288 /**** |
|
5289 *TOD_TO_BOOL |
|
5290 */ |
|
5291 case function_tod_to_bool : |
|
5292 { |
|
5293 symbol_c *last_type_symbol = NULL; |
|
5294 |
|
5295 { |
|
5296 identifier_c param_name("IN"); |
|
5297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5299 |
|
5300 /* Get the value from a foo(<param_value>) style call */ |
|
5301 if (IN_param_value == NULL) |
|
5302 IN_param_value = function_call_param_iterator.next(); |
|
5303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5305 |
|
5306 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5307 { |
|
5308 |
|
5309 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
5310 return return_type_symbol; |
|
5311 |
|
5312 } |
|
5313 |
|
5314 ERROR; |
|
5315 } |
|
5316 |
|
5317 }/*function_tod_to_bool*/ |
|
5318 break; |
|
5319 |
|
5320 /**** |
|
5321 *TOD_TO_TIME |
|
5322 */ |
|
5323 case function_tod_to_time : |
|
5324 { |
|
5325 symbol_c *last_type_symbol = NULL; |
|
5326 |
|
5327 { |
|
5328 identifier_c param_name("IN"); |
|
5329 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5330 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5331 |
|
5332 /* Get the value from a foo(<param_value>) style call */ |
|
5333 if (IN_param_value == NULL) |
|
5334 IN_param_value = function_call_param_iterator.next(); |
|
5335 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5336 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5337 |
|
5338 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5339 { |
|
5340 |
|
5341 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
5342 return return_type_symbol; |
|
5343 |
|
5344 } |
|
5345 |
|
5346 ERROR; |
|
5347 } |
|
5348 |
|
5349 }/*function_tod_to_time*/ |
|
5350 break; |
|
5351 |
|
5352 /**** |
|
5353 *TOD_TO_INT |
|
5354 */ |
|
5355 case function_tod_to_int : |
|
5356 { |
|
5357 symbol_c *last_type_symbol = NULL; |
|
5358 |
|
5359 { |
|
5360 identifier_c param_name("IN"); |
|
5361 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5362 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5363 |
|
5364 /* Get the value from a foo(<param_value>) style call */ |
|
5365 if (IN_param_value == NULL) |
|
5366 IN_param_value = function_call_param_iterator.next(); |
|
5367 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5368 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5369 |
|
5370 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
5371 { |
|
5372 |
|
5373 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
5374 return return_type_symbol; |
|
5375 |
|
5376 } |
|
5377 |
|
5378 ERROR; |
|
5379 } |
|
5380 |
|
5381 }/*function_tod_to_int*/ |
|
5382 break; |
|
5383 |
|
5384 /**** |
|
5385 *UDINT_TO_REAL |
|
5386 */ |
|
5387 case function_udint_to_real : |
|
5388 { |
|
5389 symbol_c *last_type_symbol = NULL; |
|
5390 |
|
5391 { |
|
5392 identifier_c param_name("IN"); |
|
5393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5394 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5395 |
|
5396 /* Get the value from a foo(<param_value>) style call */ |
|
5397 if (IN_param_value == NULL) |
|
5398 IN_param_value = function_call_param_iterator.next(); |
|
5399 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5400 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5401 |
|
5402 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5403 { |
|
5404 |
|
5405 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
5406 return return_type_symbol; |
|
5407 |
|
5408 } |
|
5409 |
|
5410 ERROR; |
|
5411 } |
|
5412 |
|
5413 }/*function_udint_to_real*/ |
|
5414 break; |
|
5415 |
|
5416 /**** |
|
5417 *UDINT_TO_SINT |
|
5418 */ |
|
5419 case function_udint_to_sint : |
|
5420 { |
|
5421 symbol_c *last_type_symbol = NULL; |
|
5422 |
|
5423 { |
|
5424 identifier_c param_name("IN"); |
|
5425 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5426 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5427 |
|
5428 /* Get the value from a foo(<param_value>) style call */ |
|
5429 if (IN_param_value == NULL) |
|
5430 IN_param_value = function_call_param_iterator.next(); |
|
5431 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5432 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5433 |
|
5434 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5435 { |
|
5436 |
|
5437 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
5438 return return_type_symbol; |
|
5439 |
|
5440 } |
|
5441 |
|
5442 ERROR; |
|
5443 } |
|
5444 |
|
5445 }/*function_udint_to_sint*/ |
|
5446 break; |
|
5447 |
|
5448 /**** |
|
5449 *UDINT_TO_LINT |
|
5450 */ |
|
5451 case function_udint_to_lint : |
|
5452 { |
|
5453 symbol_c *last_type_symbol = NULL; |
|
5454 |
|
5455 { |
|
5456 identifier_c param_name("IN"); |
|
5457 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5458 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5459 |
|
5460 /* Get the value from a foo(<param_value>) style call */ |
|
5461 if (IN_param_value == NULL) |
|
5462 IN_param_value = function_call_param_iterator.next(); |
|
5463 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5464 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5465 |
|
5466 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5467 { |
|
5468 |
|
5469 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
5470 return return_type_symbol; |
|
5471 |
|
5472 } |
|
5473 |
|
5474 ERROR; |
|
5475 } |
|
5476 |
|
5477 }/*function_udint_to_lint*/ |
|
5478 break; |
|
5479 |
|
5480 /**** |
|
5481 *UDINT_TO_DINT |
|
5482 */ |
|
5483 case function_udint_to_dint : |
|
5484 { |
|
5485 symbol_c *last_type_symbol = NULL; |
|
5486 |
|
5487 { |
|
5488 identifier_c param_name("IN"); |
|
5489 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5490 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5491 |
|
5492 /* Get the value from a foo(<param_value>) style call */ |
|
5493 if (IN_param_value == NULL) |
|
5494 IN_param_value = function_call_param_iterator.next(); |
|
5495 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5496 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5497 |
|
5498 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5499 { |
|
5500 |
|
5501 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
5502 return return_type_symbol; |
|
5503 |
|
5504 } |
|
5505 |
|
5506 ERROR; |
|
5507 } |
|
5508 |
|
5509 }/*function_udint_to_dint*/ |
|
5510 break; |
|
5511 |
|
5512 /**** |
|
5513 *UDINT_TO_DATE |
|
5514 */ |
|
5515 case function_udint_to_date : |
|
5516 { |
|
5517 symbol_c *last_type_symbol = NULL; |
|
5518 |
|
5519 { |
|
5520 identifier_c param_name("IN"); |
|
5521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5523 |
|
5524 /* Get the value from a foo(<param_value>) style call */ |
|
5525 if (IN_param_value == NULL) |
|
5526 IN_param_value = function_call_param_iterator.next(); |
|
5527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5529 |
|
5530 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5531 { |
|
5532 |
|
5533 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
5534 return return_type_symbol; |
|
5535 |
|
5536 } |
|
5537 |
|
5538 ERROR; |
|
5539 } |
|
5540 |
|
5541 }/*function_udint_to_date*/ |
|
5542 break; |
|
5543 |
|
5544 /**** |
|
5545 *UDINT_TO_DWORD |
|
5546 */ |
|
5547 case function_udint_to_dword : |
|
5548 { |
|
5549 symbol_c *last_type_symbol = NULL; |
|
5550 |
|
5551 { |
|
5552 identifier_c param_name("IN"); |
|
5553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5554 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5555 |
|
5556 /* Get the value from a foo(<param_value>) style call */ |
|
5557 if (IN_param_value == NULL) |
|
5558 IN_param_value = function_call_param_iterator.next(); |
|
5559 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5560 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5561 |
|
5562 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5563 { |
|
5564 |
|
5565 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
5566 return return_type_symbol; |
|
5567 |
|
5568 } |
|
5569 |
|
5570 ERROR; |
|
5571 } |
|
5572 |
|
5573 }/*function_udint_to_dword*/ |
|
5574 break; |
|
5575 |
|
5576 /**** |
|
5577 *UDINT_TO_DT |
|
5578 */ |
|
5579 case function_udint_to_dt : |
|
5580 { |
|
5581 symbol_c *last_type_symbol = NULL; |
|
5582 |
|
5583 { |
|
5584 identifier_c param_name("IN"); |
|
5585 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5586 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5587 |
|
5588 /* Get the value from a foo(<param_value>) style call */ |
|
5589 if (IN_param_value == NULL) |
|
5590 IN_param_value = function_call_param_iterator.next(); |
|
5591 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5592 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5593 |
|
5594 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5595 { |
|
5596 |
|
5597 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
5598 return return_type_symbol; |
|
5599 |
|
5600 } |
|
5601 |
|
5602 ERROR; |
|
5603 } |
|
5604 |
|
5605 }/*function_udint_to_dt*/ |
|
5606 break; |
|
5607 |
|
5608 /**** |
|
5609 *UDINT_TO_TOD |
|
5610 */ |
|
5611 case function_udint_to_tod : |
|
5612 { |
|
5613 symbol_c *last_type_symbol = NULL; |
|
5614 |
|
5615 { |
|
5616 identifier_c param_name("IN"); |
|
5617 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5618 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5619 |
|
5620 /* Get the value from a foo(<param_value>) style call */ |
|
5621 if (IN_param_value == NULL) |
|
5622 IN_param_value = function_call_param_iterator.next(); |
|
5623 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5624 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5625 |
|
5626 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5627 { |
|
5628 |
|
5629 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
5630 return return_type_symbol; |
|
5631 |
|
5632 } |
|
5633 |
|
5634 ERROR; |
|
5635 } |
|
5636 |
|
5637 }/*function_udint_to_tod*/ |
|
5638 break; |
|
5639 |
|
5640 /**** |
|
5641 *UDINT_TO_UDINT |
|
5642 */ |
|
5643 case function_udint_to_udint : |
|
5644 { |
|
5645 symbol_c *last_type_symbol = NULL; |
|
5646 |
|
5647 { |
|
5648 identifier_c param_name("IN"); |
|
5649 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5650 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5651 |
|
5652 /* Get the value from a foo(<param_value>) style call */ |
|
5653 if (IN_param_value == NULL) |
|
5654 IN_param_value = function_call_param_iterator.next(); |
|
5655 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5656 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5657 |
|
5658 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5659 { |
|
5660 |
|
5661 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
5662 return return_type_symbol; |
|
5663 |
|
5664 } |
|
5665 |
|
5666 ERROR; |
|
5667 } |
|
5668 |
|
5669 }/*function_udint_to_udint*/ |
|
5670 break; |
|
5671 |
|
5672 /**** |
|
5673 *UDINT_TO_WORD |
|
5674 */ |
|
5675 case function_udint_to_word : |
|
5676 { |
|
5677 symbol_c *last_type_symbol = NULL; |
|
5678 |
|
5679 { |
|
5680 identifier_c param_name("IN"); |
|
5681 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5682 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5683 |
|
5684 /* Get the value from a foo(<param_value>) style call */ |
|
5685 if (IN_param_value == NULL) |
|
5686 IN_param_value = function_call_param_iterator.next(); |
|
5687 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5688 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5689 |
|
5690 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5691 { |
|
5692 |
|
5693 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
5694 return return_type_symbol; |
|
5695 |
|
5696 } |
|
5697 |
|
5698 ERROR; |
|
5699 } |
|
5700 |
|
5701 }/*function_udint_to_word*/ |
|
5702 break; |
|
5703 |
|
5704 /**** |
|
5705 *UDINT_TO_WSTRING |
|
5706 */ |
|
5707 case function_udint_to_wstring : |
|
5708 { |
|
5709 symbol_c *last_type_symbol = NULL; |
|
5710 |
|
5711 { |
|
5712 identifier_c param_name("IN"); |
|
5713 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5714 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5715 |
|
5716 /* Get the value from a foo(<param_value>) style call */ |
|
5717 if (IN_param_value == NULL) |
|
5718 IN_param_value = function_call_param_iterator.next(); |
|
5719 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5720 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5721 |
|
5722 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5723 { |
|
5724 |
|
5725 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
5726 return return_type_symbol; |
|
5727 |
|
5728 } |
|
5729 |
|
5730 ERROR; |
|
5731 } |
|
5732 |
|
5733 }/*function_udint_to_wstring*/ |
|
5734 break; |
|
5735 |
|
5736 /**** |
|
5737 *UDINT_TO_STRING |
|
5738 */ |
|
5739 case function_udint_to_string : |
|
5740 { |
|
5741 symbol_c *last_type_symbol = NULL; |
|
5742 |
|
5743 { |
|
5744 identifier_c param_name("IN"); |
|
5745 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5746 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5747 |
|
5748 /* Get the value from a foo(<param_value>) style call */ |
|
5749 if (IN_param_value == NULL) |
|
5750 IN_param_value = function_call_param_iterator.next(); |
|
5751 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5752 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5753 |
|
5754 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5755 { |
|
5756 |
|
5757 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
5758 return return_type_symbol; |
|
5759 |
|
5760 } |
|
5761 |
|
5762 ERROR; |
|
5763 } |
|
5764 |
|
5765 }/*function_udint_to_string*/ |
|
5766 break; |
|
5767 |
|
5768 /**** |
|
5769 *UDINT_TO_LWORD |
|
5770 */ |
|
5771 case function_udint_to_lword : |
|
5772 { |
|
5773 symbol_c *last_type_symbol = NULL; |
|
5774 |
|
5775 { |
|
5776 identifier_c param_name("IN"); |
|
5777 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5778 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5779 |
|
5780 /* Get the value from a foo(<param_value>) style call */ |
|
5781 if (IN_param_value == NULL) |
|
5782 IN_param_value = function_call_param_iterator.next(); |
|
5783 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5784 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5785 |
|
5786 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5787 { |
|
5788 |
|
5789 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
5790 return return_type_symbol; |
|
5791 |
|
5792 } |
|
5793 |
|
5794 ERROR; |
|
5795 } |
|
5796 |
|
5797 }/*function_udint_to_lword*/ |
|
5798 break; |
|
5799 |
|
5800 /**** |
|
5801 *UDINT_TO_UINT |
|
5802 */ |
|
5803 case function_udint_to_uint : |
|
5804 { |
|
5805 symbol_c *last_type_symbol = NULL; |
|
5806 |
|
5807 { |
|
5808 identifier_c param_name("IN"); |
|
5809 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5810 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5811 |
|
5812 /* Get the value from a foo(<param_value>) style call */ |
|
5813 if (IN_param_value == NULL) |
|
5814 IN_param_value = function_call_param_iterator.next(); |
|
5815 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5816 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5817 |
|
5818 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5819 { |
|
5820 |
|
5821 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
5822 return return_type_symbol; |
|
5823 |
|
5824 } |
|
5825 |
|
5826 ERROR; |
|
5827 } |
|
5828 |
|
5829 }/*function_udint_to_uint*/ |
|
5830 break; |
|
5831 |
|
5832 /**** |
|
5833 *UDINT_TO_LREAL |
|
5834 */ |
|
5835 case function_udint_to_lreal : |
|
5836 { |
|
5837 symbol_c *last_type_symbol = NULL; |
|
5838 |
|
5839 { |
|
5840 identifier_c param_name("IN"); |
|
5841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5842 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5843 |
|
5844 /* Get the value from a foo(<param_value>) style call */ |
|
5845 if (IN_param_value == NULL) |
|
5846 IN_param_value = function_call_param_iterator.next(); |
|
5847 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5848 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5849 |
|
5850 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5851 { |
|
5852 |
|
5853 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
5854 return return_type_symbol; |
|
5855 |
|
5856 } |
|
5857 |
|
5858 ERROR; |
|
5859 } |
|
5860 |
|
5861 }/*function_udint_to_lreal*/ |
|
5862 break; |
|
5863 |
|
5864 /**** |
|
5865 *UDINT_TO_BYTE |
|
5866 */ |
|
5867 case function_udint_to_byte : |
|
5868 { |
|
5869 symbol_c *last_type_symbol = NULL; |
|
5870 |
|
5871 { |
|
5872 identifier_c param_name("IN"); |
|
5873 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5874 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5875 |
|
5876 /* Get the value from a foo(<param_value>) style call */ |
|
5877 if (IN_param_value == NULL) |
|
5878 IN_param_value = function_call_param_iterator.next(); |
|
5879 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5880 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5881 |
|
5882 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5883 { |
|
5884 |
|
5885 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
5886 return return_type_symbol; |
|
5887 |
|
5888 } |
|
5889 |
|
5890 ERROR; |
|
5891 } |
|
5892 |
|
5893 }/*function_udint_to_byte*/ |
|
5894 break; |
|
5895 |
|
5896 /**** |
|
5897 *UDINT_TO_USINT |
|
5898 */ |
|
5899 case function_udint_to_usint : |
|
5900 { |
|
5901 symbol_c *last_type_symbol = NULL; |
|
5902 |
|
5903 { |
|
5904 identifier_c param_name("IN"); |
|
5905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5906 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5907 |
|
5908 /* Get the value from a foo(<param_value>) style call */ |
|
5909 if (IN_param_value == NULL) |
|
5910 IN_param_value = function_call_param_iterator.next(); |
|
5911 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5912 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5913 |
|
5914 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5915 { |
|
5916 |
|
5917 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
5918 return return_type_symbol; |
|
5919 |
|
5920 } |
|
5921 |
|
5922 ERROR; |
|
5923 } |
|
5924 |
|
5925 }/*function_udint_to_usint*/ |
|
5926 break; |
|
5927 |
|
5928 /**** |
|
5929 *UDINT_TO_ULINT |
|
5930 */ |
|
5931 case function_udint_to_ulint : |
|
5932 { |
|
5933 symbol_c *last_type_symbol = NULL; |
|
5934 |
|
5935 { |
|
5936 identifier_c param_name("IN"); |
|
5937 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5938 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5939 |
|
5940 /* Get the value from a foo(<param_value>) style call */ |
|
5941 if (IN_param_value == NULL) |
|
5942 IN_param_value = function_call_param_iterator.next(); |
|
5943 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5944 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5945 |
|
5946 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5947 { |
|
5948 |
|
5949 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
5950 return return_type_symbol; |
|
5951 |
|
5952 } |
|
5953 |
|
5954 ERROR; |
|
5955 } |
|
5956 |
|
5957 }/*function_udint_to_ulint*/ |
|
5958 break; |
|
5959 |
|
5960 /**** |
|
5961 *UDINT_TO_BOOL |
|
5962 */ |
|
5963 case function_udint_to_bool : |
|
5964 { |
|
5965 symbol_c *last_type_symbol = NULL; |
|
5966 |
|
5967 { |
|
5968 identifier_c param_name("IN"); |
|
5969 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5970 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
5971 |
|
5972 /* Get the value from a foo(<param_value>) style call */ |
|
5973 if (IN_param_value == NULL) |
|
5974 IN_param_value = function_call_param_iterator.next(); |
|
5975 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
5976 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
5977 |
|
5978 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
5979 { |
|
5980 |
|
5981 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
5982 return return_type_symbol; |
|
5983 |
|
5984 } |
|
5985 |
|
5986 ERROR; |
|
5987 } |
|
5988 |
|
5989 }/*function_udint_to_bool*/ |
|
5990 break; |
|
5991 |
|
5992 /**** |
|
5993 *UDINT_TO_TIME |
|
5994 */ |
|
5995 case function_udint_to_time : |
|
5996 { |
|
5997 symbol_c *last_type_symbol = NULL; |
|
5998 |
|
5999 { |
|
6000 identifier_c param_name("IN"); |
|
6001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6003 |
|
6004 /* Get the value from a foo(<param_value>) style call */ |
|
6005 if (IN_param_value == NULL) |
|
6006 IN_param_value = function_call_param_iterator.next(); |
|
6007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6009 |
|
6010 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
6011 { |
|
6012 |
|
6013 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
6014 return return_type_symbol; |
|
6015 |
|
6016 } |
|
6017 |
|
6018 ERROR; |
|
6019 } |
|
6020 |
|
6021 }/*function_udint_to_time*/ |
|
6022 break; |
|
6023 |
|
6024 /**** |
|
6025 *UDINT_TO_INT |
|
6026 */ |
|
6027 case function_udint_to_int : |
|
6028 { |
|
6029 symbol_c *last_type_symbol = NULL; |
|
6030 |
|
6031 { |
|
6032 identifier_c param_name("IN"); |
|
6033 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6034 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6035 |
|
6036 /* Get the value from a foo(<param_value>) style call */ |
|
6037 if (IN_param_value == NULL) |
|
6038 IN_param_value = function_call_param_iterator.next(); |
|
6039 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6040 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6041 |
|
6042 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
6043 { |
|
6044 |
|
6045 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
6046 return return_type_symbol; |
|
6047 |
|
6048 } |
|
6049 |
|
6050 ERROR; |
|
6051 } |
|
6052 |
|
6053 }/*function_udint_to_int*/ |
|
6054 break; |
|
6055 |
|
6056 /**** |
|
6057 *WORD_TO_REAL |
|
6058 */ |
|
6059 case function_word_to_real : |
|
6060 { |
|
6061 symbol_c *last_type_symbol = NULL; |
|
6062 |
|
6063 { |
|
6064 identifier_c param_name("IN"); |
|
6065 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6066 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6067 |
|
6068 /* Get the value from a foo(<param_value>) style call */ |
|
6069 if (IN_param_value == NULL) |
|
6070 IN_param_value = function_call_param_iterator.next(); |
|
6071 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6072 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6073 |
|
6074 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6075 { |
|
6076 |
|
6077 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
6078 return return_type_symbol; |
|
6079 |
|
6080 } |
|
6081 |
|
6082 ERROR; |
|
6083 } |
|
6084 |
|
6085 }/*function_word_to_real*/ |
|
6086 break; |
|
6087 |
|
6088 /**** |
|
6089 *WORD_TO_SINT |
|
6090 */ |
|
6091 case function_word_to_sint : |
|
6092 { |
|
6093 symbol_c *last_type_symbol = NULL; |
|
6094 |
|
6095 { |
|
6096 identifier_c param_name("IN"); |
|
6097 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6098 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6099 |
|
6100 /* Get the value from a foo(<param_value>) style call */ |
|
6101 if (IN_param_value == NULL) |
|
6102 IN_param_value = function_call_param_iterator.next(); |
|
6103 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6104 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6105 |
|
6106 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6107 { |
|
6108 |
|
6109 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
6110 return return_type_symbol; |
|
6111 |
|
6112 } |
|
6113 |
|
6114 ERROR; |
|
6115 } |
|
6116 |
|
6117 }/*function_word_to_sint*/ |
|
6118 break; |
|
6119 |
|
6120 /**** |
|
6121 *WORD_TO_LINT |
|
6122 */ |
|
6123 case function_word_to_lint : |
|
6124 { |
|
6125 symbol_c *last_type_symbol = NULL; |
|
6126 |
|
6127 { |
|
6128 identifier_c param_name("IN"); |
|
6129 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6130 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6131 |
|
6132 /* Get the value from a foo(<param_value>) style call */ |
|
6133 if (IN_param_value == NULL) |
|
6134 IN_param_value = function_call_param_iterator.next(); |
|
6135 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6137 |
|
6138 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6139 { |
|
6140 |
|
6141 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
6142 return return_type_symbol; |
|
6143 |
|
6144 } |
|
6145 |
|
6146 ERROR; |
|
6147 } |
|
6148 |
|
6149 }/*function_word_to_lint*/ |
|
6150 break; |
|
6151 |
|
6152 /**** |
|
6153 *WORD_TO_DINT |
|
6154 */ |
|
6155 case function_word_to_dint : |
|
6156 { |
|
6157 symbol_c *last_type_symbol = NULL; |
|
6158 |
|
6159 { |
|
6160 identifier_c param_name("IN"); |
|
6161 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6162 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6163 |
|
6164 /* Get the value from a foo(<param_value>) style call */ |
|
6165 if (IN_param_value == NULL) |
|
6166 IN_param_value = function_call_param_iterator.next(); |
|
6167 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6168 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6169 |
|
6170 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6171 { |
|
6172 |
|
6173 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
6174 return return_type_symbol; |
|
6175 |
|
6176 } |
|
6177 |
|
6178 ERROR; |
|
6179 } |
|
6180 |
|
6181 }/*function_word_to_dint*/ |
|
6182 break; |
|
6183 |
|
6184 /**** |
|
6185 *WORD_TO_DATE |
|
6186 */ |
|
6187 case function_word_to_date : |
|
6188 { |
|
6189 symbol_c *last_type_symbol = NULL; |
|
6190 |
|
6191 { |
|
6192 identifier_c param_name("IN"); |
|
6193 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6194 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6195 |
|
6196 /* Get the value from a foo(<param_value>) style call */ |
|
6197 if (IN_param_value == NULL) |
|
6198 IN_param_value = function_call_param_iterator.next(); |
|
6199 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6200 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6201 |
|
6202 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6203 { |
|
6204 |
|
6205 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
6206 return return_type_symbol; |
|
6207 |
|
6208 } |
|
6209 |
|
6210 ERROR; |
|
6211 } |
|
6212 |
|
6213 }/*function_word_to_date*/ |
|
6214 break; |
|
6215 |
|
6216 /**** |
|
6217 *WORD_TO_DWORD |
|
6218 */ |
|
6219 case function_word_to_dword : |
|
6220 { |
|
6221 symbol_c *last_type_symbol = NULL; |
|
6222 |
|
6223 { |
|
6224 identifier_c param_name("IN"); |
|
6225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6227 |
|
6228 /* Get the value from a foo(<param_value>) style call */ |
|
6229 if (IN_param_value == NULL) |
|
6230 IN_param_value = function_call_param_iterator.next(); |
|
6231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6233 |
|
6234 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6235 { |
|
6236 |
|
6237 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
6238 return return_type_symbol; |
|
6239 |
|
6240 } |
|
6241 |
|
6242 ERROR; |
|
6243 } |
|
6244 |
|
6245 }/*function_word_to_dword*/ |
|
6246 break; |
|
6247 |
|
6248 /**** |
|
6249 *WORD_TO_DT |
|
6250 */ |
|
6251 case function_word_to_dt : |
|
6252 { |
|
6253 symbol_c *last_type_symbol = NULL; |
|
6254 |
|
6255 { |
|
6256 identifier_c param_name("IN"); |
|
6257 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6258 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6259 |
|
6260 /* Get the value from a foo(<param_value>) style call */ |
|
6261 if (IN_param_value == NULL) |
|
6262 IN_param_value = function_call_param_iterator.next(); |
|
6263 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6264 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6265 |
|
6266 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6267 { |
|
6268 |
|
6269 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
6270 return return_type_symbol; |
|
6271 |
|
6272 } |
|
6273 |
|
6274 ERROR; |
|
6275 } |
|
6276 |
|
6277 }/*function_word_to_dt*/ |
|
6278 break; |
|
6279 |
|
6280 /**** |
|
6281 *WORD_TO_TOD |
|
6282 */ |
|
6283 case function_word_to_tod : |
|
6284 { |
|
6285 symbol_c *last_type_symbol = NULL; |
|
6286 |
|
6287 { |
|
6288 identifier_c param_name("IN"); |
|
6289 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6290 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6291 |
|
6292 /* Get the value from a foo(<param_value>) style call */ |
|
6293 if (IN_param_value == NULL) |
|
6294 IN_param_value = function_call_param_iterator.next(); |
|
6295 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6296 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6297 |
|
6298 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6299 { |
|
6300 |
|
6301 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
6302 return return_type_symbol; |
|
6303 |
|
6304 } |
|
6305 |
|
6306 ERROR; |
|
6307 } |
|
6308 |
|
6309 }/*function_word_to_tod*/ |
|
6310 break; |
|
6311 |
|
6312 /**** |
|
6313 *WORD_TO_UDINT |
|
6314 */ |
|
6315 case function_word_to_udint : |
|
6316 { |
|
6317 symbol_c *last_type_symbol = NULL; |
|
6318 |
|
6319 { |
|
6320 identifier_c param_name("IN"); |
|
6321 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6322 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6323 |
|
6324 /* Get the value from a foo(<param_value>) style call */ |
|
6325 if (IN_param_value == NULL) |
|
6326 IN_param_value = function_call_param_iterator.next(); |
|
6327 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6328 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6329 |
|
6330 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6331 { |
|
6332 |
|
6333 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
6334 return return_type_symbol; |
|
6335 |
|
6336 } |
|
6337 |
|
6338 ERROR; |
|
6339 } |
|
6340 |
|
6341 }/*function_word_to_udint*/ |
|
6342 break; |
|
6343 |
|
6344 /**** |
|
6345 *WORD_TO_WORD |
|
6346 */ |
|
6347 case function_word_to_word : |
|
6348 { |
|
6349 symbol_c *last_type_symbol = NULL; |
|
6350 |
|
6351 { |
|
6352 identifier_c param_name("IN"); |
|
6353 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6354 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6355 |
|
6356 /* Get the value from a foo(<param_value>) style call */ |
|
6357 if (IN_param_value == NULL) |
|
6358 IN_param_value = function_call_param_iterator.next(); |
|
6359 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6360 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6361 |
|
6362 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6363 { |
|
6364 |
|
6365 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
6366 return return_type_symbol; |
|
6367 |
|
6368 } |
|
6369 |
|
6370 ERROR; |
|
6371 } |
|
6372 |
|
6373 }/*function_word_to_word*/ |
|
6374 break; |
|
6375 |
|
6376 /**** |
|
6377 *WORD_TO_WSTRING |
|
6378 */ |
|
6379 case function_word_to_wstring : |
|
6380 { |
|
6381 symbol_c *last_type_symbol = NULL; |
|
6382 |
|
6383 { |
|
6384 identifier_c param_name("IN"); |
|
6385 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6386 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6387 |
|
6388 /* Get the value from a foo(<param_value>) style call */ |
|
6389 if (IN_param_value == NULL) |
|
6390 IN_param_value = function_call_param_iterator.next(); |
|
6391 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6392 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6393 |
|
6394 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6395 { |
|
6396 |
|
6397 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
6398 return return_type_symbol; |
|
6399 |
|
6400 } |
|
6401 |
|
6402 ERROR; |
|
6403 } |
|
6404 |
|
6405 }/*function_word_to_wstring*/ |
|
6406 break; |
|
6407 |
|
6408 /**** |
|
6409 *WORD_TO_STRING |
|
6410 */ |
|
6411 case function_word_to_string : |
|
6412 { |
|
6413 symbol_c *last_type_symbol = NULL; |
|
6414 |
|
6415 { |
|
6416 identifier_c param_name("IN"); |
|
6417 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6418 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6419 |
|
6420 /* Get the value from a foo(<param_value>) style call */ |
|
6421 if (IN_param_value == NULL) |
|
6422 IN_param_value = function_call_param_iterator.next(); |
|
6423 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6424 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6425 |
|
6426 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6427 { |
|
6428 |
|
6429 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
6430 return return_type_symbol; |
|
6431 |
|
6432 } |
|
6433 |
|
6434 ERROR; |
|
6435 } |
|
6436 |
|
6437 }/*function_word_to_string*/ |
|
6438 break; |
|
6439 |
|
6440 /**** |
|
6441 *WORD_TO_LWORD |
|
6442 */ |
|
6443 case function_word_to_lword : |
|
6444 { |
|
6445 symbol_c *last_type_symbol = NULL; |
|
6446 |
|
6447 { |
|
6448 identifier_c param_name("IN"); |
|
6449 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6450 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6451 |
|
6452 /* Get the value from a foo(<param_value>) style call */ |
|
6453 if (IN_param_value == NULL) |
|
6454 IN_param_value = function_call_param_iterator.next(); |
|
6455 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6456 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6457 |
|
6458 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6459 { |
|
6460 |
|
6461 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
6462 return return_type_symbol; |
|
6463 |
|
6464 } |
|
6465 |
|
6466 ERROR; |
|
6467 } |
|
6468 |
|
6469 }/*function_word_to_lword*/ |
|
6470 break; |
|
6471 |
|
6472 /**** |
|
6473 *WORD_TO_UINT |
|
6474 */ |
|
6475 case function_word_to_uint : |
|
6476 { |
|
6477 symbol_c *last_type_symbol = NULL; |
|
6478 |
|
6479 { |
|
6480 identifier_c param_name("IN"); |
|
6481 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6482 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6483 |
|
6484 /* Get the value from a foo(<param_value>) style call */ |
|
6485 if (IN_param_value == NULL) |
|
6486 IN_param_value = function_call_param_iterator.next(); |
|
6487 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6488 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6489 |
|
6490 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6491 { |
|
6492 |
|
6493 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
6494 return return_type_symbol; |
|
6495 |
|
6496 } |
|
6497 |
|
6498 ERROR; |
|
6499 } |
|
6500 |
|
6501 }/*function_word_to_uint*/ |
|
6502 break; |
|
6503 |
|
6504 /**** |
|
6505 *WORD_TO_LREAL |
|
6506 */ |
|
6507 case function_word_to_lreal : |
|
6508 { |
|
6509 symbol_c *last_type_symbol = NULL; |
|
6510 |
|
6511 { |
|
6512 identifier_c param_name("IN"); |
|
6513 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6514 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6515 |
|
6516 /* Get the value from a foo(<param_value>) style call */ |
|
6517 if (IN_param_value == NULL) |
|
6518 IN_param_value = function_call_param_iterator.next(); |
|
6519 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6520 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6521 |
|
6522 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6523 { |
|
6524 |
|
6525 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
6526 return return_type_symbol; |
|
6527 |
|
6528 } |
|
6529 |
|
6530 ERROR; |
|
6531 } |
|
6532 |
|
6533 }/*function_word_to_lreal*/ |
|
6534 break; |
|
6535 |
|
6536 /**** |
|
6537 *WORD_TO_BYTE |
|
6538 */ |
|
6539 case function_word_to_byte : |
|
6540 { |
|
6541 symbol_c *last_type_symbol = NULL; |
|
6542 |
|
6543 { |
|
6544 identifier_c param_name("IN"); |
|
6545 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6546 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6547 |
|
6548 /* Get the value from a foo(<param_value>) style call */ |
|
6549 if (IN_param_value == NULL) |
|
6550 IN_param_value = function_call_param_iterator.next(); |
|
6551 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6552 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6553 |
|
6554 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6555 { |
|
6556 |
|
6557 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
6558 return return_type_symbol; |
|
6559 |
|
6560 } |
|
6561 |
|
6562 ERROR; |
|
6563 } |
|
6564 |
|
6565 }/*function_word_to_byte*/ |
|
6566 break; |
|
6567 |
|
6568 /**** |
|
6569 *WORD_TO_USINT |
|
6570 */ |
|
6571 case function_word_to_usint : |
|
6572 { |
|
6573 symbol_c *last_type_symbol = NULL; |
|
6574 |
|
6575 { |
|
6576 identifier_c param_name("IN"); |
|
6577 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6578 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6579 |
|
6580 /* Get the value from a foo(<param_value>) style call */ |
|
6581 if (IN_param_value == NULL) |
|
6582 IN_param_value = function_call_param_iterator.next(); |
|
6583 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6584 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6585 |
|
6586 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6587 { |
|
6588 |
|
6589 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
6590 return return_type_symbol; |
|
6591 |
|
6592 } |
|
6593 |
|
6594 ERROR; |
|
6595 } |
|
6596 |
|
6597 }/*function_word_to_usint*/ |
|
6598 break; |
|
6599 |
|
6600 /**** |
|
6601 *WORD_TO_ULINT |
|
6602 */ |
|
6603 case function_word_to_ulint : |
|
6604 { |
|
6605 symbol_c *last_type_symbol = NULL; |
|
6606 |
|
6607 { |
|
6608 identifier_c param_name("IN"); |
|
6609 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6610 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6611 |
|
6612 /* Get the value from a foo(<param_value>) style call */ |
|
6613 if (IN_param_value == NULL) |
|
6614 IN_param_value = function_call_param_iterator.next(); |
|
6615 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6616 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6617 |
|
6618 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6619 { |
|
6620 |
|
6621 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
6622 return return_type_symbol; |
|
6623 |
|
6624 } |
|
6625 |
|
6626 ERROR; |
|
6627 } |
|
6628 |
|
6629 }/*function_word_to_ulint*/ |
|
6630 break; |
|
6631 |
|
6632 /**** |
|
6633 *WORD_TO_BOOL |
|
6634 */ |
|
6635 case function_word_to_bool : |
|
6636 { |
|
6637 symbol_c *last_type_symbol = NULL; |
|
6638 |
|
6639 { |
|
6640 identifier_c param_name("IN"); |
|
6641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6642 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6643 |
|
6644 /* Get the value from a foo(<param_value>) style call */ |
|
6645 if (IN_param_value == NULL) |
|
6646 IN_param_value = function_call_param_iterator.next(); |
|
6647 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6648 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6649 |
|
6650 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6651 { |
|
6652 |
|
6653 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
6654 return return_type_symbol; |
|
6655 |
|
6656 } |
|
6657 |
|
6658 ERROR; |
|
6659 } |
|
6660 |
|
6661 }/*function_word_to_bool*/ |
|
6662 break; |
|
6663 |
|
6664 /**** |
|
6665 *WORD_TO_TIME |
|
6666 */ |
|
6667 case function_word_to_time : |
|
6668 { |
|
6669 symbol_c *last_type_symbol = NULL; |
|
6670 |
|
6671 { |
|
6672 identifier_c param_name("IN"); |
|
6673 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6674 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6675 |
|
6676 /* Get the value from a foo(<param_value>) style call */ |
|
6677 if (IN_param_value == NULL) |
|
6678 IN_param_value = function_call_param_iterator.next(); |
|
6679 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6680 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6681 |
|
6682 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6683 { |
|
6684 |
|
6685 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
6686 return return_type_symbol; |
|
6687 |
|
6688 } |
|
6689 |
|
6690 ERROR; |
|
6691 } |
|
6692 |
|
6693 }/*function_word_to_time*/ |
|
6694 break; |
|
6695 |
|
6696 /**** |
|
6697 *WORD_TO_INT |
|
6698 */ |
|
6699 case function_word_to_int : |
|
6700 { |
|
6701 symbol_c *last_type_symbol = NULL; |
|
6702 |
|
6703 { |
|
6704 identifier_c param_name("IN"); |
|
6705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6707 |
|
6708 /* Get the value from a foo(<param_value>) style call */ |
|
6709 if (IN_param_value == NULL) |
|
6710 IN_param_value = function_call_param_iterator.next(); |
|
6711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6713 |
|
6714 if (typeid(*last_type_symbol) == typeid(word_type_name_c)) |
|
6715 { |
|
6716 |
|
6717 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
6718 return return_type_symbol; |
|
6719 |
|
6720 } |
|
6721 |
|
6722 ERROR; |
|
6723 } |
|
6724 |
|
6725 }/*function_word_to_int*/ |
|
6726 break; |
|
6727 |
|
6728 /**** |
|
6729 *WSTRING_TO_REAL |
|
6730 */ |
|
6731 case function_wstring_to_real : |
|
6732 { |
|
6733 symbol_c *last_type_symbol = NULL; |
|
6734 |
|
6735 { |
|
6736 identifier_c param_name("IN"); |
|
6737 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6738 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6739 |
|
6740 /* Get the value from a foo(<param_value>) style call */ |
|
6741 if (IN_param_value == NULL) |
|
6742 IN_param_value = function_call_param_iterator.next(); |
|
6743 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6744 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6745 |
|
6746 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6747 { |
|
6748 |
|
6749 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
6750 return return_type_symbol; |
|
6751 |
|
6752 } |
|
6753 |
|
6754 ERROR; |
|
6755 } |
|
6756 |
|
6757 }/*function_wstring_to_real*/ |
|
6758 break; |
|
6759 |
|
6760 /**** |
|
6761 *WSTRING_TO_SINT |
|
6762 */ |
|
6763 case function_wstring_to_sint : |
|
6764 { |
|
6765 symbol_c *last_type_symbol = NULL; |
|
6766 |
|
6767 { |
|
6768 identifier_c param_name("IN"); |
|
6769 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6770 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6771 |
|
6772 /* Get the value from a foo(<param_value>) style call */ |
|
6773 if (IN_param_value == NULL) |
|
6774 IN_param_value = function_call_param_iterator.next(); |
|
6775 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6776 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6777 |
|
6778 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6779 { |
|
6780 |
|
6781 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
6782 return return_type_symbol; |
|
6783 |
|
6784 } |
|
6785 |
|
6786 ERROR; |
|
6787 } |
|
6788 |
|
6789 }/*function_wstring_to_sint*/ |
|
6790 break; |
|
6791 |
|
6792 /**** |
|
6793 *WSTRING_TO_LINT |
|
6794 */ |
|
6795 case function_wstring_to_lint : |
|
6796 { |
|
6797 symbol_c *last_type_symbol = NULL; |
|
6798 |
|
6799 { |
|
6800 identifier_c param_name("IN"); |
|
6801 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6802 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6803 |
|
6804 /* Get the value from a foo(<param_value>) style call */ |
|
6805 if (IN_param_value == NULL) |
|
6806 IN_param_value = function_call_param_iterator.next(); |
|
6807 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6808 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6809 |
|
6810 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6811 { |
|
6812 |
|
6813 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
6814 return return_type_symbol; |
|
6815 |
|
6816 } |
|
6817 |
|
6818 ERROR; |
|
6819 } |
|
6820 |
|
6821 }/*function_wstring_to_lint*/ |
|
6822 break; |
|
6823 |
|
6824 /**** |
|
6825 *WSTRING_TO_DINT |
|
6826 */ |
|
6827 case function_wstring_to_dint : |
|
6828 { |
|
6829 symbol_c *last_type_symbol = NULL; |
|
6830 |
|
6831 { |
|
6832 identifier_c param_name("IN"); |
|
6833 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6834 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6835 |
|
6836 /* Get the value from a foo(<param_value>) style call */ |
|
6837 if (IN_param_value == NULL) |
|
6838 IN_param_value = function_call_param_iterator.next(); |
|
6839 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6840 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6841 |
|
6842 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6843 { |
|
6844 |
|
6845 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
6846 return return_type_symbol; |
|
6847 |
|
6848 } |
|
6849 |
|
6850 ERROR; |
|
6851 } |
|
6852 |
|
6853 }/*function_wstring_to_dint*/ |
|
6854 break; |
|
6855 |
|
6856 /**** |
|
6857 *WSTRING_TO_DATE |
|
6858 */ |
|
6859 case function_wstring_to_date : |
|
6860 { |
|
6861 symbol_c *last_type_symbol = NULL; |
|
6862 |
|
6863 { |
|
6864 identifier_c param_name("IN"); |
|
6865 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6866 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6867 |
|
6868 /* Get the value from a foo(<param_value>) style call */ |
|
6869 if (IN_param_value == NULL) |
|
6870 IN_param_value = function_call_param_iterator.next(); |
|
6871 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6872 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6873 |
|
6874 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6875 { |
|
6876 |
|
6877 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
6878 return return_type_symbol; |
|
6879 |
|
6880 } |
|
6881 |
|
6882 ERROR; |
|
6883 } |
|
6884 |
|
6885 }/*function_wstring_to_date*/ |
|
6886 break; |
|
6887 |
|
6888 /**** |
|
6889 *WSTRING_TO_DWORD |
|
6890 */ |
|
6891 case function_wstring_to_dword : |
|
6892 { |
|
6893 symbol_c *last_type_symbol = NULL; |
|
6894 |
|
6895 { |
|
6896 identifier_c param_name("IN"); |
|
6897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6898 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6899 |
|
6900 /* Get the value from a foo(<param_value>) style call */ |
|
6901 if (IN_param_value == NULL) |
|
6902 IN_param_value = function_call_param_iterator.next(); |
|
6903 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6905 |
|
6906 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6907 { |
|
6908 |
|
6909 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
6910 return return_type_symbol; |
|
6911 |
|
6912 } |
|
6913 |
|
6914 ERROR; |
|
6915 } |
|
6916 |
|
6917 }/*function_wstring_to_dword*/ |
|
6918 break; |
|
6919 |
|
6920 /**** |
|
6921 *WSTRING_TO_DT |
|
6922 */ |
|
6923 case function_wstring_to_dt : |
|
6924 { |
|
6925 symbol_c *last_type_symbol = NULL; |
|
6926 |
|
6927 { |
|
6928 identifier_c param_name("IN"); |
|
6929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6931 |
|
6932 /* Get the value from a foo(<param_value>) style call */ |
|
6933 if (IN_param_value == NULL) |
|
6934 IN_param_value = function_call_param_iterator.next(); |
|
6935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6937 |
|
6938 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6939 { |
|
6940 |
|
6941 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
6942 return return_type_symbol; |
|
6943 |
|
6944 } |
|
6945 |
|
6946 ERROR; |
|
6947 } |
|
6948 |
|
6949 }/*function_wstring_to_dt*/ |
|
6950 break; |
|
6951 |
|
6952 /**** |
|
6953 *WSTRING_TO_TOD |
|
6954 */ |
|
6955 case function_wstring_to_tod : |
|
6956 { |
|
6957 symbol_c *last_type_symbol = NULL; |
|
6958 |
|
6959 { |
|
6960 identifier_c param_name("IN"); |
|
6961 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6962 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6963 |
|
6964 /* Get the value from a foo(<param_value>) style call */ |
|
6965 if (IN_param_value == NULL) |
|
6966 IN_param_value = function_call_param_iterator.next(); |
|
6967 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
6968 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
6969 |
|
6970 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
6971 { |
|
6972 |
|
6973 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
6974 return return_type_symbol; |
|
6975 |
|
6976 } |
|
6977 |
|
6978 ERROR; |
|
6979 } |
|
6980 |
|
6981 }/*function_wstring_to_tod*/ |
|
6982 break; |
|
6983 |
|
6984 /**** |
|
6985 *WSTRING_TO_UDINT |
|
6986 */ |
|
6987 case function_wstring_to_udint : |
|
6988 { |
|
6989 symbol_c *last_type_symbol = NULL; |
|
6990 |
|
6991 { |
|
6992 identifier_c param_name("IN"); |
|
6993 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6994 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
6995 |
|
6996 /* Get the value from a foo(<param_value>) style call */ |
|
6997 if (IN_param_value == NULL) |
|
6998 IN_param_value = function_call_param_iterator.next(); |
|
6999 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7000 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7001 |
|
7002 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7003 { |
|
7004 |
|
7005 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
7006 return return_type_symbol; |
|
7007 |
|
7008 } |
|
7009 |
|
7010 ERROR; |
|
7011 } |
|
7012 |
|
7013 }/*function_wstring_to_udint*/ |
|
7014 break; |
|
7015 |
|
7016 /**** |
|
7017 *WSTRING_TO_WORD |
|
7018 */ |
|
7019 case function_wstring_to_word : |
|
7020 { |
|
7021 symbol_c *last_type_symbol = NULL; |
|
7022 |
|
7023 { |
|
7024 identifier_c param_name("IN"); |
|
7025 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7026 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7027 |
|
7028 /* Get the value from a foo(<param_value>) style call */ |
|
7029 if (IN_param_value == NULL) |
|
7030 IN_param_value = function_call_param_iterator.next(); |
|
7031 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7032 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7033 |
|
7034 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7035 { |
|
7036 |
|
7037 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
7038 return return_type_symbol; |
|
7039 |
|
7040 } |
|
7041 |
|
7042 ERROR; |
|
7043 } |
|
7044 |
|
7045 }/*function_wstring_to_word*/ |
|
7046 break; |
|
7047 |
|
7048 /**** |
|
7049 *WSTRING_TO_WSTRING |
|
7050 */ |
|
7051 case function_wstring_to_wstring : |
|
7052 { |
|
7053 symbol_c *last_type_symbol = NULL; |
|
7054 |
|
7055 { |
|
7056 identifier_c param_name("IN"); |
|
7057 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7058 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7059 |
|
7060 /* Get the value from a foo(<param_value>) style call */ |
|
7061 if (IN_param_value == NULL) |
|
7062 IN_param_value = function_call_param_iterator.next(); |
|
7063 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7064 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7065 |
|
7066 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7067 { |
|
7068 |
|
7069 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
7070 return return_type_symbol; |
|
7071 |
|
7072 } |
|
7073 |
|
7074 ERROR; |
|
7075 } |
|
7076 |
|
7077 }/*function_wstring_to_wstring*/ |
|
7078 break; |
|
7079 |
|
7080 /**** |
|
7081 *WSTRING_TO_STRING |
|
7082 */ |
|
7083 case function_wstring_to_string : |
|
7084 { |
|
7085 symbol_c *last_type_symbol = NULL; |
|
7086 |
|
7087 { |
|
7088 identifier_c param_name("IN"); |
|
7089 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7090 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7091 |
|
7092 /* Get the value from a foo(<param_value>) style call */ |
|
7093 if (IN_param_value == NULL) |
|
7094 IN_param_value = function_call_param_iterator.next(); |
|
7095 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7096 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7097 |
|
7098 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7099 { |
|
7100 |
|
7101 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
7102 return return_type_symbol; |
|
7103 |
|
7104 } |
|
7105 |
|
7106 ERROR; |
|
7107 } |
|
7108 |
|
7109 }/*function_wstring_to_string*/ |
|
7110 break; |
|
7111 |
|
7112 /**** |
|
7113 *WSTRING_TO_LWORD |
|
7114 */ |
|
7115 case function_wstring_to_lword : |
|
7116 { |
|
7117 symbol_c *last_type_symbol = NULL; |
|
7118 |
|
7119 { |
|
7120 identifier_c param_name("IN"); |
|
7121 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7122 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7123 |
|
7124 /* Get the value from a foo(<param_value>) style call */ |
|
7125 if (IN_param_value == NULL) |
|
7126 IN_param_value = function_call_param_iterator.next(); |
|
7127 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7128 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7129 |
|
7130 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7131 { |
|
7132 |
|
7133 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
7134 return return_type_symbol; |
|
7135 |
|
7136 } |
|
7137 |
|
7138 ERROR; |
|
7139 } |
|
7140 |
|
7141 }/*function_wstring_to_lword*/ |
|
7142 break; |
|
7143 |
|
7144 /**** |
|
7145 *WSTRING_TO_UINT |
|
7146 */ |
|
7147 case function_wstring_to_uint : |
|
7148 { |
|
7149 symbol_c *last_type_symbol = NULL; |
|
7150 |
|
7151 { |
|
7152 identifier_c param_name("IN"); |
|
7153 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7154 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7155 |
|
7156 /* Get the value from a foo(<param_value>) style call */ |
|
7157 if (IN_param_value == NULL) |
|
7158 IN_param_value = function_call_param_iterator.next(); |
|
7159 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7160 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7161 |
|
7162 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7163 { |
|
7164 |
|
7165 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
7166 return return_type_symbol; |
|
7167 |
|
7168 } |
|
7169 |
|
7170 ERROR; |
|
7171 } |
|
7172 |
|
7173 }/*function_wstring_to_uint*/ |
|
7174 break; |
|
7175 |
|
7176 /**** |
|
7177 *WSTRING_TO_LREAL |
|
7178 */ |
|
7179 case function_wstring_to_lreal : |
|
7180 { |
|
7181 symbol_c *last_type_symbol = NULL; |
|
7182 |
|
7183 { |
|
7184 identifier_c param_name("IN"); |
|
7185 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7186 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7187 |
|
7188 /* Get the value from a foo(<param_value>) style call */ |
|
7189 if (IN_param_value == NULL) |
|
7190 IN_param_value = function_call_param_iterator.next(); |
|
7191 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7192 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7193 |
|
7194 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7195 { |
|
7196 |
|
7197 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
7198 return return_type_symbol; |
|
7199 |
|
7200 } |
|
7201 |
|
7202 ERROR; |
|
7203 } |
|
7204 |
|
7205 }/*function_wstring_to_lreal*/ |
|
7206 break; |
|
7207 |
|
7208 /**** |
|
7209 *WSTRING_TO_BYTE |
|
7210 */ |
|
7211 case function_wstring_to_byte : |
|
7212 { |
|
7213 symbol_c *last_type_symbol = NULL; |
|
7214 |
|
7215 { |
|
7216 identifier_c param_name("IN"); |
|
7217 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7218 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7219 |
|
7220 /* Get the value from a foo(<param_value>) style call */ |
|
7221 if (IN_param_value == NULL) |
|
7222 IN_param_value = function_call_param_iterator.next(); |
|
7223 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7224 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7225 |
|
7226 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7227 { |
|
7228 |
|
7229 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
7230 return return_type_symbol; |
|
7231 |
|
7232 } |
|
7233 |
|
7234 ERROR; |
|
7235 } |
|
7236 |
|
7237 }/*function_wstring_to_byte*/ |
|
7238 break; |
|
7239 |
|
7240 /**** |
|
7241 *WSTRING_TO_USINT |
|
7242 */ |
|
7243 case function_wstring_to_usint : |
|
7244 { |
|
7245 symbol_c *last_type_symbol = NULL; |
|
7246 |
|
7247 { |
|
7248 identifier_c param_name("IN"); |
|
7249 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7250 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7251 |
|
7252 /* Get the value from a foo(<param_value>) style call */ |
|
7253 if (IN_param_value == NULL) |
|
7254 IN_param_value = function_call_param_iterator.next(); |
|
7255 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7256 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7257 |
|
7258 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7259 { |
|
7260 |
|
7261 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
7262 return return_type_symbol; |
|
7263 |
|
7264 } |
|
7265 |
|
7266 ERROR; |
|
7267 } |
|
7268 |
|
7269 }/*function_wstring_to_usint*/ |
|
7270 break; |
|
7271 |
|
7272 /**** |
|
7273 *WSTRING_TO_ULINT |
|
7274 */ |
|
7275 case function_wstring_to_ulint : |
|
7276 { |
|
7277 symbol_c *last_type_symbol = NULL; |
|
7278 |
|
7279 { |
|
7280 identifier_c param_name("IN"); |
|
7281 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7282 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7283 |
|
7284 /* Get the value from a foo(<param_value>) style call */ |
|
7285 if (IN_param_value == NULL) |
|
7286 IN_param_value = function_call_param_iterator.next(); |
|
7287 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7288 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7289 |
|
7290 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7291 { |
|
7292 |
|
7293 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
7294 return return_type_symbol; |
|
7295 |
|
7296 } |
|
7297 |
|
7298 ERROR; |
|
7299 } |
|
7300 |
|
7301 }/*function_wstring_to_ulint*/ |
|
7302 break; |
|
7303 |
|
7304 /**** |
|
7305 *WSTRING_TO_BOOL |
|
7306 */ |
|
7307 case function_wstring_to_bool : |
|
7308 { |
|
7309 symbol_c *last_type_symbol = NULL; |
|
7310 |
|
7311 { |
|
7312 identifier_c param_name("IN"); |
|
7313 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7314 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7315 |
|
7316 /* Get the value from a foo(<param_value>) style call */ |
|
7317 if (IN_param_value == NULL) |
|
7318 IN_param_value = function_call_param_iterator.next(); |
|
7319 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7320 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7321 |
|
7322 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7323 { |
|
7324 |
|
7325 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
7326 return return_type_symbol; |
|
7327 |
|
7328 } |
|
7329 |
|
7330 ERROR; |
|
7331 } |
|
7332 |
|
7333 }/*function_wstring_to_bool*/ |
|
7334 break; |
|
7335 |
|
7336 /**** |
|
7337 *WSTRING_TO_TIME |
|
7338 */ |
|
7339 case function_wstring_to_time : |
|
7340 { |
|
7341 symbol_c *last_type_symbol = NULL; |
|
7342 |
|
7343 { |
|
7344 identifier_c param_name("IN"); |
|
7345 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7346 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7347 |
|
7348 /* Get the value from a foo(<param_value>) style call */ |
|
7349 if (IN_param_value == NULL) |
|
7350 IN_param_value = function_call_param_iterator.next(); |
|
7351 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7352 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7353 |
|
7354 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7355 { |
|
7356 |
|
7357 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
7358 return return_type_symbol; |
|
7359 |
|
7360 } |
|
7361 |
|
7362 ERROR; |
|
7363 } |
|
7364 |
|
7365 }/*function_wstring_to_time*/ |
|
7366 break; |
|
7367 |
|
7368 /**** |
|
7369 *WSTRING_TO_INT |
|
7370 */ |
|
7371 case function_wstring_to_int : |
|
7372 { |
|
7373 symbol_c *last_type_symbol = NULL; |
|
7374 |
|
7375 { |
|
7376 identifier_c param_name("IN"); |
|
7377 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7378 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7379 |
|
7380 /* Get the value from a foo(<param_value>) style call */ |
|
7381 if (IN_param_value == NULL) |
|
7382 IN_param_value = function_call_param_iterator.next(); |
|
7383 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7384 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7385 |
|
7386 if (typeid(*last_type_symbol) == typeid(wstring_type_name_c)) |
|
7387 { |
|
7388 |
|
7389 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
7390 return return_type_symbol; |
|
7391 |
|
7392 } |
|
7393 |
|
7394 ERROR; |
|
7395 } |
|
7396 |
|
7397 }/*function_wstring_to_int*/ |
|
7398 break; |
|
7399 |
|
7400 /**** |
|
7401 *STRING_TO_REAL |
|
7402 */ |
|
7403 case function_string_to_real : |
|
7404 { |
|
7405 symbol_c *last_type_symbol = NULL; |
|
7406 |
|
7407 { |
|
7408 identifier_c param_name("IN"); |
|
7409 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7410 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7411 |
|
7412 /* Get the value from a foo(<param_value>) style call */ |
|
7413 if (IN_param_value == NULL) |
|
7414 IN_param_value = function_call_param_iterator.next(); |
|
7415 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7416 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7417 |
|
7418 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7419 { |
|
7420 |
|
7421 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
7422 return return_type_symbol; |
|
7423 |
|
7424 } |
|
7425 |
|
7426 ERROR; |
|
7427 } |
|
7428 |
|
7429 }/*function_string_to_real*/ |
|
7430 break; |
|
7431 |
|
7432 /**** |
|
7433 *STRING_TO_SINT |
|
7434 */ |
|
7435 case function_string_to_sint : |
|
7436 { |
|
7437 symbol_c *last_type_symbol = NULL; |
|
7438 |
|
7439 { |
|
7440 identifier_c param_name("IN"); |
|
7441 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7442 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7443 |
|
7444 /* Get the value from a foo(<param_value>) style call */ |
|
7445 if (IN_param_value == NULL) |
|
7446 IN_param_value = function_call_param_iterator.next(); |
|
7447 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7448 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7449 |
|
7450 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7451 { |
|
7452 |
|
7453 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
7454 return return_type_symbol; |
|
7455 |
|
7456 } |
|
7457 |
|
7458 ERROR; |
|
7459 } |
|
7460 |
|
7461 }/*function_string_to_sint*/ |
|
7462 break; |
|
7463 |
|
7464 /**** |
|
7465 *STRING_TO_LINT |
|
7466 */ |
|
7467 case function_string_to_lint : |
|
7468 { |
|
7469 symbol_c *last_type_symbol = NULL; |
|
7470 |
|
7471 { |
|
7472 identifier_c param_name("IN"); |
|
7473 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7474 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7475 |
|
7476 /* Get the value from a foo(<param_value>) style call */ |
|
7477 if (IN_param_value == NULL) |
|
7478 IN_param_value = function_call_param_iterator.next(); |
|
7479 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7480 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7481 |
|
7482 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7483 { |
|
7484 |
|
7485 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
7486 return return_type_symbol; |
|
7487 |
|
7488 } |
|
7489 |
|
7490 ERROR; |
|
7491 } |
|
7492 |
|
7493 }/*function_string_to_lint*/ |
|
7494 break; |
|
7495 |
|
7496 /**** |
|
7497 *STRING_TO_DINT |
|
7498 */ |
|
7499 case function_string_to_dint : |
|
7500 { |
|
7501 symbol_c *last_type_symbol = NULL; |
|
7502 |
|
7503 { |
|
7504 identifier_c param_name("IN"); |
|
7505 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7506 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7507 |
|
7508 /* Get the value from a foo(<param_value>) style call */ |
|
7509 if (IN_param_value == NULL) |
|
7510 IN_param_value = function_call_param_iterator.next(); |
|
7511 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7512 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7513 |
|
7514 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7515 { |
|
7516 |
|
7517 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
7518 return return_type_symbol; |
|
7519 |
|
7520 } |
|
7521 |
|
7522 ERROR; |
|
7523 } |
|
7524 |
|
7525 }/*function_string_to_dint*/ |
|
7526 break; |
|
7527 |
|
7528 /**** |
|
7529 *STRING_TO_DATE |
|
7530 */ |
|
7531 case function_string_to_date : |
|
7532 { |
|
7533 symbol_c *last_type_symbol = NULL; |
|
7534 |
|
7535 { |
|
7536 identifier_c param_name("IN"); |
|
7537 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7538 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7539 |
|
7540 /* Get the value from a foo(<param_value>) style call */ |
|
7541 if (IN_param_value == NULL) |
|
7542 IN_param_value = function_call_param_iterator.next(); |
|
7543 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7544 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7545 |
|
7546 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7547 { |
|
7548 |
|
7549 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
7550 return return_type_symbol; |
|
7551 |
|
7552 } |
|
7553 |
|
7554 ERROR; |
|
7555 } |
|
7556 |
|
7557 }/*function_string_to_date*/ |
|
7558 break; |
|
7559 |
|
7560 /**** |
|
7561 *STRING_TO_DWORD |
|
7562 */ |
|
7563 case function_string_to_dword : |
|
7564 { |
|
7565 symbol_c *last_type_symbol = NULL; |
|
7566 |
|
7567 { |
|
7568 identifier_c param_name("IN"); |
|
7569 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7570 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7571 |
|
7572 /* Get the value from a foo(<param_value>) style call */ |
|
7573 if (IN_param_value == NULL) |
|
7574 IN_param_value = function_call_param_iterator.next(); |
|
7575 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7576 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7577 |
|
7578 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7579 { |
|
7580 |
|
7581 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
7582 return return_type_symbol; |
|
7583 |
|
7584 } |
|
7585 |
|
7586 ERROR; |
|
7587 } |
|
7588 |
|
7589 }/*function_string_to_dword*/ |
|
7590 break; |
|
7591 |
|
7592 /**** |
|
7593 *STRING_TO_DT |
|
7594 */ |
|
7595 case function_string_to_dt : |
|
7596 { |
|
7597 symbol_c *last_type_symbol = NULL; |
|
7598 |
|
7599 { |
|
7600 identifier_c param_name("IN"); |
|
7601 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7602 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7603 |
|
7604 /* Get the value from a foo(<param_value>) style call */ |
|
7605 if (IN_param_value == NULL) |
|
7606 IN_param_value = function_call_param_iterator.next(); |
|
7607 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7608 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7609 |
|
7610 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7611 { |
|
7612 |
|
7613 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
7614 return return_type_symbol; |
|
7615 |
|
7616 } |
|
7617 |
|
7618 ERROR; |
|
7619 } |
|
7620 |
|
7621 }/*function_string_to_dt*/ |
|
7622 break; |
|
7623 |
|
7624 /**** |
|
7625 *STRING_TO_TOD |
|
7626 */ |
|
7627 case function_string_to_tod : |
|
7628 { |
|
7629 symbol_c *last_type_symbol = NULL; |
|
7630 |
|
7631 { |
|
7632 identifier_c param_name("IN"); |
|
7633 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7634 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7635 |
|
7636 /* Get the value from a foo(<param_value>) style call */ |
|
7637 if (IN_param_value == NULL) |
|
7638 IN_param_value = function_call_param_iterator.next(); |
|
7639 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7640 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7641 |
|
7642 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7643 { |
|
7644 |
|
7645 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
7646 return return_type_symbol; |
|
7647 |
|
7648 } |
|
7649 |
|
7650 ERROR; |
|
7651 } |
|
7652 |
|
7653 }/*function_string_to_tod*/ |
|
7654 break; |
|
7655 |
|
7656 /**** |
|
7657 *STRING_TO_UDINT |
|
7658 */ |
|
7659 case function_string_to_udint : |
|
7660 { |
|
7661 symbol_c *last_type_symbol = NULL; |
|
7662 |
|
7663 { |
|
7664 identifier_c param_name("IN"); |
|
7665 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7666 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7667 |
|
7668 /* Get the value from a foo(<param_value>) style call */ |
|
7669 if (IN_param_value == NULL) |
|
7670 IN_param_value = function_call_param_iterator.next(); |
|
7671 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7672 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7673 |
|
7674 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7675 { |
|
7676 |
|
7677 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
7678 return return_type_symbol; |
|
7679 |
|
7680 } |
|
7681 |
|
7682 ERROR; |
|
7683 } |
|
7684 |
|
7685 }/*function_string_to_udint*/ |
|
7686 break; |
|
7687 |
|
7688 /**** |
|
7689 *STRING_TO_WORD |
|
7690 */ |
|
7691 case function_string_to_word : |
|
7692 { |
|
7693 symbol_c *last_type_symbol = NULL; |
|
7694 |
|
7695 { |
|
7696 identifier_c param_name("IN"); |
|
7697 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7698 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7699 |
|
7700 /* Get the value from a foo(<param_value>) style call */ |
|
7701 if (IN_param_value == NULL) |
|
7702 IN_param_value = function_call_param_iterator.next(); |
|
7703 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7704 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7705 |
|
7706 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7707 { |
|
7708 |
|
7709 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
7710 return return_type_symbol; |
|
7711 |
|
7712 } |
|
7713 |
|
7714 ERROR; |
|
7715 } |
|
7716 |
|
7717 }/*function_string_to_word*/ |
|
7718 break; |
|
7719 |
|
7720 /**** |
|
7721 *STRING_TO_WSTRING |
|
7722 */ |
|
7723 case function_string_to_wstring : |
|
7724 { |
|
7725 symbol_c *last_type_symbol = NULL; |
|
7726 |
|
7727 { |
|
7728 identifier_c param_name("IN"); |
|
7729 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7730 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7731 |
|
7732 /* Get the value from a foo(<param_value>) style call */ |
|
7733 if (IN_param_value == NULL) |
|
7734 IN_param_value = function_call_param_iterator.next(); |
|
7735 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7736 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7737 |
|
7738 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7739 { |
|
7740 |
|
7741 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
7742 return return_type_symbol; |
|
7743 |
|
7744 } |
|
7745 |
|
7746 ERROR; |
|
7747 } |
|
7748 |
|
7749 }/*function_string_to_wstring*/ |
|
7750 break; |
|
7751 |
|
7752 /**** |
|
7753 *STRING_TO_STRING |
|
7754 */ |
|
7755 case function_string_to_string : |
|
7756 { |
|
7757 symbol_c *last_type_symbol = NULL; |
|
7758 |
|
7759 { |
|
7760 identifier_c param_name("IN"); |
|
7761 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7762 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7763 |
|
7764 /* Get the value from a foo(<param_value>) style call */ |
|
7765 if (IN_param_value == NULL) |
|
7766 IN_param_value = function_call_param_iterator.next(); |
|
7767 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7768 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7769 |
|
7770 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7771 { |
|
7772 |
|
7773 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
7774 return return_type_symbol; |
|
7775 |
|
7776 } |
|
7777 |
|
7778 ERROR; |
|
7779 } |
|
7780 |
|
7781 }/*function_string_to_string*/ |
|
7782 break; |
|
7783 |
|
7784 /**** |
|
7785 *STRING_TO_LWORD |
|
7786 */ |
|
7787 case function_string_to_lword : |
|
7788 { |
|
7789 symbol_c *last_type_symbol = NULL; |
|
7790 |
|
7791 { |
|
7792 identifier_c param_name("IN"); |
|
7793 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7794 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7795 |
|
7796 /* Get the value from a foo(<param_value>) style call */ |
|
7797 if (IN_param_value == NULL) |
|
7798 IN_param_value = function_call_param_iterator.next(); |
|
7799 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7800 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7801 |
|
7802 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7803 { |
|
7804 |
|
7805 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
7806 return return_type_symbol; |
|
7807 |
|
7808 } |
|
7809 |
|
7810 ERROR; |
|
7811 } |
|
7812 |
|
7813 }/*function_string_to_lword*/ |
|
7814 break; |
|
7815 |
|
7816 /**** |
|
7817 *STRING_TO_UINT |
|
7818 */ |
|
7819 case function_string_to_uint : |
|
7820 { |
|
7821 symbol_c *last_type_symbol = NULL; |
|
7822 |
|
7823 { |
|
7824 identifier_c param_name("IN"); |
|
7825 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7826 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7827 |
|
7828 /* Get the value from a foo(<param_value>) style call */ |
|
7829 if (IN_param_value == NULL) |
|
7830 IN_param_value = function_call_param_iterator.next(); |
|
7831 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7832 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7833 |
|
7834 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7835 { |
|
7836 |
|
7837 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
7838 return return_type_symbol; |
|
7839 |
|
7840 } |
|
7841 |
|
7842 ERROR; |
|
7843 } |
|
7844 |
|
7845 }/*function_string_to_uint*/ |
|
7846 break; |
|
7847 |
|
7848 /**** |
|
7849 *STRING_TO_LREAL |
|
7850 */ |
|
7851 case function_string_to_lreal : |
|
7852 { |
|
7853 symbol_c *last_type_symbol = NULL; |
|
7854 |
|
7855 { |
|
7856 identifier_c param_name("IN"); |
|
7857 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7858 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7859 |
|
7860 /* Get the value from a foo(<param_value>) style call */ |
|
7861 if (IN_param_value == NULL) |
|
7862 IN_param_value = function_call_param_iterator.next(); |
|
7863 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7864 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7865 |
|
7866 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7867 { |
|
7868 |
|
7869 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
7870 return return_type_symbol; |
|
7871 |
|
7872 } |
|
7873 |
|
7874 ERROR; |
|
7875 } |
|
7876 |
|
7877 }/*function_string_to_lreal*/ |
|
7878 break; |
|
7879 |
|
7880 /**** |
|
7881 *STRING_TO_BYTE |
|
7882 */ |
|
7883 case function_string_to_byte : |
|
7884 { |
|
7885 symbol_c *last_type_symbol = NULL; |
|
7886 |
|
7887 { |
|
7888 identifier_c param_name("IN"); |
|
7889 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7890 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7891 |
|
7892 /* Get the value from a foo(<param_value>) style call */ |
|
7893 if (IN_param_value == NULL) |
|
7894 IN_param_value = function_call_param_iterator.next(); |
|
7895 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7896 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7897 |
|
7898 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7899 { |
|
7900 |
|
7901 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
7902 return return_type_symbol; |
|
7903 |
|
7904 } |
|
7905 |
|
7906 ERROR; |
|
7907 } |
|
7908 |
|
7909 }/*function_string_to_byte*/ |
|
7910 break; |
|
7911 |
|
7912 /**** |
|
7913 *STRING_TO_USINT |
|
7914 */ |
|
7915 case function_string_to_usint : |
|
7916 { |
|
7917 symbol_c *last_type_symbol = NULL; |
|
7918 |
|
7919 { |
|
7920 identifier_c param_name("IN"); |
|
7921 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7922 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7923 |
|
7924 /* Get the value from a foo(<param_value>) style call */ |
|
7925 if (IN_param_value == NULL) |
|
7926 IN_param_value = function_call_param_iterator.next(); |
|
7927 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7928 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7929 |
|
7930 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7931 { |
|
7932 |
|
7933 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
7934 return return_type_symbol; |
|
7935 |
|
7936 } |
|
7937 |
|
7938 ERROR; |
|
7939 } |
|
7940 |
|
7941 }/*function_string_to_usint*/ |
|
7942 break; |
|
7943 |
|
7944 /**** |
|
7945 *STRING_TO_ULINT |
|
7946 */ |
|
7947 case function_string_to_ulint : |
|
7948 { |
|
7949 symbol_c *last_type_symbol = NULL; |
|
7950 |
|
7951 { |
|
7952 identifier_c param_name("IN"); |
|
7953 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7954 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7955 |
|
7956 /* Get the value from a foo(<param_value>) style call */ |
|
7957 if (IN_param_value == NULL) |
|
7958 IN_param_value = function_call_param_iterator.next(); |
|
7959 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7960 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7961 |
|
7962 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7963 { |
|
7964 |
|
7965 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
7966 return return_type_symbol; |
|
7967 |
|
7968 } |
|
7969 |
|
7970 ERROR; |
|
7971 } |
|
7972 |
|
7973 }/*function_string_to_ulint*/ |
|
7974 break; |
|
7975 |
|
7976 /**** |
|
7977 *STRING_TO_BOOL |
|
7978 */ |
|
7979 case function_string_to_bool : |
|
7980 { |
|
7981 symbol_c *last_type_symbol = NULL; |
|
7982 |
|
7983 { |
|
7984 identifier_c param_name("IN"); |
|
7985 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7986 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
7987 |
|
7988 /* Get the value from a foo(<param_value>) style call */ |
|
7989 if (IN_param_value == NULL) |
|
7990 IN_param_value = function_call_param_iterator.next(); |
|
7991 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
7992 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
7993 |
|
7994 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
7995 { |
|
7996 |
|
7997 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
7998 return return_type_symbol; |
|
7999 |
|
8000 } |
|
8001 |
|
8002 ERROR; |
|
8003 } |
|
8004 |
|
8005 }/*function_string_to_bool*/ |
|
8006 break; |
|
8007 |
|
8008 /**** |
|
8009 *STRING_TO_TIME |
|
8010 */ |
|
8011 case function_string_to_time : |
|
8012 { |
|
8013 symbol_c *last_type_symbol = NULL; |
|
8014 |
|
8015 { |
|
8016 identifier_c param_name("IN"); |
|
8017 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8018 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8019 |
|
8020 /* Get the value from a foo(<param_value>) style call */ |
|
8021 if (IN_param_value == NULL) |
|
8022 IN_param_value = function_call_param_iterator.next(); |
|
8023 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8024 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8025 |
|
8026 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
8027 { |
|
8028 |
|
8029 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
8030 return return_type_symbol; |
|
8031 |
|
8032 } |
|
8033 |
|
8034 ERROR; |
|
8035 } |
|
8036 |
|
8037 }/*function_string_to_time*/ |
|
8038 break; |
|
8039 |
|
8040 /**** |
|
8041 *STRING_TO_INT |
|
8042 */ |
|
8043 case function_string_to_int : |
|
8044 { |
|
8045 symbol_c *last_type_symbol = NULL; |
|
8046 |
|
8047 { |
|
8048 identifier_c param_name("IN"); |
|
8049 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8050 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8051 |
|
8052 /* Get the value from a foo(<param_value>) style call */ |
|
8053 if (IN_param_value == NULL) |
|
8054 IN_param_value = function_call_param_iterator.next(); |
|
8055 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8056 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8057 |
|
8058 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
8059 { |
|
8060 |
|
8061 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8062 return return_type_symbol; |
|
8063 |
|
8064 } |
|
8065 |
|
8066 ERROR; |
|
8067 } |
|
8068 |
|
8069 }/*function_string_to_int*/ |
|
8070 break; |
|
8071 |
|
8072 /**** |
|
8073 *LWORD_TO_REAL |
|
8074 */ |
|
8075 case function_lword_to_real : |
|
8076 { |
|
8077 symbol_c *last_type_symbol = NULL; |
|
8078 |
|
8079 { |
|
8080 identifier_c param_name("IN"); |
|
8081 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8082 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8083 |
|
8084 /* Get the value from a foo(<param_value>) style call */ |
|
8085 if (IN_param_value == NULL) |
|
8086 IN_param_value = function_call_param_iterator.next(); |
|
8087 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8088 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8089 |
|
8090 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8091 { |
|
8092 |
|
8093 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
8094 return return_type_symbol; |
|
8095 |
|
8096 } |
|
8097 |
|
8098 ERROR; |
|
8099 } |
|
8100 |
|
8101 }/*function_lword_to_real*/ |
|
8102 break; |
|
8103 |
|
8104 /**** |
|
8105 *LWORD_TO_SINT |
|
8106 */ |
|
8107 case function_lword_to_sint : |
|
8108 { |
|
8109 symbol_c *last_type_symbol = NULL; |
|
8110 |
|
8111 { |
|
8112 identifier_c param_name("IN"); |
|
8113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8115 |
|
8116 /* Get the value from a foo(<param_value>) style call */ |
|
8117 if (IN_param_value == NULL) |
|
8118 IN_param_value = function_call_param_iterator.next(); |
|
8119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8121 |
|
8122 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8123 { |
|
8124 |
|
8125 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8126 return return_type_symbol; |
|
8127 |
|
8128 } |
|
8129 |
|
8130 ERROR; |
|
8131 } |
|
8132 |
|
8133 }/*function_lword_to_sint*/ |
|
8134 break; |
|
8135 |
|
8136 /**** |
|
8137 *LWORD_TO_LINT |
|
8138 */ |
|
8139 case function_lword_to_lint : |
|
8140 { |
|
8141 symbol_c *last_type_symbol = NULL; |
|
8142 |
|
8143 { |
|
8144 identifier_c param_name("IN"); |
|
8145 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8146 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8147 |
|
8148 /* Get the value from a foo(<param_value>) style call */ |
|
8149 if (IN_param_value == NULL) |
|
8150 IN_param_value = function_call_param_iterator.next(); |
|
8151 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8152 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8153 |
|
8154 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8155 { |
|
8156 |
|
8157 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8158 return return_type_symbol; |
|
8159 |
|
8160 } |
|
8161 |
|
8162 ERROR; |
|
8163 } |
|
8164 |
|
8165 }/*function_lword_to_lint*/ |
|
8166 break; |
|
8167 |
|
8168 /**** |
|
8169 *LWORD_TO_DINT |
|
8170 */ |
|
8171 case function_lword_to_dint : |
|
8172 { |
|
8173 symbol_c *last_type_symbol = NULL; |
|
8174 |
|
8175 { |
|
8176 identifier_c param_name("IN"); |
|
8177 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8178 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8179 |
|
8180 /* Get the value from a foo(<param_value>) style call */ |
|
8181 if (IN_param_value == NULL) |
|
8182 IN_param_value = function_call_param_iterator.next(); |
|
8183 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8184 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8185 |
|
8186 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8187 { |
|
8188 |
|
8189 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8190 return return_type_symbol; |
|
8191 |
|
8192 } |
|
8193 |
|
8194 ERROR; |
|
8195 } |
|
8196 |
|
8197 }/*function_lword_to_dint*/ |
|
8198 break; |
|
8199 |
|
8200 /**** |
|
8201 *LWORD_TO_DATE |
|
8202 */ |
|
8203 case function_lword_to_date : |
|
8204 { |
|
8205 symbol_c *last_type_symbol = NULL; |
|
8206 |
|
8207 { |
|
8208 identifier_c param_name("IN"); |
|
8209 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8210 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8211 |
|
8212 /* Get the value from a foo(<param_value>) style call */ |
|
8213 if (IN_param_value == NULL) |
|
8214 IN_param_value = function_call_param_iterator.next(); |
|
8215 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8216 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8217 |
|
8218 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8219 { |
|
8220 |
|
8221 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
8222 return return_type_symbol; |
|
8223 |
|
8224 } |
|
8225 |
|
8226 ERROR; |
|
8227 } |
|
8228 |
|
8229 }/*function_lword_to_date*/ |
|
8230 break; |
|
8231 |
|
8232 /**** |
|
8233 *LWORD_TO_DWORD |
|
8234 */ |
|
8235 case function_lword_to_dword : |
|
8236 { |
|
8237 symbol_c *last_type_symbol = NULL; |
|
8238 |
|
8239 { |
|
8240 identifier_c param_name("IN"); |
|
8241 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8242 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8243 |
|
8244 /* Get the value from a foo(<param_value>) style call */ |
|
8245 if (IN_param_value == NULL) |
|
8246 IN_param_value = function_call_param_iterator.next(); |
|
8247 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8248 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8249 |
|
8250 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8251 { |
|
8252 |
|
8253 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8254 return return_type_symbol; |
|
8255 |
|
8256 } |
|
8257 |
|
8258 ERROR; |
|
8259 } |
|
8260 |
|
8261 }/*function_lword_to_dword*/ |
|
8262 break; |
|
8263 |
|
8264 /**** |
|
8265 *LWORD_TO_DT |
|
8266 */ |
|
8267 case function_lword_to_dt : |
|
8268 { |
|
8269 symbol_c *last_type_symbol = NULL; |
|
8270 |
|
8271 { |
|
8272 identifier_c param_name("IN"); |
|
8273 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8274 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8275 |
|
8276 /* Get the value from a foo(<param_value>) style call */ |
|
8277 if (IN_param_value == NULL) |
|
8278 IN_param_value = function_call_param_iterator.next(); |
|
8279 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8280 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8281 |
|
8282 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8283 { |
|
8284 |
|
8285 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
8286 return return_type_symbol; |
|
8287 |
|
8288 } |
|
8289 |
|
8290 ERROR; |
|
8291 } |
|
8292 |
|
8293 }/*function_lword_to_dt*/ |
|
8294 break; |
|
8295 |
|
8296 /**** |
|
8297 *LWORD_TO_TOD |
|
8298 */ |
|
8299 case function_lword_to_tod : |
|
8300 { |
|
8301 symbol_c *last_type_symbol = NULL; |
|
8302 |
|
8303 { |
|
8304 identifier_c param_name("IN"); |
|
8305 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8306 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8307 |
|
8308 /* Get the value from a foo(<param_value>) style call */ |
|
8309 if (IN_param_value == NULL) |
|
8310 IN_param_value = function_call_param_iterator.next(); |
|
8311 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8312 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8313 |
|
8314 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8315 { |
|
8316 |
|
8317 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
8318 return return_type_symbol; |
|
8319 |
|
8320 } |
|
8321 |
|
8322 ERROR; |
|
8323 } |
|
8324 |
|
8325 }/*function_lword_to_tod*/ |
|
8326 break; |
|
8327 |
|
8328 /**** |
|
8329 *LWORD_TO_UDINT |
|
8330 */ |
|
8331 case function_lword_to_udint : |
|
8332 { |
|
8333 symbol_c *last_type_symbol = NULL; |
|
8334 |
|
8335 { |
|
8336 identifier_c param_name("IN"); |
|
8337 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8338 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8339 |
|
8340 /* Get the value from a foo(<param_value>) style call */ |
|
8341 if (IN_param_value == NULL) |
|
8342 IN_param_value = function_call_param_iterator.next(); |
|
8343 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8344 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8345 |
|
8346 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8347 { |
|
8348 |
|
8349 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
8350 return return_type_symbol; |
|
8351 |
|
8352 } |
|
8353 |
|
8354 ERROR; |
|
8355 } |
|
8356 |
|
8357 }/*function_lword_to_udint*/ |
|
8358 break; |
|
8359 |
|
8360 /**** |
|
8361 *LWORD_TO_WORD |
|
8362 */ |
|
8363 case function_lword_to_word : |
|
8364 { |
|
8365 symbol_c *last_type_symbol = NULL; |
|
8366 |
|
8367 { |
|
8368 identifier_c param_name("IN"); |
|
8369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8370 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8371 |
|
8372 /* Get the value from a foo(<param_value>) style call */ |
|
8373 if (IN_param_value == NULL) |
|
8374 IN_param_value = function_call_param_iterator.next(); |
|
8375 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8376 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8377 |
|
8378 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8379 { |
|
8380 |
|
8381 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
8382 return return_type_symbol; |
|
8383 |
|
8384 } |
|
8385 |
|
8386 ERROR; |
|
8387 } |
|
8388 |
|
8389 }/*function_lword_to_word*/ |
|
8390 break; |
|
8391 |
|
8392 /**** |
|
8393 *LWORD_TO_WSTRING |
|
8394 */ |
|
8395 case function_lword_to_wstring : |
|
8396 { |
|
8397 symbol_c *last_type_symbol = NULL; |
|
8398 |
|
8399 { |
|
8400 identifier_c param_name("IN"); |
|
8401 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8402 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8403 |
|
8404 /* Get the value from a foo(<param_value>) style call */ |
|
8405 if (IN_param_value == NULL) |
|
8406 IN_param_value = function_call_param_iterator.next(); |
|
8407 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8408 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8409 |
|
8410 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8411 { |
|
8412 |
|
8413 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
8414 return return_type_symbol; |
|
8415 |
|
8416 } |
|
8417 |
|
8418 ERROR; |
|
8419 } |
|
8420 |
|
8421 }/*function_lword_to_wstring*/ |
|
8422 break; |
|
8423 |
|
8424 /**** |
|
8425 *LWORD_TO_STRING |
|
8426 */ |
|
8427 case function_lword_to_string : |
|
8428 { |
|
8429 symbol_c *last_type_symbol = NULL; |
|
8430 |
|
8431 { |
|
8432 identifier_c param_name("IN"); |
|
8433 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8434 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8435 |
|
8436 /* Get the value from a foo(<param_value>) style call */ |
|
8437 if (IN_param_value == NULL) |
|
8438 IN_param_value = function_call_param_iterator.next(); |
|
8439 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8440 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8441 |
|
8442 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8443 { |
|
8444 |
|
8445 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
8446 return return_type_symbol; |
|
8447 |
|
8448 } |
|
8449 |
|
8450 ERROR; |
|
8451 } |
|
8452 |
|
8453 }/*function_lword_to_string*/ |
|
8454 break; |
|
8455 |
|
8456 /**** |
|
8457 *LWORD_TO_LWORD |
|
8458 */ |
|
8459 case function_lword_to_lword : |
|
8460 { |
|
8461 symbol_c *last_type_symbol = NULL; |
|
8462 |
|
8463 { |
|
8464 identifier_c param_name("IN"); |
|
8465 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8466 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8467 |
|
8468 /* Get the value from a foo(<param_value>) style call */ |
|
8469 if (IN_param_value == NULL) |
|
8470 IN_param_value = function_call_param_iterator.next(); |
|
8471 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8472 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8473 |
|
8474 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8475 { |
|
8476 |
|
8477 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8478 return return_type_symbol; |
|
8479 |
|
8480 } |
|
8481 |
|
8482 ERROR; |
|
8483 } |
|
8484 |
|
8485 }/*function_lword_to_lword*/ |
|
8486 break; |
|
8487 |
|
8488 /**** |
|
8489 *LWORD_TO_UINT |
|
8490 */ |
|
8491 case function_lword_to_uint : |
|
8492 { |
|
8493 symbol_c *last_type_symbol = NULL; |
|
8494 |
|
8495 { |
|
8496 identifier_c param_name("IN"); |
|
8497 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8498 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8499 |
|
8500 /* Get the value from a foo(<param_value>) style call */ |
|
8501 if (IN_param_value == NULL) |
|
8502 IN_param_value = function_call_param_iterator.next(); |
|
8503 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8504 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8505 |
|
8506 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8507 { |
|
8508 |
|
8509 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
8510 return return_type_symbol; |
|
8511 |
|
8512 } |
|
8513 |
|
8514 ERROR; |
|
8515 } |
|
8516 |
|
8517 }/*function_lword_to_uint*/ |
|
8518 break; |
|
8519 |
|
8520 /**** |
|
8521 *LWORD_TO_LREAL |
|
8522 */ |
|
8523 case function_lword_to_lreal : |
|
8524 { |
|
8525 symbol_c *last_type_symbol = NULL; |
|
8526 |
|
8527 { |
|
8528 identifier_c param_name("IN"); |
|
8529 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8530 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8531 |
|
8532 /* Get the value from a foo(<param_value>) style call */ |
|
8533 if (IN_param_value == NULL) |
|
8534 IN_param_value = function_call_param_iterator.next(); |
|
8535 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8536 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8537 |
|
8538 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8539 { |
|
8540 |
|
8541 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
8542 return return_type_symbol; |
|
8543 |
|
8544 } |
|
8545 |
|
8546 ERROR; |
|
8547 } |
|
8548 |
|
8549 }/*function_lword_to_lreal*/ |
|
8550 break; |
|
8551 |
|
8552 /**** |
|
8553 *LWORD_TO_BYTE |
|
8554 */ |
|
8555 case function_lword_to_byte : |
|
8556 { |
|
8557 symbol_c *last_type_symbol = NULL; |
|
8558 |
|
8559 { |
|
8560 identifier_c param_name("IN"); |
|
8561 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8562 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8563 |
|
8564 /* Get the value from a foo(<param_value>) style call */ |
|
8565 if (IN_param_value == NULL) |
|
8566 IN_param_value = function_call_param_iterator.next(); |
|
8567 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8568 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8569 |
|
8570 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8571 { |
|
8572 |
|
8573 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
8574 return return_type_symbol; |
|
8575 |
|
8576 } |
|
8577 |
|
8578 ERROR; |
|
8579 } |
|
8580 |
|
8581 }/*function_lword_to_byte*/ |
|
8582 break; |
|
8583 |
|
8584 /**** |
|
8585 *LWORD_TO_USINT |
|
8586 */ |
|
8587 case function_lword_to_usint : |
|
8588 { |
|
8589 symbol_c *last_type_symbol = NULL; |
|
8590 |
|
8591 { |
|
8592 identifier_c param_name("IN"); |
|
8593 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8594 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8595 |
|
8596 /* Get the value from a foo(<param_value>) style call */ |
|
8597 if (IN_param_value == NULL) |
|
8598 IN_param_value = function_call_param_iterator.next(); |
|
8599 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8601 |
|
8602 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8603 { |
|
8604 |
|
8605 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8606 return return_type_symbol; |
|
8607 |
|
8608 } |
|
8609 |
|
8610 ERROR; |
|
8611 } |
|
8612 |
|
8613 }/*function_lword_to_usint*/ |
|
8614 break; |
|
8615 |
|
8616 /**** |
|
8617 *LWORD_TO_ULINT |
|
8618 */ |
|
8619 case function_lword_to_ulint : |
|
8620 { |
|
8621 symbol_c *last_type_symbol = NULL; |
|
8622 |
|
8623 { |
|
8624 identifier_c param_name("IN"); |
|
8625 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8626 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8627 |
|
8628 /* Get the value from a foo(<param_value>) style call */ |
|
8629 if (IN_param_value == NULL) |
|
8630 IN_param_value = function_call_param_iterator.next(); |
|
8631 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8632 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8633 |
|
8634 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8635 { |
|
8636 |
|
8637 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
8638 return return_type_symbol; |
|
8639 |
|
8640 } |
|
8641 |
|
8642 ERROR; |
|
8643 } |
|
8644 |
|
8645 }/*function_lword_to_ulint*/ |
|
8646 break; |
|
8647 |
|
8648 /**** |
|
8649 *LWORD_TO_BOOL |
|
8650 */ |
|
8651 case function_lword_to_bool : |
|
8652 { |
|
8653 symbol_c *last_type_symbol = NULL; |
|
8654 |
|
8655 { |
|
8656 identifier_c param_name("IN"); |
|
8657 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8658 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8659 |
|
8660 /* Get the value from a foo(<param_value>) style call */ |
|
8661 if (IN_param_value == NULL) |
|
8662 IN_param_value = function_call_param_iterator.next(); |
|
8663 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8664 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8665 |
|
8666 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8667 { |
|
8668 |
|
8669 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
8670 return return_type_symbol; |
|
8671 |
|
8672 } |
|
8673 |
|
8674 ERROR; |
|
8675 } |
|
8676 |
|
8677 }/*function_lword_to_bool*/ |
|
8678 break; |
|
8679 |
|
8680 /**** |
|
8681 *LWORD_TO_TIME |
|
8682 */ |
|
8683 case function_lword_to_time : |
|
8684 { |
|
8685 symbol_c *last_type_symbol = NULL; |
|
8686 |
|
8687 { |
|
8688 identifier_c param_name("IN"); |
|
8689 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8690 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8691 |
|
8692 /* Get the value from a foo(<param_value>) style call */ |
|
8693 if (IN_param_value == NULL) |
|
8694 IN_param_value = function_call_param_iterator.next(); |
|
8695 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8696 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8697 |
|
8698 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8699 { |
|
8700 |
|
8701 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
8702 return return_type_symbol; |
|
8703 |
|
8704 } |
|
8705 |
|
8706 ERROR; |
|
8707 } |
|
8708 |
|
8709 }/*function_lword_to_time*/ |
|
8710 break; |
|
8711 |
|
8712 /**** |
|
8713 *LWORD_TO_INT |
|
8714 */ |
|
8715 case function_lword_to_int : |
|
8716 { |
|
8717 symbol_c *last_type_symbol = NULL; |
|
8718 |
|
8719 { |
|
8720 identifier_c param_name("IN"); |
|
8721 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8722 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8723 |
|
8724 /* Get the value from a foo(<param_value>) style call */ |
|
8725 if (IN_param_value == NULL) |
|
8726 IN_param_value = function_call_param_iterator.next(); |
|
8727 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8728 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8729 |
|
8730 if (typeid(*last_type_symbol) == typeid(lword_type_name_c)) |
|
8731 { |
|
8732 |
|
8733 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8734 return return_type_symbol; |
|
8735 |
|
8736 } |
|
8737 |
|
8738 ERROR; |
|
8739 } |
|
8740 |
|
8741 }/*function_lword_to_int*/ |
|
8742 break; |
|
8743 |
|
8744 /**** |
|
8745 *UINT_TO_REAL |
|
8746 */ |
|
8747 case function_uint_to_real : |
|
8748 { |
|
8749 symbol_c *last_type_symbol = NULL; |
|
8750 |
|
8751 { |
|
8752 identifier_c param_name("IN"); |
|
8753 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8754 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8755 |
|
8756 /* Get the value from a foo(<param_value>) style call */ |
|
8757 if (IN_param_value == NULL) |
|
8758 IN_param_value = function_call_param_iterator.next(); |
|
8759 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8760 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8761 |
|
8762 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8763 { |
|
8764 |
|
8765 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
8766 return return_type_symbol; |
|
8767 |
|
8768 } |
|
8769 |
|
8770 ERROR; |
|
8771 } |
|
8772 |
|
8773 }/*function_uint_to_real*/ |
|
8774 break; |
|
8775 |
|
8776 /**** |
|
8777 *UINT_TO_SINT |
|
8778 */ |
|
8779 case function_uint_to_sint : |
|
8780 { |
|
8781 symbol_c *last_type_symbol = NULL; |
|
8782 |
|
8783 { |
|
8784 identifier_c param_name("IN"); |
|
8785 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8786 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8787 |
|
8788 /* Get the value from a foo(<param_value>) style call */ |
|
8789 if (IN_param_value == NULL) |
|
8790 IN_param_value = function_call_param_iterator.next(); |
|
8791 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8792 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8793 |
|
8794 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8795 { |
|
8796 |
|
8797 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8798 return return_type_symbol; |
|
8799 |
|
8800 } |
|
8801 |
|
8802 ERROR; |
|
8803 } |
|
8804 |
|
8805 }/*function_uint_to_sint*/ |
|
8806 break; |
|
8807 |
|
8808 /**** |
|
8809 *UINT_TO_LINT |
|
8810 */ |
|
8811 case function_uint_to_lint : |
|
8812 { |
|
8813 symbol_c *last_type_symbol = NULL; |
|
8814 |
|
8815 { |
|
8816 identifier_c param_name("IN"); |
|
8817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8819 |
|
8820 /* Get the value from a foo(<param_value>) style call */ |
|
8821 if (IN_param_value == NULL) |
|
8822 IN_param_value = function_call_param_iterator.next(); |
|
8823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8825 |
|
8826 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8827 { |
|
8828 |
|
8829 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8830 return return_type_symbol; |
|
8831 |
|
8832 } |
|
8833 |
|
8834 ERROR; |
|
8835 } |
|
8836 |
|
8837 }/*function_uint_to_lint*/ |
|
8838 break; |
|
8839 |
|
8840 /**** |
|
8841 *UINT_TO_DINT |
|
8842 */ |
|
8843 case function_uint_to_dint : |
|
8844 { |
|
8845 symbol_c *last_type_symbol = NULL; |
|
8846 |
|
8847 { |
|
8848 identifier_c param_name("IN"); |
|
8849 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8850 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8851 |
|
8852 /* Get the value from a foo(<param_value>) style call */ |
|
8853 if (IN_param_value == NULL) |
|
8854 IN_param_value = function_call_param_iterator.next(); |
|
8855 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8856 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8857 |
|
8858 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8859 { |
|
8860 |
|
8861 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8862 return return_type_symbol; |
|
8863 |
|
8864 } |
|
8865 |
|
8866 ERROR; |
|
8867 } |
|
8868 |
|
8869 }/*function_uint_to_dint*/ |
|
8870 break; |
|
8871 |
|
8872 /**** |
|
8873 *UINT_TO_DATE |
|
8874 */ |
|
8875 case function_uint_to_date : |
|
8876 { |
|
8877 symbol_c *last_type_symbol = NULL; |
|
8878 |
|
8879 { |
|
8880 identifier_c param_name("IN"); |
|
8881 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8882 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8883 |
|
8884 /* Get the value from a foo(<param_value>) style call */ |
|
8885 if (IN_param_value == NULL) |
|
8886 IN_param_value = function_call_param_iterator.next(); |
|
8887 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8888 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8889 |
|
8890 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8891 { |
|
8892 |
|
8893 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
8894 return return_type_symbol; |
|
8895 |
|
8896 } |
|
8897 |
|
8898 ERROR; |
|
8899 } |
|
8900 |
|
8901 }/*function_uint_to_date*/ |
|
8902 break; |
|
8903 |
|
8904 /**** |
|
8905 *UINT_TO_DWORD |
|
8906 */ |
|
8907 case function_uint_to_dword : |
|
8908 { |
|
8909 symbol_c *last_type_symbol = NULL; |
|
8910 |
|
8911 { |
|
8912 identifier_c param_name("IN"); |
|
8913 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8914 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8915 |
|
8916 /* Get the value from a foo(<param_value>) style call */ |
|
8917 if (IN_param_value == NULL) |
|
8918 IN_param_value = function_call_param_iterator.next(); |
|
8919 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8920 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8921 |
|
8922 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8923 { |
|
8924 |
|
8925 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8926 return return_type_symbol; |
|
8927 |
|
8928 } |
|
8929 |
|
8930 ERROR; |
|
8931 } |
|
8932 |
|
8933 }/*function_uint_to_dword*/ |
|
8934 break; |
|
8935 |
|
8936 /**** |
|
8937 *UINT_TO_DT |
|
8938 */ |
|
8939 case function_uint_to_dt : |
|
8940 { |
|
8941 symbol_c *last_type_symbol = NULL; |
|
8942 |
|
8943 { |
|
8944 identifier_c param_name("IN"); |
|
8945 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8946 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8947 |
|
8948 /* Get the value from a foo(<param_value>) style call */ |
|
8949 if (IN_param_value == NULL) |
|
8950 IN_param_value = function_call_param_iterator.next(); |
|
8951 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8952 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8953 |
|
8954 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8955 { |
|
8956 |
|
8957 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
8958 return return_type_symbol; |
|
8959 |
|
8960 } |
|
8961 |
|
8962 ERROR; |
|
8963 } |
|
8964 |
|
8965 }/*function_uint_to_dt*/ |
|
8966 break; |
|
8967 |
|
8968 /**** |
|
8969 *UINT_TO_TOD |
|
8970 */ |
|
8971 case function_uint_to_tod : |
|
8972 { |
|
8973 symbol_c *last_type_symbol = NULL; |
|
8974 |
|
8975 { |
|
8976 identifier_c param_name("IN"); |
|
8977 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8978 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
8979 |
|
8980 /* Get the value from a foo(<param_value>) style call */ |
|
8981 if (IN_param_value == NULL) |
|
8982 IN_param_value = function_call_param_iterator.next(); |
|
8983 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
8984 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
8985 |
|
8986 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
8987 { |
|
8988 |
|
8989 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
8990 return return_type_symbol; |
|
8991 |
|
8992 } |
|
8993 |
|
8994 ERROR; |
|
8995 } |
|
8996 |
|
8997 }/*function_uint_to_tod*/ |
|
8998 break; |
|
8999 |
|
9000 /**** |
|
9001 *UINT_TO_UDINT |
|
9002 */ |
|
9003 case function_uint_to_udint : |
|
9004 { |
|
9005 symbol_c *last_type_symbol = NULL; |
|
9006 |
|
9007 { |
|
9008 identifier_c param_name("IN"); |
|
9009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9010 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9011 |
|
9012 /* Get the value from a foo(<param_value>) style call */ |
|
9013 if (IN_param_value == NULL) |
|
9014 IN_param_value = function_call_param_iterator.next(); |
|
9015 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9016 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9017 |
|
9018 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9019 { |
|
9020 |
|
9021 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9022 return return_type_symbol; |
|
9023 |
|
9024 } |
|
9025 |
|
9026 ERROR; |
|
9027 } |
|
9028 |
|
9029 }/*function_uint_to_udint*/ |
|
9030 break; |
|
9031 |
|
9032 /**** |
|
9033 *UINT_TO_WORD |
|
9034 */ |
|
9035 case function_uint_to_word : |
|
9036 { |
|
9037 symbol_c *last_type_symbol = NULL; |
|
9038 |
|
9039 { |
|
9040 identifier_c param_name("IN"); |
|
9041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9042 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9043 |
|
9044 /* Get the value from a foo(<param_value>) style call */ |
|
9045 if (IN_param_value == NULL) |
|
9046 IN_param_value = function_call_param_iterator.next(); |
|
9047 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9048 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9049 |
|
9050 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9051 { |
|
9052 |
|
9053 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9054 return return_type_symbol; |
|
9055 |
|
9056 } |
|
9057 |
|
9058 ERROR; |
|
9059 } |
|
9060 |
|
9061 }/*function_uint_to_word*/ |
|
9062 break; |
|
9063 |
|
9064 /**** |
|
9065 *UINT_TO_WSTRING |
|
9066 */ |
|
9067 case function_uint_to_wstring : |
|
9068 { |
|
9069 symbol_c *last_type_symbol = NULL; |
|
9070 |
|
9071 { |
|
9072 identifier_c param_name("IN"); |
|
9073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9074 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9075 |
|
9076 /* Get the value from a foo(<param_value>) style call */ |
|
9077 if (IN_param_value == NULL) |
|
9078 IN_param_value = function_call_param_iterator.next(); |
|
9079 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9080 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9081 |
|
9082 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9083 { |
|
9084 |
|
9085 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
9086 return return_type_symbol; |
|
9087 |
|
9088 } |
|
9089 |
|
9090 ERROR; |
|
9091 } |
|
9092 |
|
9093 }/*function_uint_to_wstring*/ |
|
9094 break; |
|
9095 |
|
9096 /**** |
|
9097 *UINT_TO_STRING |
|
9098 */ |
|
9099 case function_uint_to_string : |
|
9100 { |
|
9101 symbol_c *last_type_symbol = NULL; |
|
9102 |
|
9103 { |
|
9104 identifier_c param_name("IN"); |
|
9105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9106 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9107 |
|
9108 /* Get the value from a foo(<param_value>) style call */ |
|
9109 if (IN_param_value == NULL) |
|
9110 IN_param_value = function_call_param_iterator.next(); |
|
9111 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9112 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9113 |
|
9114 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9115 { |
|
9116 |
|
9117 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9118 return return_type_symbol; |
|
9119 |
|
9120 } |
|
9121 |
|
9122 ERROR; |
|
9123 } |
|
9124 |
|
9125 }/*function_uint_to_string*/ |
|
9126 break; |
|
9127 |
|
9128 /**** |
|
9129 *UINT_TO_LWORD |
|
9130 */ |
|
9131 case function_uint_to_lword : |
|
9132 { |
|
9133 symbol_c *last_type_symbol = NULL; |
|
9134 |
|
9135 { |
|
9136 identifier_c param_name("IN"); |
|
9137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9138 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9139 |
|
9140 /* Get the value from a foo(<param_value>) style call */ |
|
9141 if (IN_param_value == NULL) |
|
9142 IN_param_value = function_call_param_iterator.next(); |
|
9143 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9144 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9145 |
|
9146 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9147 { |
|
9148 |
|
9149 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9150 return return_type_symbol; |
|
9151 |
|
9152 } |
|
9153 |
|
9154 ERROR; |
|
9155 } |
|
9156 |
|
9157 }/*function_uint_to_lword*/ |
|
9158 break; |
|
9159 |
|
9160 /**** |
|
9161 *UINT_TO_UINT |
|
9162 */ |
|
9163 case function_uint_to_uint : |
|
9164 { |
|
9165 symbol_c *last_type_symbol = NULL; |
|
9166 |
|
9167 { |
|
9168 identifier_c param_name("IN"); |
|
9169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9170 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9171 |
|
9172 /* Get the value from a foo(<param_value>) style call */ |
|
9173 if (IN_param_value == NULL) |
|
9174 IN_param_value = function_call_param_iterator.next(); |
|
9175 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9176 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9177 |
|
9178 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9179 { |
|
9180 |
|
9181 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9182 return return_type_symbol; |
|
9183 |
|
9184 } |
|
9185 |
|
9186 ERROR; |
|
9187 } |
|
9188 |
|
9189 }/*function_uint_to_uint*/ |
|
9190 break; |
|
9191 |
|
9192 /**** |
|
9193 *UINT_TO_LREAL |
|
9194 */ |
|
9195 case function_uint_to_lreal : |
|
9196 { |
|
9197 symbol_c *last_type_symbol = NULL; |
|
9198 |
|
9199 { |
|
9200 identifier_c param_name("IN"); |
|
9201 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9202 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9203 |
|
9204 /* Get the value from a foo(<param_value>) style call */ |
|
9205 if (IN_param_value == NULL) |
|
9206 IN_param_value = function_call_param_iterator.next(); |
|
9207 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9208 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9209 |
|
9210 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9211 { |
|
9212 |
|
9213 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9214 return return_type_symbol; |
|
9215 |
|
9216 } |
|
9217 |
|
9218 ERROR; |
|
9219 } |
|
9220 |
|
9221 }/*function_uint_to_lreal*/ |
|
9222 break; |
|
9223 |
|
9224 /**** |
|
9225 *UINT_TO_BYTE |
|
9226 */ |
|
9227 case function_uint_to_byte : |
|
9228 { |
|
9229 symbol_c *last_type_symbol = NULL; |
|
9230 |
|
9231 { |
|
9232 identifier_c param_name("IN"); |
|
9233 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9234 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9235 |
|
9236 /* Get the value from a foo(<param_value>) style call */ |
|
9237 if (IN_param_value == NULL) |
|
9238 IN_param_value = function_call_param_iterator.next(); |
|
9239 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9240 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9241 |
|
9242 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9243 { |
|
9244 |
|
9245 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9246 return return_type_symbol; |
|
9247 |
|
9248 } |
|
9249 |
|
9250 ERROR; |
|
9251 } |
|
9252 |
|
9253 }/*function_uint_to_byte*/ |
|
9254 break; |
|
9255 |
|
9256 /**** |
|
9257 *UINT_TO_USINT |
|
9258 */ |
|
9259 case function_uint_to_usint : |
|
9260 { |
|
9261 symbol_c *last_type_symbol = NULL; |
|
9262 |
|
9263 { |
|
9264 identifier_c param_name("IN"); |
|
9265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9266 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9267 |
|
9268 /* Get the value from a foo(<param_value>) style call */ |
|
9269 if (IN_param_value == NULL) |
|
9270 IN_param_value = function_call_param_iterator.next(); |
|
9271 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9272 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9273 |
|
9274 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9275 { |
|
9276 |
|
9277 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
9278 return return_type_symbol; |
|
9279 |
|
9280 } |
|
9281 |
|
9282 ERROR; |
|
9283 } |
|
9284 |
|
9285 }/*function_uint_to_usint*/ |
|
9286 break; |
|
9287 |
|
9288 /**** |
|
9289 *UINT_TO_ULINT |
|
9290 */ |
|
9291 case function_uint_to_ulint : |
|
9292 { |
|
9293 symbol_c *last_type_symbol = NULL; |
|
9294 |
|
9295 { |
|
9296 identifier_c param_name("IN"); |
|
9297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9299 |
|
9300 /* Get the value from a foo(<param_value>) style call */ |
|
9301 if (IN_param_value == NULL) |
|
9302 IN_param_value = function_call_param_iterator.next(); |
|
9303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9305 |
|
9306 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9307 { |
|
9308 |
|
9309 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9310 return return_type_symbol; |
|
9311 |
|
9312 } |
|
9313 |
|
9314 ERROR; |
|
9315 } |
|
9316 |
|
9317 }/*function_uint_to_ulint*/ |
|
9318 break; |
|
9319 |
|
9320 /**** |
|
9321 *UINT_TO_BOOL |
|
9322 */ |
|
9323 case function_uint_to_bool : |
|
9324 { |
|
9325 symbol_c *last_type_symbol = NULL; |
|
9326 |
|
9327 { |
|
9328 identifier_c param_name("IN"); |
|
9329 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9330 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9331 |
|
9332 /* Get the value from a foo(<param_value>) style call */ |
|
9333 if (IN_param_value == NULL) |
|
9334 IN_param_value = function_call_param_iterator.next(); |
|
9335 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9336 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9337 |
|
9338 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9339 { |
|
9340 |
|
9341 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
9342 return return_type_symbol; |
|
9343 |
|
9344 } |
|
9345 |
|
9346 ERROR; |
|
9347 } |
|
9348 |
|
9349 }/*function_uint_to_bool*/ |
|
9350 break; |
|
9351 |
|
9352 /**** |
|
9353 *UINT_TO_TIME |
|
9354 */ |
|
9355 case function_uint_to_time : |
|
9356 { |
|
9357 symbol_c *last_type_symbol = NULL; |
|
9358 |
|
9359 { |
|
9360 identifier_c param_name("IN"); |
|
9361 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9362 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9363 |
|
9364 /* Get the value from a foo(<param_value>) style call */ |
|
9365 if (IN_param_value == NULL) |
|
9366 IN_param_value = function_call_param_iterator.next(); |
|
9367 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9368 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9369 |
|
9370 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9371 { |
|
9372 |
|
9373 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
9374 return return_type_symbol; |
|
9375 |
|
9376 } |
|
9377 |
|
9378 ERROR; |
|
9379 } |
|
9380 |
|
9381 }/*function_uint_to_time*/ |
|
9382 break; |
|
9383 |
|
9384 /**** |
|
9385 *UINT_TO_INT |
|
9386 */ |
|
9387 case function_uint_to_int : |
|
9388 { |
|
9389 symbol_c *last_type_symbol = NULL; |
|
9390 |
|
9391 { |
|
9392 identifier_c param_name("IN"); |
|
9393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9394 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9395 |
|
9396 /* Get the value from a foo(<param_value>) style call */ |
|
9397 if (IN_param_value == NULL) |
|
9398 IN_param_value = function_call_param_iterator.next(); |
|
9399 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9400 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9401 |
|
9402 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
9403 { |
|
9404 |
|
9405 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
9406 return return_type_symbol; |
|
9407 |
|
9408 } |
|
9409 |
|
9410 ERROR; |
|
9411 } |
|
9412 |
|
9413 }/*function_uint_to_int*/ |
|
9414 break; |
|
9415 |
|
9416 /**** |
|
9417 *LREAL_TO_REAL |
|
9418 */ |
|
9419 case function_lreal_to_real : |
|
9420 { |
|
9421 symbol_c *last_type_symbol = NULL; |
|
9422 |
|
9423 { |
|
9424 identifier_c param_name("IN"); |
|
9425 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9426 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9427 |
|
9428 /* Get the value from a foo(<param_value>) style call */ |
|
9429 if (IN_param_value == NULL) |
|
9430 IN_param_value = function_call_param_iterator.next(); |
|
9431 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9432 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9433 |
|
9434 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9435 { |
|
9436 |
|
9437 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9438 return return_type_symbol; |
|
9439 |
|
9440 } |
|
9441 |
|
9442 ERROR; |
|
9443 } |
|
9444 |
|
9445 }/*function_lreal_to_real*/ |
|
9446 break; |
|
9447 |
|
9448 /**** |
|
9449 *LREAL_TO_SINT |
|
9450 */ |
|
9451 case function_lreal_to_sint : |
|
9452 { |
|
9453 symbol_c *last_type_symbol = NULL; |
|
9454 |
|
9455 { |
|
9456 identifier_c param_name("IN"); |
|
9457 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9458 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9459 |
|
9460 /* Get the value from a foo(<param_value>) style call */ |
|
9461 if (IN_param_value == NULL) |
|
9462 IN_param_value = function_call_param_iterator.next(); |
|
9463 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9464 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9465 |
|
9466 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9467 { |
|
9468 |
|
9469 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
9470 return return_type_symbol; |
|
9471 |
|
9472 } |
|
9473 |
|
9474 ERROR; |
|
9475 } |
|
9476 |
|
9477 }/*function_lreal_to_sint*/ |
|
9478 break; |
|
9479 |
|
9480 /**** |
|
9481 *LREAL_TO_LINT |
|
9482 */ |
|
9483 case function_lreal_to_lint : |
|
9484 { |
|
9485 symbol_c *last_type_symbol = NULL; |
|
9486 |
|
9487 { |
|
9488 identifier_c param_name("IN"); |
|
9489 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9490 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9491 |
|
9492 /* Get the value from a foo(<param_value>) style call */ |
|
9493 if (IN_param_value == NULL) |
|
9494 IN_param_value = function_call_param_iterator.next(); |
|
9495 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9496 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9497 |
|
9498 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9499 { |
|
9500 |
|
9501 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
9502 return return_type_symbol; |
|
9503 |
|
9504 } |
|
9505 |
|
9506 ERROR; |
|
9507 } |
|
9508 |
|
9509 }/*function_lreal_to_lint*/ |
|
9510 break; |
|
9511 |
|
9512 /**** |
|
9513 *LREAL_TO_DINT |
|
9514 */ |
|
9515 case function_lreal_to_dint : |
|
9516 { |
|
9517 symbol_c *last_type_symbol = NULL; |
|
9518 |
|
9519 { |
|
9520 identifier_c param_name("IN"); |
|
9521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9523 |
|
9524 /* Get the value from a foo(<param_value>) style call */ |
|
9525 if (IN_param_value == NULL) |
|
9526 IN_param_value = function_call_param_iterator.next(); |
|
9527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9529 |
|
9530 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9531 { |
|
9532 |
|
9533 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
9534 return return_type_symbol; |
|
9535 |
|
9536 } |
|
9537 |
|
9538 ERROR; |
|
9539 } |
|
9540 |
|
9541 }/*function_lreal_to_dint*/ |
|
9542 break; |
|
9543 |
|
9544 /**** |
|
9545 *LREAL_TO_DATE |
|
9546 */ |
|
9547 case function_lreal_to_date : |
|
9548 { |
|
9549 symbol_c *last_type_symbol = NULL; |
|
9550 |
|
9551 { |
|
9552 identifier_c param_name("IN"); |
|
9553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9554 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9555 |
|
9556 /* Get the value from a foo(<param_value>) style call */ |
|
9557 if (IN_param_value == NULL) |
|
9558 IN_param_value = function_call_param_iterator.next(); |
|
9559 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9560 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9561 |
|
9562 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9563 { |
|
9564 |
|
9565 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
9566 return return_type_symbol; |
|
9567 |
|
9568 } |
|
9569 |
|
9570 ERROR; |
|
9571 } |
|
9572 |
|
9573 }/*function_lreal_to_date*/ |
|
9574 break; |
|
9575 |
|
9576 /**** |
|
9577 *LREAL_TO_DWORD |
|
9578 */ |
|
9579 case function_lreal_to_dword : |
|
9580 { |
|
9581 symbol_c *last_type_symbol = NULL; |
|
9582 |
|
9583 { |
|
9584 identifier_c param_name("IN"); |
|
9585 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9586 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9587 |
|
9588 /* Get the value from a foo(<param_value>) style call */ |
|
9589 if (IN_param_value == NULL) |
|
9590 IN_param_value = function_call_param_iterator.next(); |
|
9591 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9592 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9593 |
|
9594 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9595 { |
|
9596 |
|
9597 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9598 return return_type_symbol; |
|
9599 |
|
9600 } |
|
9601 |
|
9602 ERROR; |
|
9603 } |
|
9604 |
|
9605 }/*function_lreal_to_dword*/ |
|
9606 break; |
|
9607 |
|
9608 /**** |
|
9609 *LREAL_TO_DT |
|
9610 */ |
|
9611 case function_lreal_to_dt : |
|
9612 { |
|
9613 symbol_c *last_type_symbol = NULL; |
|
9614 |
|
9615 { |
|
9616 identifier_c param_name("IN"); |
|
9617 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9618 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9619 |
|
9620 /* Get the value from a foo(<param_value>) style call */ |
|
9621 if (IN_param_value == NULL) |
|
9622 IN_param_value = function_call_param_iterator.next(); |
|
9623 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9624 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9625 |
|
9626 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9627 { |
|
9628 |
|
9629 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
9630 return return_type_symbol; |
|
9631 |
|
9632 } |
|
9633 |
|
9634 ERROR; |
|
9635 } |
|
9636 |
|
9637 }/*function_lreal_to_dt*/ |
|
9638 break; |
|
9639 |
|
9640 /**** |
|
9641 *LREAL_TO_TOD |
|
9642 */ |
|
9643 case function_lreal_to_tod : |
|
9644 { |
|
9645 symbol_c *last_type_symbol = NULL; |
|
9646 |
|
9647 { |
|
9648 identifier_c param_name("IN"); |
|
9649 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9650 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9651 |
|
9652 /* Get the value from a foo(<param_value>) style call */ |
|
9653 if (IN_param_value == NULL) |
|
9654 IN_param_value = function_call_param_iterator.next(); |
|
9655 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9656 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9657 |
|
9658 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9659 { |
|
9660 |
|
9661 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
9662 return return_type_symbol; |
|
9663 |
|
9664 } |
|
9665 |
|
9666 ERROR; |
|
9667 } |
|
9668 |
|
9669 }/*function_lreal_to_tod*/ |
|
9670 break; |
|
9671 |
|
9672 /**** |
|
9673 *LREAL_TO_UDINT |
|
9674 */ |
|
9675 case function_lreal_to_udint : |
|
9676 { |
|
9677 symbol_c *last_type_symbol = NULL; |
|
9678 |
|
9679 { |
|
9680 identifier_c param_name("IN"); |
|
9681 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9682 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9683 |
|
9684 /* Get the value from a foo(<param_value>) style call */ |
|
9685 if (IN_param_value == NULL) |
|
9686 IN_param_value = function_call_param_iterator.next(); |
|
9687 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9688 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9689 |
|
9690 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9691 { |
|
9692 |
|
9693 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9694 return return_type_symbol; |
|
9695 |
|
9696 } |
|
9697 |
|
9698 ERROR; |
|
9699 } |
|
9700 |
|
9701 }/*function_lreal_to_udint*/ |
|
9702 break; |
|
9703 |
|
9704 /**** |
|
9705 *LREAL_TO_WORD |
|
9706 */ |
|
9707 case function_lreal_to_word : |
|
9708 { |
|
9709 symbol_c *last_type_symbol = NULL; |
|
9710 |
|
9711 { |
|
9712 identifier_c param_name("IN"); |
|
9713 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9714 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9715 |
|
9716 /* Get the value from a foo(<param_value>) style call */ |
|
9717 if (IN_param_value == NULL) |
|
9718 IN_param_value = function_call_param_iterator.next(); |
|
9719 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9720 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9721 |
|
9722 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9723 { |
|
9724 |
|
9725 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9726 return return_type_symbol; |
|
9727 |
|
9728 } |
|
9729 |
|
9730 ERROR; |
|
9731 } |
|
9732 |
|
9733 }/*function_lreal_to_word*/ |
|
9734 break; |
|
9735 |
|
9736 /**** |
|
9737 *LREAL_TO_WSTRING |
|
9738 */ |
|
9739 case function_lreal_to_wstring : |
|
9740 { |
|
9741 symbol_c *last_type_symbol = NULL; |
|
9742 |
|
9743 { |
|
9744 identifier_c param_name("IN"); |
|
9745 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9746 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9747 |
|
9748 /* Get the value from a foo(<param_value>) style call */ |
|
9749 if (IN_param_value == NULL) |
|
9750 IN_param_value = function_call_param_iterator.next(); |
|
9751 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9752 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9753 |
|
9754 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9755 { |
|
9756 |
|
9757 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
9758 return return_type_symbol; |
|
9759 |
|
9760 } |
|
9761 |
|
9762 ERROR; |
|
9763 } |
|
9764 |
|
9765 }/*function_lreal_to_wstring*/ |
|
9766 break; |
|
9767 |
|
9768 /**** |
|
9769 *LREAL_TO_STRING |
|
9770 */ |
|
9771 case function_lreal_to_string : |
|
9772 { |
|
9773 symbol_c *last_type_symbol = NULL; |
|
9774 |
|
9775 { |
|
9776 identifier_c param_name("IN"); |
|
9777 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9778 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9779 |
|
9780 /* Get the value from a foo(<param_value>) style call */ |
|
9781 if (IN_param_value == NULL) |
|
9782 IN_param_value = function_call_param_iterator.next(); |
|
9783 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9784 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9785 |
|
9786 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9787 { |
|
9788 |
|
9789 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9790 return return_type_symbol; |
|
9791 |
|
9792 } |
|
9793 |
|
9794 ERROR; |
|
9795 } |
|
9796 |
|
9797 }/*function_lreal_to_string*/ |
|
9798 break; |
|
9799 |
|
9800 /**** |
|
9801 *LREAL_TO_LWORD |
|
9802 */ |
|
9803 case function_lreal_to_lword : |
|
9804 { |
|
9805 symbol_c *last_type_symbol = NULL; |
|
9806 |
|
9807 { |
|
9808 identifier_c param_name("IN"); |
|
9809 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9810 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9811 |
|
9812 /* Get the value from a foo(<param_value>) style call */ |
|
9813 if (IN_param_value == NULL) |
|
9814 IN_param_value = function_call_param_iterator.next(); |
|
9815 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9816 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9817 |
|
9818 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9819 { |
|
9820 |
|
9821 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9822 return return_type_symbol; |
|
9823 |
|
9824 } |
|
9825 |
|
9826 ERROR; |
|
9827 } |
|
9828 |
|
9829 }/*function_lreal_to_lword*/ |
|
9830 break; |
|
9831 |
|
9832 /**** |
|
9833 *LREAL_TO_UINT |
|
9834 */ |
|
9835 case function_lreal_to_uint : |
|
9836 { |
|
9837 symbol_c *last_type_symbol = NULL; |
|
9838 |
|
9839 { |
|
9840 identifier_c param_name("IN"); |
|
9841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9842 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9843 |
|
9844 /* Get the value from a foo(<param_value>) style call */ |
|
9845 if (IN_param_value == NULL) |
|
9846 IN_param_value = function_call_param_iterator.next(); |
|
9847 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9848 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9849 |
|
9850 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9851 { |
|
9852 |
|
9853 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9854 return return_type_symbol; |
|
9855 |
|
9856 } |
|
9857 |
|
9858 ERROR; |
|
9859 } |
|
9860 |
|
9861 }/*function_lreal_to_uint*/ |
|
9862 break; |
|
9863 |
|
9864 /**** |
|
9865 *LREAL_TO_LREAL |
|
9866 */ |
|
9867 case function_lreal_to_lreal : |
|
9868 { |
|
9869 symbol_c *last_type_symbol = NULL; |
|
9870 |
|
9871 { |
|
9872 identifier_c param_name("IN"); |
|
9873 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9874 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9875 |
|
9876 /* Get the value from a foo(<param_value>) style call */ |
|
9877 if (IN_param_value == NULL) |
|
9878 IN_param_value = function_call_param_iterator.next(); |
|
9879 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9880 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9881 |
|
9882 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9883 { |
|
9884 |
|
9885 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9886 return return_type_symbol; |
|
9887 |
|
9888 } |
|
9889 |
|
9890 ERROR; |
|
9891 } |
|
9892 |
|
9893 }/*function_lreal_to_lreal*/ |
|
9894 break; |
|
9895 |
|
9896 /**** |
|
9897 *LREAL_TO_BYTE |
|
9898 */ |
|
9899 case function_lreal_to_byte : |
|
9900 { |
|
9901 symbol_c *last_type_symbol = NULL; |
|
9902 |
|
9903 { |
|
9904 identifier_c param_name("IN"); |
|
9905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9906 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9907 |
|
9908 /* Get the value from a foo(<param_value>) style call */ |
|
9909 if (IN_param_value == NULL) |
|
9910 IN_param_value = function_call_param_iterator.next(); |
|
9911 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9912 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9913 |
|
9914 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9915 { |
|
9916 |
|
9917 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9918 return return_type_symbol; |
|
9919 |
|
9920 } |
|
9921 |
|
9922 ERROR; |
|
9923 } |
|
9924 |
|
9925 }/*function_lreal_to_byte*/ |
|
9926 break; |
|
9927 |
|
9928 /**** |
|
9929 *LREAL_TO_USINT |
|
9930 */ |
|
9931 case function_lreal_to_usint : |
|
9932 { |
|
9933 symbol_c *last_type_symbol = NULL; |
|
9934 |
|
9935 { |
|
9936 identifier_c param_name("IN"); |
|
9937 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9938 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9939 |
|
9940 /* Get the value from a foo(<param_value>) style call */ |
|
9941 if (IN_param_value == NULL) |
|
9942 IN_param_value = function_call_param_iterator.next(); |
|
9943 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9944 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9945 |
|
9946 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9947 { |
|
9948 |
|
9949 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
9950 return return_type_symbol; |
|
9951 |
|
9952 } |
|
9953 |
|
9954 ERROR; |
|
9955 } |
|
9956 |
|
9957 }/*function_lreal_to_usint*/ |
|
9958 break; |
|
9959 |
|
9960 /**** |
|
9961 *LREAL_TO_ULINT |
|
9962 */ |
|
9963 case function_lreal_to_ulint : |
|
9964 { |
|
9965 symbol_c *last_type_symbol = NULL; |
|
9966 |
|
9967 { |
|
9968 identifier_c param_name("IN"); |
|
9969 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9970 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
9971 |
|
9972 /* Get the value from a foo(<param_value>) style call */ |
|
9973 if (IN_param_value == NULL) |
|
9974 IN_param_value = function_call_param_iterator.next(); |
|
9975 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
9976 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
9977 |
|
9978 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
9979 { |
|
9980 |
|
9981 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9982 return return_type_symbol; |
|
9983 |
|
9984 } |
|
9985 |
|
9986 ERROR; |
|
9987 } |
|
9988 |
|
9989 }/*function_lreal_to_ulint*/ |
|
9990 break; |
|
9991 |
|
9992 /**** |
|
9993 *LREAL_TO_BOOL |
|
9994 */ |
|
9995 case function_lreal_to_bool : |
|
9996 { |
|
9997 symbol_c *last_type_symbol = NULL; |
|
9998 |
|
9999 { |
|
10000 identifier_c param_name("IN"); |
|
10001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10003 |
|
10004 /* Get the value from a foo(<param_value>) style call */ |
|
10005 if (IN_param_value == NULL) |
|
10006 IN_param_value = function_call_param_iterator.next(); |
|
10007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10009 |
|
10010 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
10011 { |
|
10012 |
|
10013 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10014 return return_type_symbol; |
|
10015 |
|
10016 } |
|
10017 |
|
10018 ERROR; |
|
10019 } |
|
10020 |
|
10021 }/*function_lreal_to_bool*/ |
|
10022 break; |
|
10023 |
|
10024 /**** |
|
10025 *LREAL_TO_TIME |
|
10026 */ |
|
10027 case function_lreal_to_time : |
|
10028 { |
|
10029 symbol_c *last_type_symbol = NULL; |
|
10030 |
|
10031 { |
|
10032 identifier_c param_name("IN"); |
|
10033 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10034 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10035 |
|
10036 /* Get the value from a foo(<param_value>) style call */ |
|
10037 if (IN_param_value == NULL) |
|
10038 IN_param_value = function_call_param_iterator.next(); |
|
10039 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10040 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10041 |
|
10042 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
10043 { |
|
10044 |
|
10045 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10046 return return_type_symbol; |
|
10047 |
|
10048 } |
|
10049 |
|
10050 ERROR; |
|
10051 } |
|
10052 |
|
10053 }/*function_lreal_to_time*/ |
|
10054 break; |
|
10055 |
|
10056 /**** |
|
10057 *LREAL_TO_INT |
|
10058 */ |
|
10059 case function_lreal_to_int : |
|
10060 { |
|
10061 symbol_c *last_type_symbol = NULL; |
|
10062 |
|
10063 { |
|
10064 identifier_c param_name("IN"); |
|
10065 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10066 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10067 |
|
10068 /* Get the value from a foo(<param_value>) style call */ |
|
10069 if (IN_param_value == NULL) |
|
10070 IN_param_value = function_call_param_iterator.next(); |
|
10071 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10072 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10073 |
|
10074 if (typeid(*last_type_symbol) == typeid(lreal_type_name_c)) |
|
10075 { |
|
10076 |
|
10077 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10078 return return_type_symbol; |
|
10079 |
|
10080 } |
|
10081 |
|
10082 ERROR; |
|
10083 } |
|
10084 |
|
10085 }/*function_lreal_to_int*/ |
|
10086 break; |
|
10087 |
|
10088 /**** |
|
10089 *BYTE_TO_REAL |
|
10090 */ |
|
10091 case function_byte_to_real : |
|
10092 { |
|
10093 symbol_c *last_type_symbol = NULL; |
|
10094 |
|
10095 { |
|
10096 identifier_c param_name("IN"); |
|
10097 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10098 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10099 |
|
10100 /* Get the value from a foo(<param_value>) style call */ |
|
10101 if (IN_param_value == NULL) |
|
10102 IN_param_value = function_call_param_iterator.next(); |
|
10103 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10104 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10105 |
|
10106 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10107 { |
|
10108 |
|
10109 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10110 return return_type_symbol; |
|
10111 |
|
10112 } |
|
10113 |
|
10114 ERROR; |
|
10115 } |
|
10116 |
|
10117 }/*function_byte_to_real*/ |
|
10118 break; |
|
10119 |
|
10120 /**** |
|
10121 *BYTE_TO_SINT |
|
10122 */ |
|
10123 case function_byte_to_sint : |
|
10124 { |
|
10125 symbol_c *last_type_symbol = NULL; |
|
10126 |
|
10127 { |
|
10128 identifier_c param_name("IN"); |
|
10129 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10130 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10131 |
|
10132 /* Get the value from a foo(<param_value>) style call */ |
|
10133 if (IN_param_value == NULL) |
|
10134 IN_param_value = function_call_param_iterator.next(); |
|
10135 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10137 |
|
10138 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10139 { |
|
10140 |
|
10141 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10142 return return_type_symbol; |
|
10143 |
|
10144 } |
|
10145 |
|
10146 ERROR; |
|
10147 } |
|
10148 |
|
10149 }/*function_byte_to_sint*/ |
|
10150 break; |
|
10151 |
|
10152 /**** |
|
10153 *BYTE_TO_LINT |
|
10154 */ |
|
10155 case function_byte_to_lint : |
|
10156 { |
|
10157 symbol_c *last_type_symbol = NULL; |
|
10158 |
|
10159 { |
|
10160 identifier_c param_name("IN"); |
|
10161 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10162 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10163 |
|
10164 /* Get the value from a foo(<param_value>) style call */ |
|
10165 if (IN_param_value == NULL) |
|
10166 IN_param_value = function_call_param_iterator.next(); |
|
10167 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10168 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10169 |
|
10170 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10171 { |
|
10172 |
|
10173 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10174 return return_type_symbol; |
|
10175 |
|
10176 } |
|
10177 |
|
10178 ERROR; |
|
10179 } |
|
10180 |
|
10181 }/*function_byte_to_lint*/ |
|
10182 break; |
|
10183 |
|
10184 /**** |
|
10185 *BYTE_TO_DINT |
|
10186 */ |
|
10187 case function_byte_to_dint : |
|
10188 { |
|
10189 symbol_c *last_type_symbol = NULL; |
|
10190 |
|
10191 { |
|
10192 identifier_c param_name("IN"); |
|
10193 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10194 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10195 |
|
10196 /* Get the value from a foo(<param_value>) style call */ |
|
10197 if (IN_param_value == NULL) |
|
10198 IN_param_value = function_call_param_iterator.next(); |
|
10199 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10200 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10201 |
|
10202 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10203 { |
|
10204 |
|
10205 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10206 return return_type_symbol; |
|
10207 |
|
10208 } |
|
10209 |
|
10210 ERROR; |
|
10211 } |
|
10212 |
|
10213 }/*function_byte_to_dint*/ |
|
10214 break; |
|
10215 |
|
10216 /**** |
|
10217 *BYTE_TO_DATE |
|
10218 */ |
|
10219 case function_byte_to_date : |
|
10220 { |
|
10221 symbol_c *last_type_symbol = NULL; |
|
10222 |
|
10223 { |
|
10224 identifier_c param_name("IN"); |
|
10225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10227 |
|
10228 /* Get the value from a foo(<param_value>) style call */ |
|
10229 if (IN_param_value == NULL) |
|
10230 IN_param_value = function_call_param_iterator.next(); |
|
10231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10233 |
|
10234 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10235 { |
|
10236 |
|
10237 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10238 return return_type_symbol; |
|
10239 |
|
10240 } |
|
10241 |
|
10242 ERROR; |
|
10243 } |
|
10244 |
|
10245 }/*function_byte_to_date*/ |
|
10246 break; |
|
10247 |
|
10248 /**** |
|
10249 *BYTE_TO_DWORD |
|
10250 */ |
|
10251 case function_byte_to_dword : |
|
10252 { |
|
10253 symbol_c *last_type_symbol = NULL; |
|
10254 |
|
10255 { |
|
10256 identifier_c param_name("IN"); |
|
10257 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10258 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10259 |
|
10260 /* Get the value from a foo(<param_value>) style call */ |
|
10261 if (IN_param_value == NULL) |
|
10262 IN_param_value = function_call_param_iterator.next(); |
|
10263 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10264 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10265 |
|
10266 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10267 { |
|
10268 |
|
10269 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
10270 return return_type_symbol; |
|
10271 |
|
10272 } |
|
10273 |
|
10274 ERROR; |
|
10275 } |
|
10276 |
|
10277 }/*function_byte_to_dword*/ |
|
10278 break; |
|
10279 |
|
10280 /**** |
|
10281 *BYTE_TO_DT |
|
10282 */ |
|
10283 case function_byte_to_dt : |
|
10284 { |
|
10285 symbol_c *last_type_symbol = NULL; |
|
10286 |
|
10287 { |
|
10288 identifier_c param_name("IN"); |
|
10289 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10290 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10291 |
|
10292 /* Get the value from a foo(<param_value>) style call */ |
|
10293 if (IN_param_value == NULL) |
|
10294 IN_param_value = function_call_param_iterator.next(); |
|
10295 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10296 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10297 |
|
10298 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10299 { |
|
10300 |
|
10301 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
10302 return return_type_symbol; |
|
10303 |
|
10304 } |
|
10305 |
|
10306 ERROR; |
|
10307 } |
|
10308 |
|
10309 }/*function_byte_to_dt*/ |
|
10310 break; |
|
10311 |
|
10312 /**** |
|
10313 *BYTE_TO_TOD |
|
10314 */ |
|
10315 case function_byte_to_tod : |
|
10316 { |
|
10317 symbol_c *last_type_symbol = NULL; |
|
10318 |
|
10319 { |
|
10320 identifier_c param_name("IN"); |
|
10321 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10322 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10323 |
|
10324 /* Get the value from a foo(<param_value>) style call */ |
|
10325 if (IN_param_value == NULL) |
|
10326 IN_param_value = function_call_param_iterator.next(); |
|
10327 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10328 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10329 |
|
10330 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10331 { |
|
10332 |
|
10333 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
10334 return return_type_symbol; |
|
10335 |
|
10336 } |
|
10337 |
|
10338 ERROR; |
|
10339 } |
|
10340 |
|
10341 }/*function_byte_to_tod*/ |
|
10342 break; |
|
10343 |
|
10344 /**** |
|
10345 *BYTE_TO_UDINT |
|
10346 */ |
|
10347 case function_byte_to_udint : |
|
10348 { |
|
10349 symbol_c *last_type_symbol = NULL; |
|
10350 |
|
10351 { |
|
10352 identifier_c param_name("IN"); |
|
10353 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10354 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10355 |
|
10356 /* Get the value from a foo(<param_value>) style call */ |
|
10357 if (IN_param_value == NULL) |
|
10358 IN_param_value = function_call_param_iterator.next(); |
|
10359 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10360 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10361 |
|
10362 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10363 { |
|
10364 |
|
10365 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10366 return return_type_symbol; |
|
10367 |
|
10368 } |
|
10369 |
|
10370 ERROR; |
|
10371 } |
|
10372 |
|
10373 }/*function_byte_to_udint*/ |
|
10374 break; |
|
10375 |
|
10376 /**** |
|
10377 *BYTE_TO_WORD |
|
10378 */ |
|
10379 case function_byte_to_word : |
|
10380 { |
|
10381 symbol_c *last_type_symbol = NULL; |
|
10382 |
|
10383 { |
|
10384 identifier_c param_name("IN"); |
|
10385 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10386 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10387 |
|
10388 /* Get the value from a foo(<param_value>) style call */ |
|
10389 if (IN_param_value == NULL) |
|
10390 IN_param_value = function_call_param_iterator.next(); |
|
10391 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10392 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10393 |
|
10394 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10395 { |
|
10396 |
|
10397 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
10398 return return_type_symbol; |
|
10399 |
|
10400 } |
|
10401 |
|
10402 ERROR; |
|
10403 } |
|
10404 |
|
10405 }/*function_byte_to_word*/ |
|
10406 break; |
|
10407 |
|
10408 /**** |
|
10409 *BYTE_TO_WSTRING |
|
10410 */ |
|
10411 case function_byte_to_wstring : |
|
10412 { |
|
10413 symbol_c *last_type_symbol = NULL; |
|
10414 |
|
10415 { |
|
10416 identifier_c param_name("IN"); |
|
10417 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10418 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10419 |
|
10420 /* Get the value from a foo(<param_value>) style call */ |
|
10421 if (IN_param_value == NULL) |
|
10422 IN_param_value = function_call_param_iterator.next(); |
|
10423 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10424 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10425 |
|
10426 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10427 { |
|
10428 |
|
10429 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
10430 return return_type_symbol; |
|
10431 |
|
10432 } |
|
10433 |
|
10434 ERROR; |
|
10435 } |
|
10436 |
|
10437 }/*function_byte_to_wstring*/ |
|
10438 break; |
|
10439 |
|
10440 /**** |
|
10441 *BYTE_TO_STRING |
|
10442 */ |
|
10443 case function_byte_to_string : |
|
10444 { |
|
10445 symbol_c *last_type_symbol = NULL; |
|
10446 |
|
10447 { |
|
10448 identifier_c param_name("IN"); |
|
10449 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10450 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10451 |
|
10452 /* Get the value from a foo(<param_value>) style call */ |
|
10453 if (IN_param_value == NULL) |
|
10454 IN_param_value = function_call_param_iterator.next(); |
|
10455 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10456 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10457 |
|
10458 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10459 { |
|
10460 |
|
10461 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
10462 return return_type_symbol; |
|
10463 |
|
10464 } |
|
10465 |
|
10466 ERROR; |
|
10467 } |
|
10468 |
|
10469 }/*function_byte_to_string*/ |
|
10470 break; |
|
10471 |
|
10472 /**** |
|
10473 *BYTE_TO_LWORD |
|
10474 */ |
|
10475 case function_byte_to_lword : |
|
10476 { |
|
10477 symbol_c *last_type_symbol = NULL; |
|
10478 |
|
10479 { |
|
10480 identifier_c param_name("IN"); |
|
10481 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10482 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10483 |
|
10484 /* Get the value from a foo(<param_value>) style call */ |
|
10485 if (IN_param_value == NULL) |
|
10486 IN_param_value = function_call_param_iterator.next(); |
|
10487 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10488 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10489 |
|
10490 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10491 { |
|
10492 |
|
10493 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
10494 return return_type_symbol; |
|
10495 |
|
10496 } |
|
10497 |
|
10498 ERROR; |
|
10499 } |
|
10500 |
|
10501 }/*function_byte_to_lword*/ |
|
10502 break; |
|
10503 |
|
10504 /**** |
|
10505 *BYTE_TO_UINT |
|
10506 */ |
|
10507 case function_byte_to_uint : |
|
10508 { |
|
10509 symbol_c *last_type_symbol = NULL; |
|
10510 |
|
10511 { |
|
10512 identifier_c param_name("IN"); |
|
10513 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10514 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10515 |
|
10516 /* Get the value from a foo(<param_value>) style call */ |
|
10517 if (IN_param_value == NULL) |
|
10518 IN_param_value = function_call_param_iterator.next(); |
|
10519 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10520 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10521 |
|
10522 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10523 { |
|
10524 |
|
10525 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10526 return return_type_symbol; |
|
10527 |
|
10528 } |
|
10529 |
|
10530 ERROR; |
|
10531 } |
|
10532 |
|
10533 }/*function_byte_to_uint*/ |
|
10534 break; |
|
10535 |
|
10536 /**** |
|
10537 *BYTE_TO_LREAL |
|
10538 */ |
|
10539 case function_byte_to_lreal : |
|
10540 { |
|
10541 symbol_c *last_type_symbol = NULL; |
|
10542 |
|
10543 { |
|
10544 identifier_c param_name("IN"); |
|
10545 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10546 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10547 |
|
10548 /* Get the value from a foo(<param_value>) style call */ |
|
10549 if (IN_param_value == NULL) |
|
10550 IN_param_value = function_call_param_iterator.next(); |
|
10551 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10552 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10553 |
|
10554 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10555 { |
|
10556 |
|
10557 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
10558 return return_type_symbol; |
|
10559 |
|
10560 } |
|
10561 |
|
10562 ERROR; |
|
10563 } |
|
10564 |
|
10565 }/*function_byte_to_lreal*/ |
|
10566 break; |
|
10567 |
|
10568 /**** |
|
10569 *BYTE_TO_BYTE |
|
10570 */ |
|
10571 case function_byte_to_byte : |
|
10572 { |
|
10573 symbol_c *last_type_symbol = NULL; |
|
10574 |
|
10575 { |
|
10576 identifier_c param_name("IN"); |
|
10577 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10578 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10579 |
|
10580 /* Get the value from a foo(<param_value>) style call */ |
|
10581 if (IN_param_value == NULL) |
|
10582 IN_param_value = function_call_param_iterator.next(); |
|
10583 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10584 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10585 |
|
10586 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10587 { |
|
10588 |
|
10589 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
10590 return return_type_symbol; |
|
10591 |
|
10592 } |
|
10593 |
|
10594 ERROR; |
|
10595 } |
|
10596 |
|
10597 }/*function_byte_to_byte*/ |
|
10598 break; |
|
10599 |
|
10600 /**** |
|
10601 *BYTE_TO_USINT |
|
10602 */ |
|
10603 case function_byte_to_usint : |
|
10604 { |
|
10605 symbol_c *last_type_symbol = NULL; |
|
10606 |
|
10607 { |
|
10608 identifier_c param_name("IN"); |
|
10609 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10610 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10611 |
|
10612 /* Get the value from a foo(<param_value>) style call */ |
|
10613 if (IN_param_value == NULL) |
|
10614 IN_param_value = function_call_param_iterator.next(); |
|
10615 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10616 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10617 |
|
10618 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10619 { |
|
10620 |
|
10621 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10622 return return_type_symbol; |
|
10623 |
|
10624 } |
|
10625 |
|
10626 ERROR; |
|
10627 } |
|
10628 |
|
10629 }/*function_byte_to_usint*/ |
|
10630 break; |
|
10631 |
|
10632 /**** |
|
10633 *BYTE_TO_ULINT |
|
10634 */ |
|
10635 case function_byte_to_ulint : |
|
10636 { |
|
10637 symbol_c *last_type_symbol = NULL; |
|
10638 |
|
10639 { |
|
10640 identifier_c param_name("IN"); |
|
10641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10642 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10643 |
|
10644 /* Get the value from a foo(<param_value>) style call */ |
|
10645 if (IN_param_value == NULL) |
|
10646 IN_param_value = function_call_param_iterator.next(); |
|
10647 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10648 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10649 |
|
10650 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10651 { |
|
10652 |
|
10653 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10654 return return_type_symbol; |
|
10655 |
|
10656 } |
|
10657 |
|
10658 ERROR; |
|
10659 } |
|
10660 |
|
10661 }/*function_byte_to_ulint*/ |
|
10662 break; |
|
10663 |
|
10664 /**** |
|
10665 *BYTE_TO_BOOL |
|
10666 */ |
|
10667 case function_byte_to_bool : |
|
10668 { |
|
10669 symbol_c *last_type_symbol = NULL; |
|
10670 |
|
10671 { |
|
10672 identifier_c param_name("IN"); |
|
10673 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10674 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10675 |
|
10676 /* Get the value from a foo(<param_value>) style call */ |
|
10677 if (IN_param_value == NULL) |
|
10678 IN_param_value = function_call_param_iterator.next(); |
|
10679 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10680 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10681 |
|
10682 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10683 { |
|
10684 |
|
10685 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10686 return return_type_symbol; |
|
10687 |
|
10688 } |
|
10689 |
|
10690 ERROR; |
|
10691 } |
|
10692 |
|
10693 }/*function_byte_to_bool*/ |
|
10694 break; |
|
10695 |
|
10696 /**** |
|
10697 *BYTE_TO_TIME |
|
10698 */ |
|
10699 case function_byte_to_time : |
|
10700 { |
|
10701 symbol_c *last_type_symbol = NULL; |
|
10702 |
|
10703 { |
|
10704 identifier_c param_name("IN"); |
|
10705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10707 |
|
10708 /* Get the value from a foo(<param_value>) style call */ |
|
10709 if (IN_param_value == NULL) |
|
10710 IN_param_value = function_call_param_iterator.next(); |
|
10711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10713 |
|
10714 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10715 { |
|
10716 |
|
10717 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10718 return return_type_symbol; |
|
10719 |
|
10720 } |
|
10721 |
|
10722 ERROR; |
|
10723 } |
|
10724 |
|
10725 }/*function_byte_to_time*/ |
|
10726 break; |
|
10727 |
|
10728 /**** |
|
10729 *BYTE_TO_INT |
|
10730 */ |
|
10731 case function_byte_to_int : |
|
10732 { |
|
10733 symbol_c *last_type_symbol = NULL; |
|
10734 |
|
10735 { |
|
10736 identifier_c param_name("IN"); |
|
10737 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10738 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10739 |
|
10740 /* Get the value from a foo(<param_value>) style call */ |
|
10741 if (IN_param_value == NULL) |
|
10742 IN_param_value = function_call_param_iterator.next(); |
|
10743 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10744 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10745 |
|
10746 if (typeid(*last_type_symbol) == typeid(byte_type_name_c)) |
|
10747 { |
|
10748 |
|
10749 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10750 return return_type_symbol; |
|
10751 |
|
10752 } |
|
10753 |
|
10754 ERROR; |
|
10755 } |
|
10756 |
|
10757 }/*function_byte_to_int*/ |
|
10758 break; |
|
10759 |
|
10760 /**** |
|
10761 *USINT_TO_REAL |
|
10762 */ |
|
10763 case function_usint_to_real : |
|
10764 { |
|
10765 symbol_c *last_type_symbol = NULL; |
|
10766 |
|
10767 { |
|
10768 identifier_c param_name("IN"); |
|
10769 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10770 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10771 |
|
10772 /* Get the value from a foo(<param_value>) style call */ |
|
10773 if (IN_param_value == NULL) |
|
10774 IN_param_value = function_call_param_iterator.next(); |
|
10775 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10776 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10777 |
|
10778 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10779 { |
|
10780 |
|
10781 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10782 return return_type_symbol; |
|
10783 |
|
10784 } |
|
10785 |
|
10786 ERROR; |
|
10787 } |
|
10788 |
|
10789 }/*function_usint_to_real*/ |
|
10790 break; |
|
10791 |
|
10792 /**** |
|
10793 *USINT_TO_SINT |
|
10794 */ |
|
10795 case function_usint_to_sint : |
|
10796 { |
|
10797 symbol_c *last_type_symbol = NULL; |
|
10798 |
|
10799 { |
|
10800 identifier_c param_name("IN"); |
|
10801 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10802 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10803 |
|
10804 /* Get the value from a foo(<param_value>) style call */ |
|
10805 if (IN_param_value == NULL) |
|
10806 IN_param_value = function_call_param_iterator.next(); |
|
10807 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10808 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10809 |
|
10810 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10811 { |
|
10812 |
|
10813 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10814 return return_type_symbol; |
|
10815 |
|
10816 } |
|
10817 |
|
10818 ERROR; |
|
10819 } |
|
10820 |
|
10821 }/*function_usint_to_sint*/ |
|
10822 break; |
|
10823 |
|
10824 /**** |
|
10825 *USINT_TO_LINT |
|
10826 */ |
|
10827 case function_usint_to_lint : |
|
10828 { |
|
10829 symbol_c *last_type_symbol = NULL; |
|
10830 |
|
10831 { |
|
10832 identifier_c param_name("IN"); |
|
10833 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10834 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10835 |
|
10836 /* Get the value from a foo(<param_value>) style call */ |
|
10837 if (IN_param_value == NULL) |
|
10838 IN_param_value = function_call_param_iterator.next(); |
|
10839 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10840 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10841 |
|
10842 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10843 { |
|
10844 |
|
10845 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10846 return return_type_symbol; |
|
10847 |
|
10848 } |
|
10849 |
|
10850 ERROR; |
|
10851 } |
|
10852 |
|
10853 }/*function_usint_to_lint*/ |
|
10854 break; |
|
10855 |
|
10856 /**** |
|
10857 *USINT_TO_DINT |
|
10858 */ |
|
10859 case function_usint_to_dint : |
|
10860 { |
|
10861 symbol_c *last_type_symbol = NULL; |
|
10862 |
|
10863 { |
|
10864 identifier_c param_name("IN"); |
|
10865 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10866 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10867 |
|
10868 /* Get the value from a foo(<param_value>) style call */ |
|
10869 if (IN_param_value == NULL) |
|
10870 IN_param_value = function_call_param_iterator.next(); |
|
10871 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10872 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10873 |
|
10874 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10875 { |
|
10876 |
|
10877 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10878 return return_type_symbol; |
|
10879 |
|
10880 } |
|
10881 |
|
10882 ERROR; |
|
10883 } |
|
10884 |
|
10885 }/*function_usint_to_dint*/ |
|
10886 break; |
|
10887 |
|
10888 /**** |
|
10889 *USINT_TO_DATE |
|
10890 */ |
|
10891 case function_usint_to_date : |
|
10892 { |
|
10893 symbol_c *last_type_symbol = NULL; |
|
10894 |
|
10895 { |
|
10896 identifier_c param_name("IN"); |
|
10897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10898 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10899 |
|
10900 /* Get the value from a foo(<param_value>) style call */ |
|
10901 if (IN_param_value == NULL) |
|
10902 IN_param_value = function_call_param_iterator.next(); |
|
10903 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10905 |
|
10906 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10907 { |
|
10908 |
|
10909 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10910 return return_type_symbol; |
|
10911 |
|
10912 } |
|
10913 |
|
10914 ERROR; |
|
10915 } |
|
10916 |
|
10917 }/*function_usint_to_date*/ |
|
10918 break; |
|
10919 |
|
10920 /**** |
|
10921 *USINT_TO_DWORD |
|
10922 */ |
|
10923 case function_usint_to_dword : |
|
10924 { |
|
10925 symbol_c *last_type_symbol = NULL; |
|
10926 |
|
10927 { |
|
10928 identifier_c param_name("IN"); |
|
10929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10931 |
|
10932 /* Get the value from a foo(<param_value>) style call */ |
|
10933 if (IN_param_value == NULL) |
|
10934 IN_param_value = function_call_param_iterator.next(); |
|
10935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10937 |
|
10938 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10939 { |
|
10940 |
|
10941 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
10942 return return_type_symbol; |
|
10943 |
|
10944 } |
|
10945 |
|
10946 ERROR; |
|
10947 } |
|
10948 |
|
10949 }/*function_usint_to_dword*/ |
|
10950 break; |
|
10951 |
|
10952 /**** |
|
10953 *USINT_TO_DT |
|
10954 */ |
|
10955 case function_usint_to_dt : |
|
10956 { |
|
10957 symbol_c *last_type_symbol = NULL; |
|
10958 |
|
10959 { |
|
10960 identifier_c param_name("IN"); |
|
10961 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10962 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10963 |
|
10964 /* Get the value from a foo(<param_value>) style call */ |
|
10965 if (IN_param_value == NULL) |
|
10966 IN_param_value = function_call_param_iterator.next(); |
|
10967 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
10968 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
10969 |
|
10970 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
10971 { |
|
10972 |
|
10973 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
10974 return return_type_symbol; |
|
10975 |
|
10976 } |
|
10977 |
|
10978 ERROR; |
|
10979 } |
|
10980 |
|
10981 }/*function_usint_to_dt*/ |
|
10982 break; |
|
10983 |
|
10984 /**** |
|
10985 *USINT_TO_TOD |
|
10986 */ |
|
10987 case function_usint_to_tod : |
|
10988 { |
|
10989 symbol_c *last_type_symbol = NULL; |
|
10990 |
|
10991 { |
|
10992 identifier_c param_name("IN"); |
|
10993 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10994 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
10995 |
|
10996 /* Get the value from a foo(<param_value>) style call */ |
|
10997 if (IN_param_value == NULL) |
|
10998 IN_param_value = function_call_param_iterator.next(); |
|
10999 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11000 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11001 |
|
11002 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11003 { |
|
11004 |
|
11005 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11006 return return_type_symbol; |
|
11007 |
|
11008 } |
|
11009 |
|
11010 ERROR; |
|
11011 } |
|
11012 |
|
11013 }/*function_usint_to_tod*/ |
|
11014 break; |
|
11015 |
|
11016 /**** |
|
11017 *USINT_TO_UDINT |
|
11018 */ |
|
11019 case function_usint_to_udint : |
|
11020 { |
|
11021 symbol_c *last_type_symbol = NULL; |
|
11022 |
|
11023 { |
|
11024 identifier_c param_name("IN"); |
|
11025 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11026 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11027 |
|
11028 /* Get the value from a foo(<param_value>) style call */ |
|
11029 if (IN_param_value == NULL) |
|
11030 IN_param_value = function_call_param_iterator.next(); |
|
11031 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11032 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11033 |
|
11034 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11035 { |
|
11036 |
|
11037 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11038 return return_type_symbol; |
|
11039 |
|
11040 } |
|
11041 |
|
11042 ERROR; |
|
11043 } |
|
11044 |
|
11045 }/*function_usint_to_udint*/ |
|
11046 break; |
|
11047 |
|
11048 /**** |
|
11049 *USINT_TO_WORD |
|
11050 */ |
|
11051 case function_usint_to_word : |
|
11052 { |
|
11053 symbol_c *last_type_symbol = NULL; |
|
11054 |
|
11055 { |
|
11056 identifier_c param_name("IN"); |
|
11057 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11058 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11059 |
|
11060 /* Get the value from a foo(<param_value>) style call */ |
|
11061 if (IN_param_value == NULL) |
|
11062 IN_param_value = function_call_param_iterator.next(); |
|
11063 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11064 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11065 |
|
11066 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11067 { |
|
11068 |
|
11069 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11070 return return_type_symbol; |
|
11071 |
|
11072 } |
|
11073 |
|
11074 ERROR; |
|
11075 } |
|
11076 |
|
11077 }/*function_usint_to_word*/ |
|
11078 break; |
|
11079 |
|
11080 /**** |
|
11081 *USINT_TO_WSTRING |
|
11082 */ |
|
11083 case function_usint_to_wstring : |
|
11084 { |
|
11085 symbol_c *last_type_symbol = NULL; |
|
11086 |
|
11087 { |
|
11088 identifier_c param_name("IN"); |
|
11089 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11090 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11091 |
|
11092 /* Get the value from a foo(<param_value>) style call */ |
|
11093 if (IN_param_value == NULL) |
|
11094 IN_param_value = function_call_param_iterator.next(); |
|
11095 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11096 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11097 |
|
11098 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11099 { |
|
11100 |
|
11101 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
11102 return return_type_symbol; |
|
11103 |
|
11104 } |
|
11105 |
|
11106 ERROR; |
|
11107 } |
|
11108 |
|
11109 }/*function_usint_to_wstring*/ |
|
11110 break; |
|
11111 |
|
11112 /**** |
|
11113 *USINT_TO_STRING |
|
11114 */ |
|
11115 case function_usint_to_string : |
|
11116 { |
|
11117 symbol_c *last_type_symbol = NULL; |
|
11118 |
|
11119 { |
|
11120 identifier_c param_name("IN"); |
|
11121 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11122 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11123 |
|
11124 /* Get the value from a foo(<param_value>) style call */ |
|
11125 if (IN_param_value == NULL) |
|
11126 IN_param_value = function_call_param_iterator.next(); |
|
11127 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11128 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11129 |
|
11130 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11131 { |
|
11132 |
|
11133 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11134 return return_type_symbol; |
|
11135 |
|
11136 } |
|
11137 |
|
11138 ERROR; |
|
11139 } |
|
11140 |
|
11141 }/*function_usint_to_string*/ |
|
11142 break; |
|
11143 |
|
11144 /**** |
|
11145 *USINT_TO_LWORD |
|
11146 */ |
|
11147 case function_usint_to_lword : |
|
11148 { |
|
11149 symbol_c *last_type_symbol = NULL; |
|
11150 |
|
11151 { |
|
11152 identifier_c param_name("IN"); |
|
11153 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11154 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11155 |
|
11156 /* Get the value from a foo(<param_value>) style call */ |
|
11157 if (IN_param_value == NULL) |
|
11158 IN_param_value = function_call_param_iterator.next(); |
|
11159 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11160 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11161 |
|
11162 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11163 { |
|
11164 |
|
11165 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11166 return return_type_symbol; |
|
11167 |
|
11168 } |
|
11169 |
|
11170 ERROR; |
|
11171 } |
|
11172 |
|
11173 }/*function_usint_to_lword*/ |
|
11174 break; |
|
11175 |
|
11176 /**** |
|
11177 *USINT_TO_UINT |
|
11178 */ |
|
11179 case function_usint_to_uint : |
|
11180 { |
|
11181 symbol_c *last_type_symbol = NULL; |
|
11182 |
|
11183 { |
|
11184 identifier_c param_name("IN"); |
|
11185 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11186 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11187 |
|
11188 /* Get the value from a foo(<param_value>) style call */ |
|
11189 if (IN_param_value == NULL) |
|
11190 IN_param_value = function_call_param_iterator.next(); |
|
11191 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11192 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11193 |
|
11194 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11195 { |
|
11196 |
|
11197 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11198 return return_type_symbol; |
|
11199 |
|
11200 } |
|
11201 |
|
11202 ERROR; |
|
11203 } |
|
11204 |
|
11205 }/*function_usint_to_uint*/ |
|
11206 break; |
|
11207 |
|
11208 /**** |
|
11209 *USINT_TO_LREAL |
|
11210 */ |
|
11211 case function_usint_to_lreal : |
|
11212 { |
|
11213 symbol_c *last_type_symbol = NULL; |
|
11214 |
|
11215 { |
|
11216 identifier_c param_name("IN"); |
|
11217 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11218 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11219 |
|
11220 /* Get the value from a foo(<param_value>) style call */ |
|
11221 if (IN_param_value == NULL) |
|
11222 IN_param_value = function_call_param_iterator.next(); |
|
11223 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11224 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11225 |
|
11226 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11227 { |
|
11228 |
|
11229 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11230 return return_type_symbol; |
|
11231 |
|
11232 } |
|
11233 |
|
11234 ERROR; |
|
11235 } |
|
11236 |
|
11237 }/*function_usint_to_lreal*/ |
|
11238 break; |
|
11239 |
|
11240 /**** |
|
11241 *USINT_TO_BYTE |
|
11242 */ |
|
11243 case function_usint_to_byte : |
|
11244 { |
|
11245 symbol_c *last_type_symbol = NULL; |
|
11246 |
|
11247 { |
|
11248 identifier_c param_name("IN"); |
|
11249 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11250 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11251 |
|
11252 /* Get the value from a foo(<param_value>) style call */ |
|
11253 if (IN_param_value == NULL) |
|
11254 IN_param_value = function_call_param_iterator.next(); |
|
11255 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11256 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11257 |
|
11258 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11259 { |
|
11260 |
|
11261 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
11262 return return_type_symbol; |
|
11263 |
|
11264 } |
|
11265 |
|
11266 ERROR; |
|
11267 } |
|
11268 |
|
11269 }/*function_usint_to_byte*/ |
|
11270 break; |
|
11271 |
|
11272 /**** |
|
11273 *USINT_TO_USINT |
|
11274 */ |
|
11275 case function_usint_to_usint : |
|
11276 { |
|
11277 symbol_c *last_type_symbol = NULL; |
|
11278 |
|
11279 { |
|
11280 identifier_c param_name("IN"); |
|
11281 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11282 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11283 |
|
11284 /* Get the value from a foo(<param_value>) style call */ |
|
11285 if (IN_param_value == NULL) |
|
11286 IN_param_value = function_call_param_iterator.next(); |
|
11287 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11288 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11289 |
|
11290 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11291 { |
|
11292 |
|
11293 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11294 return return_type_symbol; |
|
11295 |
|
11296 } |
|
11297 |
|
11298 ERROR; |
|
11299 } |
|
11300 |
|
11301 }/*function_usint_to_usint*/ |
|
11302 break; |
|
11303 |
|
11304 /**** |
|
11305 *USINT_TO_ULINT |
|
11306 */ |
|
11307 case function_usint_to_ulint : |
|
11308 { |
|
11309 symbol_c *last_type_symbol = NULL; |
|
11310 |
|
11311 { |
|
11312 identifier_c param_name("IN"); |
|
11313 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11314 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11315 |
|
11316 /* Get the value from a foo(<param_value>) style call */ |
|
11317 if (IN_param_value == NULL) |
|
11318 IN_param_value = function_call_param_iterator.next(); |
|
11319 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11320 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11321 |
|
11322 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11323 { |
|
11324 |
|
11325 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11326 return return_type_symbol; |
|
11327 |
|
11328 } |
|
11329 |
|
11330 ERROR; |
|
11331 } |
|
11332 |
|
11333 }/*function_usint_to_ulint*/ |
|
11334 break; |
|
11335 |
|
11336 /**** |
|
11337 *USINT_TO_BOOL |
|
11338 */ |
|
11339 case function_usint_to_bool : |
|
11340 { |
|
11341 symbol_c *last_type_symbol = NULL; |
|
11342 |
|
11343 { |
|
11344 identifier_c param_name("IN"); |
|
11345 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11346 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11347 |
|
11348 /* Get the value from a foo(<param_value>) style call */ |
|
11349 if (IN_param_value == NULL) |
|
11350 IN_param_value = function_call_param_iterator.next(); |
|
11351 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11352 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11353 |
|
11354 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11355 { |
|
11356 |
|
11357 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
11358 return return_type_symbol; |
|
11359 |
|
11360 } |
|
11361 |
|
11362 ERROR; |
|
11363 } |
|
11364 |
|
11365 }/*function_usint_to_bool*/ |
|
11366 break; |
|
11367 |
|
11368 /**** |
|
11369 *USINT_TO_TIME |
|
11370 */ |
|
11371 case function_usint_to_time : |
|
11372 { |
|
11373 symbol_c *last_type_symbol = NULL; |
|
11374 |
|
11375 { |
|
11376 identifier_c param_name("IN"); |
|
11377 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11378 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11379 |
|
11380 /* Get the value from a foo(<param_value>) style call */ |
|
11381 if (IN_param_value == NULL) |
|
11382 IN_param_value = function_call_param_iterator.next(); |
|
11383 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11384 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11385 |
|
11386 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11387 { |
|
11388 |
|
11389 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
11390 return return_type_symbol; |
|
11391 |
|
11392 } |
|
11393 |
|
11394 ERROR; |
|
11395 } |
|
11396 |
|
11397 }/*function_usint_to_time*/ |
|
11398 break; |
|
11399 |
|
11400 /**** |
|
11401 *USINT_TO_INT |
|
11402 */ |
|
11403 case function_usint_to_int : |
|
11404 { |
|
11405 symbol_c *last_type_symbol = NULL; |
|
11406 |
|
11407 { |
|
11408 identifier_c param_name("IN"); |
|
11409 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11410 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11411 |
|
11412 /* Get the value from a foo(<param_value>) style call */ |
|
11413 if (IN_param_value == NULL) |
|
11414 IN_param_value = function_call_param_iterator.next(); |
|
11415 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11416 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11417 |
|
11418 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
11419 { |
|
11420 |
|
11421 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
11422 return return_type_symbol; |
|
11423 |
|
11424 } |
|
11425 |
|
11426 ERROR; |
|
11427 } |
|
11428 |
|
11429 }/*function_usint_to_int*/ |
|
11430 break; |
|
11431 |
|
11432 /**** |
|
11433 *ULINT_TO_REAL |
|
11434 */ |
|
11435 case function_ulint_to_real : |
|
11436 { |
|
11437 symbol_c *last_type_symbol = NULL; |
|
11438 |
|
11439 { |
|
11440 identifier_c param_name("IN"); |
|
11441 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11442 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11443 |
|
11444 /* Get the value from a foo(<param_value>) style call */ |
|
11445 if (IN_param_value == NULL) |
|
11446 IN_param_value = function_call_param_iterator.next(); |
|
11447 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11448 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11449 |
|
11450 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11451 { |
|
11452 |
|
11453 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
11454 return return_type_symbol; |
|
11455 |
|
11456 } |
|
11457 |
|
11458 ERROR; |
|
11459 } |
|
11460 |
|
11461 }/*function_ulint_to_real*/ |
|
11462 break; |
|
11463 |
|
11464 /**** |
|
11465 *ULINT_TO_SINT |
|
11466 */ |
|
11467 case function_ulint_to_sint : |
|
11468 { |
|
11469 symbol_c *last_type_symbol = NULL; |
|
11470 |
|
11471 { |
|
11472 identifier_c param_name("IN"); |
|
11473 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11474 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11475 |
|
11476 /* Get the value from a foo(<param_value>) style call */ |
|
11477 if (IN_param_value == NULL) |
|
11478 IN_param_value = function_call_param_iterator.next(); |
|
11479 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11480 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11481 |
|
11482 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11483 { |
|
11484 |
|
11485 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
11486 return return_type_symbol; |
|
11487 |
|
11488 } |
|
11489 |
|
11490 ERROR; |
|
11491 } |
|
11492 |
|
11493 }/*function_ulint_to_sint*/ |
|
11494 break; |
|
11495 |
|
11496 /**** |
|
11497 *ULINT_TO_LINT |
|
11498 */ |
|
11499 case function_ulint_to_lint : |
|
11500 { |
|
11501 symbol_c *last_type_symbol = NULL; |
|
11502 |
|
11503 { |
|
11504 identifier_c param_name("IN"); |
|
11505 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11506 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11507 |
|
11508 /* Get the value from a foo(<param_value>) style call */ |
|
11509 if (IN_param_value == NULL) |
|
11510 IN_param_value = function_call_param_iterator.next(); |
|
11511 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11512 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11513 |
|
11514 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11515 { |
|
11516 |
|
11517 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
11518 return return_type_symbol; |
|
11519 |
|
11520 } |
|
11521 |
|
11522 ERROR; |
|
11523 } |
|
11524 |
|
11525 }/*function_ulint_to_lint*/ |
|
11526 break; |
|
11527 |
|
11528 /**** |
|
11529 *ULINT_TO_DINT |
|
11530 */ |
|
11531 case function_ulint_to_dint : |
|
11532 { |
|
11533 symbol_c *last_type_symbol = NULL; |
|
11534 |
|
11535 { |
|
11536 identifier_c param_name("IN"); |
|
11537 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11538 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11539 |
|
11540 /* Get the value from a foo(<param_value>) style call */ |
|
11541 if (IN_param_value == NULL) |
|
11542 IN_param_value = function_call_param_iterator.next(); |
|
11543 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11544 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11545 |
|
11546 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11547 { |
|
11548 |
|
11549 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
11550 return return_type_symbol; |
|
11551 |
|
11552 } |
|
11553 |
|
11554 ERROR; |
|
11555 } |
|
11556 |
|
11557 }/*function_ulint_to_dint*/ |
|
11558 break; |
|
11559 |
|
11560 /**** |
|
11561 *ULINT_TO_DATE |
|
11562 */ |
|
11563 case function_ulint_to_date : |
|
11564 { |
|
11565 symbol_c *last_type_symbol = NULL; |
|
11566 |
|
11567 { |
|
11568 identifier_c param_name("IN"); |
|
11569 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11570 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11571 |
|
11572 /* Get the value from a foo(<param_value>) style call */ |
|
11573 if (IN_param_value == NULL) |
|
11574 IN_param_value = function_call_param_iterator.next(); |
|
11575 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11576 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11577 |
|
11578 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11579 { |
|
11580 |
|
11581 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11582 return return_type_symbol; |
|
11583 |
|
11584 } |
|
11585 |
|
11586 ERROR; |
|
11587 } |
|
11588 |
|
11589 }/*function_ulint_to_date*/ |
|
11590 break; |
|
11591 |
|
11592 /**** |
|
11593 *ULINT_TO_DWORD |
|
11594 */ |
|
11595 case function_ulint_to_dword : |
|
11596 { |
|
11597 symbol_c *last_type_symbol = NULL; |
|
11598 |
|
11599 { |
|
11600 identifier_c param_name("IN"); |
|
11601 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11602 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11603 |
|
11604 /* Get the value from a foo(<param_value>) style call */ |
|
11605 if (IN_param_value == NULL) |
|
11606 IN_param_value = function_call_param_iterator.next(); |
|
11607 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11608 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11609 |
|
11610 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11611 { |
|
11612 |
|
11613 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11614 return return_type_symbol; |
|
11615 |
|
11616 } |
|
11617 |
|
11618 ERROR; |
|
11619 } |
|
11620 |
|
11621 }/*function_ulint_to_dword*/ |
|
11622 break; |
|
11623 |
|
11624 /**** |
|
11625 *ULINT_TO_DT |
|
11626 */ |
|
11627 case function_ulint_to_dt : |
|
11628 { |
|
11629 symbol_c *last_type_symbol = NULL; |
|
11630 |
|
11631 { |
|
11632 identifier_c param_name("IN"); |
|
11633 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11634 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11635 |
|
11636 /* Get the value from a foo(<param_value>) style call */ |
|
11637 if (IN_param_value == NULL) |
|
11638 IN_param_value = function_call_param_iterator.next(); |
|
11639 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11640 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11641 |
|
11642 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11643 { |
|
11644 |
|
11645 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11646 return return_type_symbol; |
|
11647 |
|
11648 } |
|
11649 |
|
11650 ERROR; |
|
11651 } |
|
11652 |
|
11653 }/*function_ulint_to_dt*/ |
|
11654 break; |
|
11655 |
|
11656 /**** |
|
11657 *ULINT_TO_TOD |
|
11658 */ |
|
11659 case function_ulint_to_tod : |
|
11660 { |
|
11661 symbol_c *last_type_symbol = NULL; |
|
11662 |
|
11663 { |
|
11664 identifier_c param_name("IN"); |
|
11665 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11666 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11667 |
|
11668 /* Get the value from a foo(<param_value>) style call */ |
|
11669 if (IN_param_value == NULL) |
|
11670 IN_param_value = function_call_param_iterator.next(); |
|
11671 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11672 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11673 |
|
11674 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11675 { |
|
11676 |
|
11677 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11678 return return_type_symbol; |
|
11679 |
|
11680 } |
|
11681 |
|
11682 ERROR; |
|
11683 } |
|
11684 |
|
11685 }/*function_ulint_to_tod*/ |
|
11686 break; |
|
11687 |
|
11688 /**** |
|
11689 *ULINT_TO_UDINT |
|
11690 */ |
|
11691 case function_ulint_to_udint : |
|
11692 { |
|
11693 symbol_c *last_type_symbol = NULL; |
|
11694 |
|
11695 { |
|
11696 identifier_c param_name("IN"); |
|
11697 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11698 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11699 |
|
11700 /* Get the value from a foo(<param_value>) style call */ |
|
11701 if (IN_param_value == NULL) |
|
11702 IN_param_value = function_call_param_iterator.next(); |
|
11703 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11704 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11705 |
|
11706 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11707 { |
|
11708 |
|
11709 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11710 return return_type_symbol; |
|
11711 |
|
11712 } |
|
11713 |
|
11714 ERROR; |
|
11715 } |
|
11716 |
|
11717 }/*function_ulint_to_udint*/ |
|
11718 break; |
|
11719 |
|
11720 /**** |
|
11721 *ULINT_TO_WORD |
|
11722 */ |
|
11723 case function_ulint_to_word : |
|
11724 { |
|
11725 symbol_c *last_type_symbol = NULL; |
|
11726 |
|
11727 { |
|
11728 identifier_c param_name("IN"); |
|
11729 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11730 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11731 |
|
11732 /* Get the value from a foo(<param_value>) style call */ |
|
11733 if (IN_param_value == NULL) |
|
11734 IN_param_value = function_call_param_iterator.next(); |
|
11735 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11736 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11737 |
|
11738 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11739 { |
|
11740 |
|
11741 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11742 return return_type_symbol; |
|
11743 |
|
11744 } |
|
11745 |
|
11746 ERROR; |
|
11747 } |
|
11748 |
|
11749 }/*function_ulint_to_word*/ |
|
11750 break; |
|
11751 |
|
11752 /**** |
|
11753 *ULINT_TO_WSTRING |
|
11754 */ |
|
11755 case function_ulint_to_wstring : |
|
11756 { |
|
11757 symbol_c *last_type_symbol = NULL; |
|
11758 |
|
11759 { |
|
11760 identifier_c param_name("IN"); |
|
11761 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11762 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11763 |
|
11764 /* Get the value from a foo(<param_value>) style call */ |
|
11765 if (IN_param_value == NULL) |
|
11766 IN_param_value = function_call_param_iterator.next(); |
|
11767 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11768 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11769 |
|
11770 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11771 { |
|
11772 |
|
11773 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
11774 return return_type_symbol; |
|
11775 |
|
11776 } |
|
11777 |
|
11778 ERROR; |
|
11779 } |
|
11780 |
|
11781 }/*function_ulint_to_wstring*/ |
|
11782 break; |
|
11783 |
|
11784 /**** |
|
11785 *ULINT_TO_STRING |
|
11786 */ |
|
11787 case function_ulint_to_string : |
|
11788 { |
|
11789 symbol_c *last_type_symbol = NULL; |
|
11790 |
|
11791 { |
|
11792 identifier_c param_name("IN"); |
|
11793 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11794 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11795 |
|
11796 /* Get the value from a foo(<param_value>) style call */ |
|
11797 if (IN_param_value == NULL) |
|
11798 IN_param_value = function_call_param_iterator.next(); |
|
11799 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11800 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11801 |
|
11802 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11803 { |
|
11804 |
|
11805 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11806 return return_type_symbol; |
|
11807 |
|
11808 } |
|
11809 |
|
11810 ERROR; |
|
11811 } |
|
11812 |
|
11813 }/*function_ulint_to_string*/ |
|
11814 break; |
|
11815 |
|
11816 /**** |
|
11817 *ULINT_TO_LWORD |
|
11818 */ |
|
11819 case function_ulint_to_lword : |
|
11820 { |
|
11821 symbol_c *last_type_symbol = NULL; |
|
11822 |
|
11823 { |
|
11824 identifier_c param_name("IN"); |
|
11825 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11826 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11827 |
|
11828 /* Get the value from a foo(<param_value>) style call */ |
|
11829 if (IN_param_value == NULL) |
|
11830 IN_param_value = function_call_param_iterator.next(); |
|
11831 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11832 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11833 |
|
11834 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11835 { |
|
11836 |
|
11837 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11838 return return_type_symbol; |
|
11839 |
|
11840 } |
|
11841 |
|
11842 ERROR; |
|
11843 } |
|
11844 |
|
11845 }/*function_ulint_to_lword*/ |
|
11846 break; |
|
11847 |
|
11848 /**** |
|
11849 *ULINT_TO_UINT |
|
11850 */ |
|
11851 case function_ulint_to_uint : |
|
11852 { |
|
11853 symbol_c *last_type_symbol = NULL; |
|
11854 |
|
11855 { |
|
11856 identifier_c param_name("IN"); |
|
11857 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11858 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11859 |
|
11860 /* Get the value from a foo(<param_value>) style call */ |
|
11861 if (IN_param_value == NULL) |
|
11862 IN_param_value = function_call_param_iterator.next(); |
|
11863 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11864 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11865 |
|
11866 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11867 { |
|
11868 |
|
11869 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11870 return return_type_symbol; |
|
11871 |
|
11872 } |
|
11873 |
|
11874 ERROR; |
|
11875 } |
|
11876 |
|
11877 }/*function_ulint_to_uint*/ |
|
11878 break; |
|
11879 |
|
11880 /**** |
|
11881 *ULINT_TO_LREAL |
|
11882 */ |
|
11883 case function_ulint_to_lreal : |
|
11884 { |
|
11885 symbol_c *last_type_symbol = NULL; |
|
11886 |
|
11887 { |
|
11888 identifier_c param_name("IN"); |
|
11889 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11890 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11891 |
|
11892 /* Get the value from a foo(<param_value>) style call */ |
|
11893 if (IN_param_value == NULL) |
|
11894 IN_param_value = function_call_param_iterator.next(); |
|
11895 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11896 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11897 |
|
11898 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11899 { |
|
11900 |
|
11901 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11902 return return_type_symbol; |
|
11903 |
|
11904 } |
|
11905 |
|
11906 ERROR; |
|
11907 } |
|
11908 |
|
11909 }/*function_ulint_to_lreal*/ |
|
11910 break; |
|
11911 |
|
11912 /**** |
|
11913 *ULINT_TO_BYTE |
|
11914 */ |
|
11915 case function_ulint_to_byte : |
|
11916 { |
|
11917 symbol_c *last_type_symbol = NULL; |
|
11918 |
|
11919 { |
|
11920 identifier_c param_name("IN"); |
|
11921 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11922 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11923 |
|
11924 /* Get the value from a foo(<param_value>) style call */ |
|
11925 if (IN_param_value == NULL) |
|
11926 IN_param_value = function_call_param_iterator.next(); |
|
11927 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11928 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11929 |
|
11930 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11931 { |
|
11932 |
|
11933 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
11934 return return_type_symbol; |
|
11935 |
|
11936 } |
|
11937 |
|
11938 ERROR; |
|
11939 } |
|
11940 |
|
11941 }/*function_ulint_to_byte*/ |
|
11942 break; |
|
11943 |
|
11944 /**** |
|
11945 *ULINT_TO_USINT |
|
11946 */ |
|
11947 case function_ulint_to_usint : |
|
11948 { |
|
11949 symbol_c *last_type_symbol = NULL; |
|
11950 |
|
11951 { |
|
11952 identifier_c param_name("IN"); |
|
11953 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11954 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11955 |
|
11956 /* Get the value from a foo(<param_value>) style call */ |
|
11957 if (IN_param_value == NULL) |
|
11958 IN_param_value = function_call_param_iterator.next(); |
|
11959 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11960 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11961 |
|
11962 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11963 { |
|
11964 |
|
11965 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11966 return return_type_symbol; |
|
11967 |
|
11968 } |
|
11969 |
|
11970 ERROR; |
|
11971 } |
|
11972 |
|
11973 }/*function_ulint_to_usint*/ |
|
11974 break; |
|
11975 |
|
11976 /**** |
|
11977 *ULINT_TO_ULINT |
|
11978 */ |
|
11979 case function_ulint_to_ulint : |
|
11980 { |
|
11981 symbol_c *last_type_symbol = NULL; |
|
11982 |
|
11983 { |
|
11984 identifier_c param_name("IN"); |
|
11985 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11986 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
11987 |
|
11988 /* Get the value from a foo(<param_value>) style call */ |
|
11989 if (IN_param_value == NULL) |
|
11990 IN_param_value = function_call_param_iterator.next(); |
|
11991 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
11992 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
11993 |
|
11994 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
11995 { |
|
11996 |
|
11997 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11998 return return_type_symbol; |
|
11999 |
|
12000 } |
|
12001 |
|
12002 ERROR; |
|
12003 } |
|
12004 |
|
12005 }/*function_ulint_to_ulint*/ |
|
12006 break; |
|
12007 |
|
12008 /**** |
|
12009 *ULINT_TO_BOOL |
|
12010 */ |
|
12011 case function_ulint_to_bool : |
|
12012 { |
|
12013 symbol_c *last_type_symbol = NULL; |
|
12014 |
|
12015 { |
|
12016 identifier_c param_name("IN"); |
|
12017 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12018 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12019 |
|
12020 /* Get the value from a foo(<param_value>) style call */ |
|
12021 if (IN_param_value == NULL) |
|
12022 IN_param_value = function_call_param_iterator.next(); |
|
12023 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12024 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12025 |
|
12026 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
12027 { |
|
12028 |
|
12029 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
12030 return return_type_symbol; |
|
12031 |
|
12032 } |
|
12033 |
|
12034 ERROR; |
|
12035 } |
|
12036 |
|
12037 }/*function_ulint_to_bool*/ |
|
12038 break; |
|
12039 |
|
12040 /**** |
|
12041 *ULINT_TO_TIME |
|
12042 */ |
|
12043 case function_ulint_to_time : |
|
12044 { |
|
12045 symbol_c *last_type_symbol = NULL; |
|
12046 |
|
12047 { |
|
12048 identifier_c param_name("IN"); |
|
12049 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12050 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12051 |
|
12052 /* Get the value from a foo(<param_value>) style call */ |
|
12053 if (IN_param_value == NULL) |
|
12054 IN_param_value = function_call_param_iterator.next(); |
|
12055 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12056 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12057 |
|
12058 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
12059 { |
|
12060 |
|
12061 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12062 return return_type_symbol; |
|
12063 |
|
12064 } |
|
12065 |
|
12066 ERROR; |
|
12067 } |
|
12068 |
|
12069 }/*function_ulint_to_time*/ |
|
12070 break; |
|
12071 |
|
12072 /**** |
|
12073 *ULINT_TO_INT |
|
12074 */ |
|
12075 case function_ulint_to_int : |
|
12076 { |
|
12077 symbol_c *last_type_symbol = NULL; |
|
12078 |
|
12079 { |
|
12080 identifier_c param_name("IN"); |
|
12081 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12082 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12083 |
|
12084 /* Get the value from a foo(<param_value>) style call */ |
|
12085 if (IN_param_value == NULL) |
|
12086 IN_param_value = function_call_param_iterator.next(); |
|
12087 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12088 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12089 |
|
12090 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
12091 { |
|
12092 |
|
12093 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
12094 return return_type_symbol; |
|
12095 |
|
12096 } |
|
12097 |
|
12098 ERROR; |
|
12099 } |
|
12100 |
|
12101 }/*function_ulint_to_int*/ |
|
12102 break; |
|
12103 |
|
12104 /**** |
|
12105 *BOOL_TO_REAL |
|
12106 */ |
|
12107 case function_bool_to_real : |
|
12108 { |
|
12109 symbol_c *last_type_symbol = NULL; |
|
12110 |
|
12111 { |
|
12112 identifier_c param_name("IN"); |
|
12113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12114 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12115 |
|
12116 /* Get the value from a foo(<param_value>) style call */ |
|
12117 if (IN_param_value == NULL) |
|
12118 IN_param_value = function_call_param_iterator.next(); |
|
12119 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12120 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12121 |
|
12122 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12123 { |
|
12124 |
|
12125 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
12126 return return_type_symbol; |
|
12127 |
|
12128 } |
|
12129 |
|
12130 ERROR; |
|
12131 } |
|
12132 |
|
12133 }/*function_bool_to_real*/ |
|
12134 break; |
|
12135 |
|
12136 /**** |
|
12137 *BOOL_TO_SINT |
|
12138 */ |
|
12139 case function_bool_to_sint : |
|
12140 { |
|
12141 symbol_c *last_type_symbol = NULL; |
|
12142 |
|
12143 { |
|
12144 identifier_c param_name("IN"); |
|
12145 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12146 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12147 |
|
12148 /* Get the value from a foo(<param_value>) style call */ |
|
12149 if (IN_param_value == NULL) |
|
12150 IN_param_value = function_call_param_iterator.next(); |
|
12151 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12152 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12153 |
|
12154 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12155 { |
|
12156 |
|
12157 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
12158 return return_type_symbol; |
|
12159 |
|
12160 } |
|
12161 |
|
12162 ERROR; |
|
12163 } |
|
12164 |
|
12165 }/*function_bool_to_sint*/ |
|
12166 break; |
|
12167 |
|
12168 /**** |
|
12169 *BOOL_TO_LINT |
|
12170 */ |
|
12171 case function_bool_to_lint : |
|
12172 { |
|
12173 symbol_c *last_type_symbol = NULL; |
|
12174 |
|
12175 { |
|
12176 identifier_c param_name("IN"); |
|
12177 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12178 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12179 |
|
12180 /* Get the value from a foo(<param_value>) style call */ |
|
12181 if (IN_param_value == NULL) |
|
12182 IN_param_value = function_call_param_iterator.next(); |
|
12183 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12184 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12185 |
|
12186 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12187 { |
|
12188 |
|
12189 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
12190 return return_type_symbol; |
|
12191 |
|
12192 } |
|
12193 |
|
12194 ERROR; |
|
12195 } |
|
12196 |
|
12197 }/*function_bool_to_lint*/ |
|
12198 break; |
|
12199 |
|
12200 /**** |
|
12201 *BOOL_TO_DINT |
|
12202 */ |
|
12203 case function_bool_to_dint : |
|
12204 { |
|
12205 symbol_c *last_type_symbol = NULL; |
|
12206 |
|
12207 { |
|
12208 identifier_c param_name("IN"); |
|
12209 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12210 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12211 |
|
12212 /* Get the value from a foo(<param_value>) style call */ |
|
12213 if (IN_param_value == NULL) |
|
12214 IN_param_value = function_call_param_iterator.next(); |
|
12215 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12216 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12217 |
|
12218 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12219 { |
|
12220 |
|
12221 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
12222 return return_type_symbol; |
|
12223 |
|
12224 } |
|
12225 |
|
12226 ERROR; |
|
12227 } |
|
12228 |
|
12229 }/*function_bool_to_dint*/ |
|
12230 break; |
|
12231 |
|
12232 /**** |
|
12233 *BOOL_TO_DATE |
|
12234 */ |
|
12235 case function_bool_to_date : |
|
12236 { |
|
12237 symbol_c *last_type_symbol = NULL; |
|
12238 |
|
12239 { |
|
12240 identifier_c param_name("IN"); |
|
12241 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12242 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12243 |
|
12244 /* Get the value from a foo(<param_value>) style call */ |
|
12245 if (IN_param_value == NULL) |
|
12246 IN_param_value = function_call_param_iterator.next(); |
|
12247 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12248 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12249 |
|
12250 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12251 { |
|
12252 |
|
12253 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
12254 return return_type_symbol; |
|
12255 |
|
12256 } |
|
12257 |
|
12258 ERROR; |
|
12259 } |
|
12260 |
|
12261 }/*function_bool_to_date*/ |
|
12262 break; |
|
12263 |
|
12264 /**** |
|
12265 *BOOL_TO_DWORD |
|
12266 */ |
|
12267 case function_bool_to_dword : |
|
12268 { |
|
12269 symbol_c *last_type_symbol = NULL; |
|
12270 |
|
12271 { |
|
12272 identifier_c param_name("IN"); |
|
12273 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12274 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12275 |
|
12276 /* Get the value from a foo(<param_value>) style call */ |
|
12277 if (IN_param_value == NULL) |
|
12278 IN_param_value = function_call_param_iterator.next(); |
|
12279 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12280 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12281 |
|
12282 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12283 { |
|
12284 |
|
12285 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
12286 return return_type_symbol; |
|
12287 |
|
12288 } |
|
12289 |
|
12290 ERROR; |
|
12291 } |
|
12292 |
|
12293 }/*function_bool_to_dword*/ |
|
12294 break; |
|
12295 |
|
12296 /**** |
|
12297 *BOOL_TO_DT |
|
12298 */ |
|
12299 case function_bool_to_dt : |
|
12300 { |
|
12301 symbol_c *last_type_symbol = NULL; |
|
12302 |
|
12303 { |
|
12304 identifier_c param_name("IN"); |
|
12305 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12306 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12307 |
|
12308 /* Get the value from a foo(<param_value>) style call */ |
|
12309 if (IN_param_value == NULL) |
|
12310 IN_param_value = function_call_param_iterator.next(); |
|
12311 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12312 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12313 |
|
12314 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12315 { |
|
12316 |
|
12317 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12318 return return_type_symbol; |
|
12319 |
|
12320 } |
|
12321 |
|
12322 ERROR; |
|
12323 } |
|
12324 |
|
12325 }/*function_bool_to_dt*/ |
|
12326 break; |
|
12327 |
|
12328 /**** |
|
12329 *BOOL_TO_TOD |
|
12330 */ |
|
12331 case function_bool_to_tod : |
|
12332 { |
|
12333 symbol_c *last_type_symbol = NULL; |
|
12334 |
|
12335 { |
|
12336 identifier_c param_name("IN"); |
|
12337 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12338 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12339 |
|
12340 /* Get the value from a foo(<param_value>) style call */ |
|
12341 if (IN_param_value == NULL) |
|
12342 IN_param_value = function_call_param_iterator.next(); |
|
12343 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12344 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12345 |
|
12346 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12347 { |
|
12348 |
|
12349 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12350 return return_type_symbol; |
|
12351 |
|
12352 } |
|
12353 |
|
12354 ERROR; |
|
12355 } |
|
12356 |
|
12357 }/*function_bool_to_tod*/ |
|
12358 break; |
|
12359 |
|
12360 /**** |
|
12361 *BOOL_TO_UDINT |
|
12362 */ |
|
12363 case function_bool_to_udint : |
|
12364 { |
|
12365 symbol_c *last_type_symbol = NULL; |
|
12366 |
|
12367 { |
|
12368 identifier_c param_name("IN"); |
|
12369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12370 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12371 |
|
12372 /* Get the value from a foo(<param_value>) style call */ |
|
12373 if (IN_param_value == NULL) |
|
12374 IN_param_value = function_call_param_iterator.next(); |
|
12375 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12376 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12377 |
|
12378 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12379 { |
|
12380 |
|
12381 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
12382 return return_type_symbol; |
|
12383 |
|
12384 } |
|
12385 |
|
12386 ERROR; |
|
12387 } |
|
12388 |
|
12389 }/*function_bool_to_udint*/ |
|
12390 break; |
|
12391 |
|
12392 /**** |
|
12393 *BOOL_TO_WORD |
|
12394 */ |
|
12395 case function_bool_to_word : |
|
12396 { |
|
12397 symbol_c *last_type_symbol = NULL; |
|
12398 |
|
12399 { |
|
12400 identifier_c param_name("IN"); |
|
12401 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12402 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12403 |
|
12404 /* Get the value from a foo(<param_value>) style call */ |
|
12405 if (IN_param_value == NULL) |
|
12406 IN_param_value = function_call_param_iterator.next(); |
|
12407 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12408 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12409 |
|
12410 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12411 { |
|
12412 |
|
12413 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
12414 return return_type_symbol; |
|
12415 |
|
12416 } |
|
12417 |
|
12418 ERROR; |
|
12419 } |
|
12420 |
|
12421 }/*function_bool_to_word*/ |
|
12422 break; |
|
12423 |
|
12424 /**** |
|
12425 *BOOL_TO_WSTRING |
|
12426 */ |
|
12427 case function_bool_to_wstring : |
|
12428 { |
|
12429 symbol_c *last_type_symbol = NULL; |
|
12430 |
|
12431 { |
|
12432 identifier_c param_name("IN"); |
|
12433 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12434 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12435 |
|
12436 /* Get the value from a foo(<param_value>) style call */ |
|
12437 if (IN_param_value == NULL) |
|
12438 IN_param_value = function_call_param_iterator.next(); |
|
12439 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12440 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12441 |
|
12442 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12443 { |
|
12444 |
|
12445 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
12446 return return_type_symbol; |
|
12447 |
|
12448 } |
|
12449 |
|
12450 ERROR; |
|
12451 } |
|
12452 |
|
12453 }/*function_bool_to_wstring*/ |
|
12454 break; |
|
12455 |
|
12456 /**** |
|
12457 *BOOL_TO_STRING |
|
12458 */ |
|
12459 case function_bool_to_string : |
|
12460 { |
|
12461 symbol_c *last_type_symbol = NULL; |
|
12462 |
|
12463 { |
|
12464 identifier_c param_name("IN"); |
|
12465 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12466 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12467 |
|
12468 /* Get the value from a foo(<param_value>) style call */ |
|
12469 if (IN_param_value == NULL) |
|
12470 IN_param_value = function_call_param_iterator.next(); |
|
12471 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12472 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12473 |
|
12474 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12475 { |
|
12476 |
|
12477 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
12478 return return_type_symbol; |
|
12479 |
|
12480 } |
|
12481 |
|
12482 ERROR; |
|
12483 } |
|
12484 |
|
12485 }/*function_bool_to_string*/ |
|
12486 break; |
|
12487 |
|
12488 /**** |
|
12489 *BOOL_TO_LWORD |
|
12490 */ |
|
12491 case function_bool_to_lword : |
|
12492 { |
|
12493 symbol_c *last_type_symbol = NULL; |
|
12494 |
|
12495 { |
|
12496 identifier_c param_name("IN"); |
|
12497 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12498 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12499 |
|
12500 /* Get the value from a foo(<param_value>) style call */ |
|
12501 if (IN_param_value == NULL) |
|
12502 IN_param_value = function_call_param_iterator.next(); |
|
12503 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12504 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12505 |
|
12506 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12507 { |
|
12508 |
|
12509 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
12510 return return_type_symbol; |
|
12511 |
|
12512 } |
|
12513 |
|
12514 ERROR; |
|
12515 } |
|
12516 |
|
12517 }/*function_bool_to_lword*/ |
|
12518 break; |
|
12519 |
|
12520 /**** |
|
12521 *BOOL_TO_UINT |
|
12522 */ |
|
12523 case function_bool_to_uint : |
|
12524 { |
|
12525 symbol_c *last_type_symbol = NULL; |
|
12526 |
|
12527 { |
|
12528 identifier_c param_name("IN"); |
|
12529 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12530 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12531 |
|
12532 /* Get the value from a foo(<param_value>) style call */ |
|
12533 if (IN_param_value == NULL) |
|
12534 IN_param_value = function_call_param_iterator.next(); |
|
12535 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12536 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12537 |
|
12538 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12539 { |
|
12540 |
|
12541 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
12542 return return_type_symbol; |
|
12543 |
|
12544 } |
|
12545 |
|
12546 ERROR; |
|
12547 } |
|
12548 |
|
12549 }/*function_bool_to_uint*/ |
|
12550 break; |
|
12551 |
|
12552 /**** |
|
12553 *BOOL_TO_LREAL |
|
12554 */ |
|
12555 case function_bool_to_lreal : |
|
12556 { |
|
12557 symbol_c *last_type_symbol = NULL; |
|
12558 |
|
12559 { |
|
12560 identifier_c param_name("IN"); |
|
12561 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12562 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12563 |
|
12564 /* Get the value from a foo(<param_value>) style call */ |
|
12565 if (IN_param_value == NULL) |
|
12566 IN_param_value = function_call_param_iterator.next(); |
|
12567 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12568 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12569 |
|
12570 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12571 { |
|
12572 |
|
12573 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
12574 return return_type_symbol; |
|
12575 |
|
12576 } |
|
12577 |
|
12578 ERROR; |
|
12579 } |
|
12580 |
|
12581 }/*function_bool_to_lreal*/ |
|
12582 break; |
|
12583 |
|
12584 /**** |
|
12585 *BOOL_TO_BYTE |
|
12586 */ |
|
12587 case function_bool_to_byte : |
|
12588 { |
|
12589 symbol_c *last_type_symbol = NULL; |
|
12590 |
|
12591 { |
|
12592 identifier_c param_name("IN"); |
|
12593 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12594 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12595 |
|
12596 /* Get the value from a foo(<param_value>) style call */ |
|
12597 if (IN_param_value == NULL) |
|
12598 IN_param_value = function_call_param_iterator.next(); |
|
12599 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12601 |
|
12602 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12603 { |
|
12604 |
|
12605 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
12606 return return_type_symbol; |
|
12607 |
|
12608 } |
|
12609 |
|
12610 ERROR; |
|
12611 } |
|
12612 |
|
12613 }/*function_bool_to_byte*/ |
|
12614 break; |
|
12615 |
|
12616 /**** |
|
12617 *BOOL_TO_USINT |
|
12618 */ |
|
12619 case function_bool_to_usint : |
|
12620 { |
|
12621 symbol_c *last_type_symbol = NULL; |
|
12622 |
|
12623 { |
|
12624 identifier_c param_name("IN"); |
|
12625 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12626 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12627 |
|
12628 /* Get the value from a foo(<param_value>) style call */ |
|
12629 if (IN_param_value == NULL) |
|
12630 IN_param_value = function_call_param_iterator.next(); |
|
12631 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12632 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12633 |
|
12634 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12635 { |
|
12636 |
|
12637 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
12638 return return_type_symbol; |
|
12639 |
|
12640 } |
|
12641 |
|
12642 ERROR; |
|
12643 } |
|
12644 |
|
12645 }/*function_bool_to_usint*/ |
|
12646 break; |
|
12647 |
|
12648 /**** |
|
12649 *BOOL_TO_ULINT |
|
12650 */ |
|
12651 case function_bool_to_ulint : |
|
12652 { |
|
12653 symbol_c *last_type_symbol = NULL; |
|
12654 |
|
12655 { |
|
12656 identifier_c param_name("IN"); |
|
12657 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12658 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12659 |
|
12660 /* Get the value from a foo(<param_value>) style call */ |
|
12661 if (IN_param_value == NULL) |
|
12662 IN_param_value = function_call_param_iterator.next(); |
|
12663 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12664 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12665 |
|
12666 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12667 { |
|
12668 |
|
12669 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
12670 return return_type_symbol; |
|
12671 |
|
12672 } |
|
12673 |
|
12674 ERROR; |
|
12675 } |
|
12676 |
|
12677 }/*function_bool_to_ulint*/ |
|
12678 break; |
|
12679 |
|
12680 /**** |
|
12681 *BOOL_TO_BOOL |
|
12682 */ |
|
12683 case function_bool_to_bool : |
|
12684 { |
|
12685 symbol_c *last_type_symbol = NULL; |
|
12686 |
|
12687 { |
|
12688 identifier_c param_name("IN"); |
|
12689 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12690 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12691 |
|
12692 /* Get the value from a foo(<param_value>) style call */ |
|
12693 if (IN_param_value == NULL) |
|
12694 IN_param_value = function_call_param_iterator.next(); |
|
12695 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12696 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12697 |
|
12698 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12699 { |
|
12700 |
|
12701 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
12702 return return_type_symbol; |
|
12703 |
|
12704 } |
|
12705 |
|
12706 ERROR; |
|
12707 } |
|
12708 |
|
12709 }/*function_bool_to_bool*/ |
|
12710 break; |
|
12711 |
|
12712 /**** |
|
12713 *BOOL_TO_TIME |
|
12714 */ |
|
12715 case function_bool_to_time : |
|
12716 { |
|
12717 symbol_c *last_type_symbol = NULL; |
|
12718 |
|
12719 { |
|
12720 identifier_c param_name("IN"); |
|
12721 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12722 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12723 |
|
12724 /* Get the value from a foo(<param_value>) style call */ |
|
12725 if (IN_param_value == NULL) |
|
12726 IN_param_value = function_call_param_iterator.next(); |
|
12727 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12728 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12729 |
|
12730 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12731 { |
|
12732 |
|
12733 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12734 return return_type_symbol; |
|
12735 |
|
12736 } |
|
12737 |
|
12738 ERROR; |
|
12739 } |
|
12740 |
|
12741 }/*function_bool_to_time*/ |
|
12742 break; |
|
12743 |
|
12744 /**** |
|
12745 *BOOL_TO_INT |
|
12746 */ |
|
12747 case function_bool_to_int : |
|
12748 { |
|
12749 symbol_c *last_type_symbol = NULL; |
|
12750 |
|
12751 { |
|
12752 identifier_c param_name("IN"); |
|
12753 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12754 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12755 |
|
12756 /* Get the value from a foo(<param_value>) style call */ |
|
12757 if (IN_param_value == NULL) |
|
12758 IN_param_value = function_call_param_iterator.next(); |
|
12759 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12760 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12761 |
|
12762 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
12763 { |
|
12764 |
|
12765 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
12766 return return_type_symbol; |
|
12767 |
|
12768 } |
|
12769 |
|
12770 ERROR; |
|
12771 } |
|
12772 |
|
12773 }/*function_bool_to_int*/ |
|
12774 break; |
|
12775 |
|
12776 /**** |
|
12777 *TIME_TO_REAL |
|
12778 */ |
|
12779 case function_time_to_real : |
|
12780 { |
|
12781 symbol_c *last_type_symbol = NULL; |
|
12782 |
|
12783 { |
|
12784 identifier_c param_name("IN"); |
|
12785 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12786 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12787 |
|
12788 /* Get the value from a foo(<param_value>) style call */ |
|
12789 if (IN_param_value == NULL) |
|
12790 IN_param_value = function_call_param_iterator.next(); |
|
12791 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12792 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12793 |
|
12794 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12795 { |
|
12796 |
|
12797 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
12798 return return_type_symbol; |
|
12799 |
|
12800 } |
|
12801 |
|
12802 ERROR; |
|
12803 } |
|
12804 |
|
12805 }/*function_time_to_real*/ |
|
12806 break; |
|
12807 |
|
12808 /**** |
|
12809 *TIME_TO_SINT |
|
12810 */ |
|
12811 case function_time_to_sint : |
|
12812 { |
|
12813 symbol_c *last_type_symbol = NULL; |
|
12814 |
|
12815 { |
|
12816 identifier_c param_name("IN"); |
|
12817 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12818 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12819 |
|
12820 /* Get the value from a foo(<param_value>) style call */ |
|
12821 if (IN_param_value == NULL) |
|
12822 IN_param_value = function_call_param_iterator.next(); |
|
12823 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12824 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12825 |
|
12826 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12827 { |
|
12828 |
|
12829 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
12830 return return_type_symbol; |
|
12831 |
|
12832 } |
|
12833 |
|
12834 ERROR; |
|
12835 } |
|
12836 |
|
12837 }/*function_time_to_sint*/ |
|
12838 break; |
|
12839 |
|
12840 /**** |
|
12841 *TIME_TO_LINT |
|
12842 */ |
|
12843 case function_time_to_lint : |
|
12844 { |
|
12845 symbol_c *last_type_symbol = NULL; |
|
12846 |
|
12847 { |
|
12848 identifier_c param_name("IN"); |
|
12849 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12850 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12851 |
|
12852 /* Get the value from a foo(<param_value>) style call */ |
|
12853 if (IN_param_value == NULL) |
|
12854 IN_param_value = function_call_param_iterator.next(); |
|
12855 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12856 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12857 |
|
12858 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12859 { |
|
12860 |
|
12861 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
12862 return return_type_symbol; |
|
12863 |
|
12864 } |
|
12865 |
|
12866 ERROR; |
|
12867 } |
|
12868 |
|
12869 }/*function_time_to_lint*/ |
|
12870 break; |
|
12871 |
|
12872 /**** |
|
12873 *TIME_TO_DINT |
|
12874 */ |
|
12875 case function_time_to_dint : |
|
12876 { |
|
12877 symbol_c *last_type_symbol = NULL; |
|
12878 |
|
12879 { |
|
12880 identifier_c param_name("IN"); |
|
12881 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12882 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12883 |
|
12884 /* Get the value from a foo(<param_value>) style call */ |
|
12885 if (IN_param_value == NULL) |
|
12886 IN_param_value = function_call_param_iterator.next(); |
|
12887 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12888 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12889 |
|
12890 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12891 { |
|
12892 |
|
12893 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
12894 return return_type_symbol; |
|
12895 |
|
12896 } |
|
12897 |
|
12898 ERROR; |
|
12899 } |
|
12900 |
|
12901 }/*function_time_to_dint*/ |
|
12902 break; |
|
12903 |
|
12904 /**** |
|
12905 *TIME_TO_DATE |
|
12906 */ |
|
12907 case function_time_to_date : |
|
12908 { |
|
12909 symbol_c *last_type_symbol = NULL; |
|
12910 |
|
12911 { |
|
12912 identifier_c param_name("IN"); |
|
12913 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12914 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12915 |
|
12916 /* Get the value from a foo(<param_value>) style call */ |
|
12917 if (IN_param_value == NULL) |
|
12918 IN_param_value = function_call_param_iterator.next(); |
|
12919 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12920 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12921 |
|
12922 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12923 { |
|
12924 |
|
12925 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
12926 return return_type_symbol; |
|
12927 |
|
12928 } |
|
12929 |
|
12930 ERROR; |
|
12931 } |
|
12932 |
|
12933 }/*function_time_to_date*/ |
|
12934 break; |
|
12935 |
|
12936 /**** |
|
12937 *TIME_TO_DWORD |
|
12938 */ |
|
12939 case function_time_to_dword : |
|
12940 { |
|
12941 symbol_c *last_type_symbol = NULL; |
|
12942 |
|
12943 { |
|
12944 identifier_c param_name("IN"); |
|
12945 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12946 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12947 |
|
12948 /* Get the value from a foo(<param_value>) style call */ |
|
12949 if (IN_param_value == NULL) |
|
12950 IN_param_value = function_call_param_iterator.next(); |
|
12951 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12952 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12953 |
|
12954 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12955 { |
|
12956 |
|
12957 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
12958 return return_type_symbol; |
|
12959 |
|
12960 } |
|
12961 |
|
12962 ERROR; |
|
12963 } |
|
12964 |
|
12965 }/*function_time_to_dword*/ |
|
12966 break; |
|
12967 |
|
12968 /**** |
|
12969 *TIME_TO_DT |
|
12970 */ |
|
12971 case function_time_to_dt : |
|
12972 { |
|
12973 symbol_c *last_type_symbol = NULL; |
|
12974 |
|
12975 { |
|
12976 identifier_c param_name("IN"); |
|
12977 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12978 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
12979 |
|
12980 /* Get the value from a foo(<param_value>) style call */ |
|
12981 if (IN_param_value == NULL) |
|
12982 IN_param_value = function_call_param_iterator.next(); |
|
12983 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
12984 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
12985 |
|
12986 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
12987 { |
|
12988 |
|
12989 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12990 return return_type_symbol; |
|
12991 |
|
12992 } |
|
12993 |
|
12994 ERROR; |
|
12995 } |
|
12996 |
|
12997 }/*function_time_to_dt*/ |
|
12998 break; |
|
12999 |
|
13000 /**** |
|
13001 *TIME_TO_TOD |
|
13002 */ |
|
13003 case function_time_to_tod : |
|
13004 { |
|
13005 symbol_c *last_type_symbol = NULL; |
|
13006 |
|
13007 { |
|
13008 identifier_c param_name("IN"); |
|
13009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13010 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13011 |
|
13012 /* Get the value from a foo(<param_value>) style call */ |
|
13013 if (IN_param_value == NULL) |
|
13014 IN_param_value = function_call_param_iterator.next(); |
|
13015 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13016 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13017 |
|
13018 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13019 { |
|
13020 |
|
13021 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
13022 return return_type_symbol; |
|
13023 |
|
13024 } |
|
13025 |
|
13026 ERROR; |
|
13027 } |
|
13028 |
|
13029 }/*function_time_to_tod*/ |
|
13030 break; |
|
13031 |
|
13032 /**** |
|
13033 *TIME_TO_UDINT |
|
13034 */ |
|
13035 case function_time_to_udint : |
|
13036 { |
|
13037 symbol_c *last_type_symbol = NULL; |
|
13038 |
|
13039 { |
|
13040 identifier_c param_name("IN"); |
|
13041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13042 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13043 |
|
13044 /* Get the value from a foo(<param_value>) style call */ |
|
13045 if (IN_param_value == NULL) |
|
13046 IN_param_value = function_call_param_iterator.next(); |
|
13047 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13048 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13049 |
|
13050 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13051 { |
|
13052 |
|
13053 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
13054 return return_type_symbol; |
|
13055 |
|
13056 } |
|
13057 |
|
13058 ERROR; |
|
13059 } |
|
13060 |
|
13061 }/*function_time_to_udint*/ |
|
13062 break; |
|
13063 |
|
13064 /**** |
|
13065 *TIME_TO_WORD |
|
13066 */ |
|
13067 case function_time_to_word : |
|
13068 { |
|
13069 symbol_c *last_type_symbol = NULL; |
|
13070 |
|
13071 { |
|
13072 identifier_c param_name("IN"); |
|
13073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13074 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13075 |
|
13076 /* Get the value from a foo(<param_value>) style call */ |
|
13077 if (IN_param_value == NULL) |
|
13078 IN_param_value = function_call_param_iterator.next(); |
|
13079 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13080 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13081 |
|
13082 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13083 { |
|
13084 |
|
13085 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
13086 return return_type_symbol; |
|
13087 |
|
13088 } |
|
13089 |
|
13090 ERROR; |
|
13091 } |
|
13092 |
|
13093 }/*function_time_to_word*/ |
|
13094 break; |
|
13095 |
|
13096 /**** |
|
13097 *TIME_TO_WSTRING |
|
13098 */ |
|
13099 case function_time_to_wstring : |
|
13100 { |
|
13101 symbol_c *last_type_symbol = NULL; |
|
13102 |
|
13103 { |
|
13104 identifier_c param_name("IN"); |
|
13105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13106 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13107 |
|
13108 /* Get the value from a foo(<param_value>) style call */ |
|
13109 if (IN_param_value == NULL) |
|
13110 IN_param_value = function_call_param_iterator.next(); |
|
13111 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13112 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13113 |
|
13114 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13115 { |
|
13116 |
|
13117 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
13118 return return_type_symbol; |
|
13119 |
|
13120 } |
|
13121 |
|
13122 ERROR; |
|
13123 } |
|
13124 |
|
13125 }/*function_time_to_wstring*/ |
|
13126 break; |
|
13127 |
|
13128 /**** |
|
13129 *TIME_TO_STRING |
|
13130 */ |
|
13131 case function_time_to_string : |
|
13132 { |
|
13133 symbol_c *last_type_symbol = NULL; |
|
13134 |
|
13135 { |
|
13136 identifier_c param_name("IN"); |
|
13137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13138 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13139 |
|
13140 /* Get the value from a foo(<param_value>) style call */ |
|
13141 if (IN_param_value == NULL) |
|
13142 IN_param_value = function_call_param_iterator.next(); |
|
13143 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13144 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13145 |
|
13146 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13147 { |
|
13148 |
|
13149 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
13150 return return_type_symbol; |
|
13151 |
|
13152 } |
|
13153 |
|
13154 ERROR; |
|
13155 } |
|
13156 |
|
13157 }/*function_time_to_string*/ |
|
13158 break; |
|
13159 |
|
13160 /**** |
|
13161 *TIME_TO_LWORD |
|
13162 */ |
|
13163 case function_time_to_lword : |
|
13164 { |
|
13165 symbol_c *last_type_symbol = NULL; |
|
13166 |
|
13167 { |
|
13168 identifier_c param_name("IN"); |
|
13169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13170 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13171 |
|
13172 /* Get the value from a foo(<param_value>) style call */ |
|
13173 if (IN_param_value == NULL) |
|
13174 IN_param_value = function_call_param_iterator.next(); |
|
13175 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13176 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13177 |
|
13178 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13179 { |
|
13180 |
|
13181 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
13182 return return_type_symbol; |
|
13183 |
|
13184 } |
|
13185 |
|
13186 ERROR; |
|
13187 } |
|
13188 |
|
13189 }/*function_time_to_lword*/ |
|
13190 break; |
|
13191 |
|
13192 /**** |
|
13193 *TIME_TO_UINT |
|
13194 */ |
|
13195 case function_time_to_uint : |
|
13196 { |
|
13197 symbol_c *last_type_symbol = NULL; |
|
13198 |
|
13199 { |
|
13200 identifier_c param_name("IN"); |
|
13201 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13202 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13203 |
|
13204 /* Get the value from a foo(<param_value>) style call */ |
|
13205 if (IN_param_value == NULL) |
|
13206 IN_param_value = function_call_param_iterator.next(); |
|
13207 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13208 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13209 |
|
13210 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13211 { |
|
13212 |
|
13213 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
13214 return return_type_symbol; |
|
13215 |
|
13216 } |
|
13217 |
|
13218 ERROR; |
|
13219 } |
|
13220 |
|
13221 }/*function_time_to_uint*/ |
|
13222 break; |
|
13223 |
|
13224 /**** |
|
13225 *TIME_TO_LREAL |
|
13226 */ |
|
13227 case function_time_to_lreal : |
|
13228 { |
|
13229 symbol_c *last_type_symbol = NULL; |
|
13230 |
|
13231 { |
|
13232 identifier_c param_name("IN"); |
|
13233 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13234 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13235 |
|
13236 /* Get the value from a foo(<param_value>) style call */ |
|
13237 if (IN_param_value == NULL) |
|
13238 IN_param_value = function_call_param_iterator.next(); |
|
13239 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13240 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13241 |
|
13242 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13243 { |
|
13244 |
|
13245 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
13246 return return_type_symbol; |
|
13247 |
|
13248 } |
|
13249 |
|
13250 ERROR; |
|
13251 } |
|
13252 |
|
13253 }/*function_time_to_lreal*/ |
|
13254 break; |
|
13255 |
|
13256 /**** |
|
13257 *TIME_TO_BYTE |
|
13258 */ |
|
13259 case function_time_to_byte : |
|
13260 { |
|
13261 symbol_c *last_type_symbol = NULL; |
|
13262 |
|
13263 { |
|
13264 identifier_c param_name("IN"); |
|
13265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13266 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13267 |
|
13268 /* Get the value from a foo(<param_value>) style call */ |
|
13269 if (IN_param_value == NULL) |
|
13270 IN_param_value = function_call_param_iterator.next(); |
|
13271 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13272 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13273 |
|
13274 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13275 { |
|
13276 |
|
13277 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
13278 return return_type_symbol; |
|
13279 |
|
13280 } |
|
13281 |
|
13282 ERROR; |
|
13283 } |
|
13284 |
|
13285 }/*function_time_to_byte*/ |
|
13286 break; |
|
13287 |
|
13288 /**** |
|
13289 *TIME_TO_USINT |
|
13290 */ |
|
13291 case function_time_to_usint : |
|
13292 { |
|
13293 symbol_c *last_type_symbol = NULL; |
|
13294 |
|
13295 { |
|
13296 identifier_c param_name("IN"); |
|
13297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13298 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13299 |
|
13300 /* Get the value from a foo(<param_value>) style call */ |
|
13301 if (IN_param_value == NULL) |
|
13302 IN_param_value = function_call_param_iterator.next(); |
|
13303 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13304 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13305 |
|
13306 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13307 { |
|
13308 |
|
13309 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
13310 return return_type_symbol; |
|
13311 |
|
13312 } |
|
13313 |
|
13314 ERROR; |
|
13315 } |
|
13316 |
|
13317 }/*function_time_to_usint*/ |
|
13318 break; |
|
13319 |
|
13320 /**** |
|
13321 *TIME_TO_ULINT |
|
13322 */ |
|
13323 case function_time_to_ulint : |
|
13324 { |
|
13325 symbol_c *last_type_symbol = NULL; |
|
13326 |
|
13327 { |
|
13328 identifier_c param_name("IN"); |
|
13329 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13330 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13331 |
|
13332 /* Get the value from a foo(<param_value>) style call */ |
|
13333 if (IN_param_value == NULL) |
|
13334 IN_param_value = function_call_param_iterator.next(); |
|
13335 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13336 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13337 |
|
13338 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13339 { |
|
13340 |
|
13341 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
13342 return return_type_symbol; |
|
13343 |
|
13344 } |
|
13345 |
|
13346 ERROR; |
|
13347 } |
|
13348 |
|
13349 }/*function_time_to_ulint*/ |
|
13350 break; |
|
13351 |
|
13352 /**** |
|
13353 *TIME_TO_BOOL |
|
13354 */ |
|
13355 case function_time_to_bool : |
|
13356 { |
|
13357 symbol_c *last_type_symbol = NULL; |
|
13358 |
|
13359 { |
|
13360 identifier_c param_name("IN"); |
|
13361 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13362 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13363 |
|
13364 /* Get the value from a foo(<param_value>) style call */ |
|
13365 if (IN_param_value == NULL) |
|
13366 IN_param_value = function_call_param_iterator.next(); |
|
13367 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13368 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13369 |
|
13370 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13371 { |
|
13372 |
|
13373 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
13374 return return_type_symbol; |
|
13375 |
|
13376 } |
|
13377 |
|
13378 ERROR; |
|
13379 } |
|
13380 |
|
13381 }/*function_time_to_bool*/ |
|
13382 break; |
|
13383 |
|
13384 /**** |
|
13385 *TIME_TO_TIME |
|
13386 */ |
|
13387 case function_time_to_time : |
|
13388 { |
|
13389 symbol_c *last_type_symbol = NULL; |
|
13390 |
|
13391 { |
|
13392 identifier_c param_name("IN"); |
|
13393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13394 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13395 |
|
13396 /* Get the value from a foo(<param_value>) style call */ |
|
13397 if (IN_param_value == NULL) |
|
13398 IN_param_value = function_call_param_iterator.next(); |
|
13399 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13400 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13401 |
|
13402 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13403 { |
|
13404 |
|
13405 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
13406 return return_type_symbol; |
|
13407 |
|
13408 } |
|
13409 |
|
13410 ERROR; |
|
13411 } |
|
13412 |
|
13413 }/*function_time_to_time*/ |
|
13414 break; |
|
13415 |
|
13416 /**** |
|
13417 *TIME_TO_INT |
|
13418 */ |
|
13419 case function_time_to_int : |
|
13420 { |
|
13421 symbol_c *last_type_symbol = NULL; |
|
13422 |
|
13423 { |
|
13424 identifier_c param_name("IN"); |
|
13425 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13426 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13427 |
|
13428 /* Get the value from a foo(<param_value>) style call */ |
|
13429 if (IN_param_value == NULL) |
|
13430 IN_param_value = function_call_param_iterator.next(); |
|
13431 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13432 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13433 |
|
13434 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
13435 { |
|
13436 |
|
13437 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
13438 return return_type_symbol; |
|
13439 |
|
13440 } |
|
13441 |
|
13442 ERROR; |
|
13443 } |
|
13444 |
|
13445 }/*function_time_to_int*/ |
|
13446 break; |
|
13447 |
|
13448 /**** |
|
13449 *INT_TO_REAL |
|
13450 */ |
|
13451 case function_int_to_real : |
|
13452 { |
|
13453 symbol_c *last_type_symbol = NULL; |
|
13454 |
|
13455 { |
|
13456 identifier_c param_name("IN"); |
|
13457 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13458 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13459 |
|
13460 /* Get the value from a foo(<param_value>) style call */ |
|
13461 if (IN_param_value == NULL) |
|
13462 IN_param_value = function_call_param_iterator.next(); |
|
13463 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13464 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13465 |
|
13466 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13467 { |
|
13468 |
|
13469 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
13470 return return_type_symbol; |
|
13471 |
|
13472 } |
|
13473 |
|
13474 ERROR; |
|
13475 } |
|
13476 |
|
13477 }/*function_int_to_real*/ |
|
13478 break; |
|
13479 |
|
13480 /**** |
|
13481 *INT_TO_SINT |
|
13482 */ |
|
13483 case function_int_to_sint : |
|
13484 { |
|
13485 symbol_c *last_type_symbol = NULL; |
|
13486 |
|
13487 { |
|
13488 identifier_c param_name("IN"); |
|
13489 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13490 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13491 |
|
13492 /* Get the value from a foo(<param_value>) style call */ |
|
13493 if (IN_param_value == NULL) |
|
13494 IN_param_value = function_call_param_iterator.next(); |
|
13495 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13496 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13497 |
|
13498 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13499 { |
|
13500 |
|
13501 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
13502 return return_type_symbol; |
|
13503 |
|
13504 } |
|
13505 |
|
13506 ERROR; |
|
13507 } |
|
13508 |
|
13509 }/*function_int_to_sint*/ |
|
13510 break; |
|
13511 |
|
13512 /**** |
|
13513 *INT_TO_LINT |
|
13514 */ |
|
13515 case function_int_to_lint : |
|
13516 { |
|
13517 symbol_c *last_type_symbol = NULL; |
|
13518 |
|
13519 { |
|
13520 identifier_c param_name("IN"); |
|
13521 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13522 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13523 |
|
13524 /* Get the value from a foo(<param_value>) style call */ |
|
13525 if (IN_param_value == NULL) |
|
13526 IN_param_value = function_call_param_iterator.next(); |
|
13527 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13528 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13529 |
|
13530 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13531 { |
|
13532 |
|
13533 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
13534 return return_type_symbol; |
|
13535 |
|
13536 } |
|
13537 |
|
13538 ERROR; |
|
13539 } |
|
13540 |
|
13541 }/*function_int_to_lint*/ |
|
13542 break; |
|
13543 |
|
13544 /**** |
|
13545 *INT_TO_DINT |
|
13546 */ |
|
13547 case function_int_to_dint : |
|
13548 { |
|
13549 symbol_c *last_type_symbol = NULL; |
|
13550 |
|
13551 { |
|
13552 identifier_c param_name("IN"); |
|
13553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13554 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13555 |
|
13556 /* Get the value from a foo(<param_value>) style call */ |
|
13557 if (IN_param_value == NULL) |
|
13558 IN_param_value = function_call_param_iterator.next(); |
|
13559 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13560 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13561 |
|
13562 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13563 { |
|
13564 |
|
13565 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
13566 return return_type_symbol; |
|
13567 |
|
13568 } |
|
13569 |
|
13570 ERROR; |
|
13571 } |
|
13572 |
|
13573 }/*function_int_to_dint*/ |
|
13574 break; |
|
13575 |
|
13576 /**** |
|
13577 *INT_TO_DATE |
|
13578 */ |
|
13579 case function_int_to_date : |
|
13580 { |
|
13581 symbol_c *last_type_symbol = NULL; |
|
13582 |
|
13583 { |
|
13584 identifier_c param_name("IN"); |
|
13585 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13586 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13587 |
|
13588 /* Get the value from a foo(<param_value>) style call */ |
|
13589 if (IN_param_value == NULL) |
|
13590 IN_param_value = function_call_param_iterator.next(); |
|
13591 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13592 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13593 |
|
13594 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13595 { |
|
13596 |
|
13597 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
13598 return return_type_symbol; |
|
13599 |
|
13600 } |
|
13601 |
|
13602 ERROR; |
|
13603 } |
|
13604 |
|
13605 }/*function_int_to_date*/ |
|
13606 break; |
|
13607 |
|
13608 /**** |
|
13609 *INT_TO_DWORD |
|
13610 */ |
|
13611 case function_int_to_dword : |
|
13612 { |
|
13613 symbol_c *last_type_symbol = NULL; |
|
13614 |
|
13615 { |
|
13616 identifier_c param_name("IN"); |
|
13617 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13618 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13619 |
|
13620 /* Get the value from a foo(<param_value>) style call */ |
|
13621 if (IN_param_value == NULL) |
|
13622 IN_param_value = function_call_param_iterator.next(); |
|
13623 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13624 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13625 |
|
13626 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13627 { |
|
13628 |
|
13629 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
13630 return return_type_symbol; |
|
13631 |
|
13632 } |
|
13633 |
|
13634 ERROR; |
|
13635 } |
|
13636 |
|
13637 }/*function_int_to_dword*/ |
|
13638 break; |
|
13639 |
|
13640 /**** |
|
13641 *INT_TO_DT |
|
13642 */ |
|
13643 case function_int_to_dt : |
|
13644 { |
|
13645 symbol_c *last_type_symbol = NULL; |
|
13646 |
|
13647 { |
|
13648 identifier_c param_name("IN"); |
|
13649 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13650 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13651 |
|
13652 /* Get the value from a foo(<param_value>) style call */ |
|
13653 if (IN_param_value == NULL) |
|
13654 IN_param_value = function_call_param_iterator.next(); |
|
13655 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13656 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13657 |
|
13658 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13659 { |
|
13660 |
|
13661 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
13662 return return_type_symbol; |
|
13663 |
|
13664 } |
|
13665 |
|
13666 ERROR; |
|
13667 } |
|
13668 |
|
13669 }/*function_int_to_dt*/ |
|
13670 break; |
|
13671 |
|
13672 /**** |
|
13673 *INT_TO_TOD |
|
13674 */ |
|
13675 case function_int_to_tod : |
|
13676 { |
|
13677 symbol_c *last_type_symbol = NULL; |
|
13678 |
|
13679 { |
|
13680 identifier_c param_name("IN"); |
|
13681 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13682 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13683 |
|
13684 /* Get the value from a foo(<param_value>) style call */ |
|
13685 if (IN_param_value == NULL) |
|
13686 IN_param_value = function_call_param_iterator.next(); |
|
13687 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13688 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13689 |
|
13690 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13691 { |
|
13692 |
|
13693 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
13694 return return_type_symbol; |
|
13695 |
|
13696 } |
|
13697 |
|
13698 ERROR; |
|
13699 } |
|
13700 |
|
13701 }/*function_int_to_tod*/ |
|
13702 break; |
|
13703 |
|
13704 /**** |
|
13705 *INT_TO_UDINT |
|
13706 */ |
|
13707 case function_int_to_udint : |
|
13708 { |
|
13709 symbol_c *last_type_symbol = NULL; |
|
13710 |
|
13711 { |
|
13712 identifier_c param_name("IN"); |
|
13713 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13714 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13715 |
|
13716 /* Get the value from a foo(<param_value>) style call */ |
|
13717 if (IN_param_value == NULL) |
|
13718 IN_param_value = function_call_param_iterator.next(); |
|
13719 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13720 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13721 |
|
13722 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13723 { |
|
13724 |
|
13725 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
13726 return return_type_symbol; |
|
13727 |
|
13728 } |
|
13729 |
|
13730 ERROR; |
|
13731 } |
|
13732 |
|
13733 }/*function_int_to_udint*/ |
|
13734 break; |
|
13735 |
|
13736 /**** |
|
13737 *INT_TO_WORD |
|
13738 */ |
|
13739 case function_int_to_word : |
|
13740 { |
|
13741 symbol_c *last_type_symbol = NULL; |
|
13742 |
|
13743 { |
|
13744 identifier_c param_name("IN"); |
|
13745 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13746 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13747 |
|
13748 /* Get the value from a foo(<param_value>) style call */ |
|
13749 if (IN_param_value == NULL) |
|
13750 IN_param_value = function_call_param_iterator.next(); |
|
13751 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13752 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13753 |
|
13754 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13755 { |
|
13756 |
|
13757 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
13758 return return_type_symbol; |
|
13759 |
|
13760 } |
|
13761 |
|
13762 ERROR; |
|
13763 } |
|
13764 |
|
13765 }/*function_int_to_word*/ |
|
13766 break; |
|
13767 |
|
13768 /**** |
|
13769 *INT_TO_WSTRING |
|
13770 */ |
|
13771 case function_int_to_wstring : |
|
13772 { |
|
13773 symbol_c *last_type_symbol = NULL; |
|
13774 |
|
13775 { |
|
13776 identifier_c param_name("IN"); |
|
13777 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13778 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13779 |
|
13780 /* Get the value from a foo(<param_value>) style call */ |
|
13781 if (IN_param_value == NULL) |
|
13782 IN_param_value = function_call_param_iterator.next(); |
|
13783 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13784 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13785 |
|
13786 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13787 { |
|
13788 |
|
13789 symbol_c * return_type_symbol = &search_constant_type_c::wstring_type_name; |
|
13790 return return_type_symbol; |
|
13791 |
|
13792 } |
|
13793 |
|
13794 ERROR; |
|
13795 } |
|
13796 |
|
13797 }/*function_int_to_wstring*/ |
|
13798 break; |
|
13799 |
|
13800 /**** |
|
13801 *INT_TO_STRING |
|
13802 */ |
|
13803 case function_int_to_string : |
|
13804 { |
|
13805 symbol_c *last_type_symbol = NULL; |
|
13806 |
|
13807 { |
|
13808 identifier_c param_name("IN"); |
|
13809 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13810 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13811 |
|
13812 /* Get the value from a foo(<param_value>) style call */ |
|
13813 if (IN_param_value == NULL) |
|
13814 IN_param_value = function_call_param_iterator.next(); |
|
13815 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13816 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13817 |
|
13818 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13819 { |
|
13820 |
|
13821 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
13822 return return_type_symbol; |
|
13823 |
|
13824 } |
|
13825 |
|
13826 ERROR; |
|
13827 } |
|
13828 |
|
13829 }/*function_int_to_string*/ |
|
13830 break; |
|
13831 |
|
13832 /**** |
|
13833 *INT_TO_LWORD |
|
13834 */ |
|
13835 case function_int_to_lword : |
|
13836 { |
|
13837 symbol_c *last_type_symbol = NULL; |
|
13838 |
|
13839 { |
|
13840 identifier_c param_name("IN"); |
|
13841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13842 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13843 |
|
13844 /* Get the value from a foo(<param_value>) style call */ |
|
13845 if (IN_param_value == NULL) |
|
13846 IN_param_value = function_call_param_iterator.next(); |
|
13847 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13848 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13849 |
|
13850 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13851 { |
|
13852 |
|
13853 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
13854 return return_type_symbol; |
|
13855 |
|
13856 } |
|
13857 |
|
13858 ERROR; |
|
13859 } |
|
13860 |
|
13861 }/*function_int_to_lword*/ |
|
13862 break; |
|
13863 |
|
13864 /**** |
|
13865 *INT_TO_UINT |
|
13866 */ |
|
13867 case function_int_to_uint : |
|
13868 { |
|
13869 symbol_c *last_type_symbol = NULL; |
|
13870 |
|
13871 { |
|
13872 identifier_c param_name("IN"); |
|
13873 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13874 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13875 |
|
13876 /* Get the value from a foo(<param_value>) style call */ |
|
13877 if (IN_param_value == NULL) |
|
13878 IN_param_value = function_call_param_iterator.next(); |
|
13879 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13880 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13881 |
|
13882 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13883 { |
|
13884 |
|
13885 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
13886 return return_type_symbol; |
|
13887 |
|
13888 } |
|
13889 |
|
13890 ERROR; |
|
13891 } |
|
13892 |
|
13893 }/*function_int_to_uint*/ |
|
13894 break; |
|
13895 |
|
13896 /**** |
|
13897 *INT_TO_LREAL |
|
13898 */ |
|
13899 case function_int_to_lreal : |
|
13900 { |
|
13901 symbol_c *last_type_symbol = NULL; |
|
13902 |
|
13903 { |
|
13904 identifier_c param_name("IN"); |
|
13905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13906 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13907 |
|
13908 /* Get the value from a foo(<param_value>) style call */ |
|
13909 if (IN_param_value == NULL) |
|
13910 IN_param_value = function_call_param_iterator.next(); |
|
13911 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13912 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13913 |
|
13914 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13915 { |
|
13916 |
|
13917 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
13918 return return_type_symbol; |
|
13919 |
|
13920 } |
|
13921 |
|
13922 ERROR; |
|
13923 } |
|
13924 |
|
13925 }/*function_int_to_lreal*/ |
|
13926 break; |
|
13927 |
|
13928 /**** |
|
13929 *INT_TO_BYTE |
|
13930 */ |
|
13931 case function_int_to_byte : |
|
13932 { |
|
13933 symbol_c *last_type_symbol = NULL; |
|
13934 |
|
13935 { |
|
13936 identifier_c param_name("IN"); |
|
13937 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13938 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13939 |
|
13940 /* Get the value from a foo(<param_value>) style call */ |
|
13941 if (IN_param_value == NULL) |
|
13942 IN_param_value = function_call_param_iterator.next(); |
|
13943 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13944 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13945 |
|
13946 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13947 { |
|
13948 |
|
13949 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
13950 return return_type_symbol; |
|
13951 |
|
13952 } |
|
13953 |
|
13954 ERROR; |
|
13955 } |
|
13956 |
|
13957 }/*function_int_to_byte*/ |
|
13958 break; |
|
13959 |
|
13960 /**** |
|
13961 *INT_TO_USINT |
|
13962 */ |
|
13963 case function_int_to_usint : |
|
13964 { |
|
13965 symbol_c *last_type_symbol = NULL; |
|
13966 |
|
13967 { |
|
13968 identifier_c param_name("IN"); |
|
13969 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13970 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
13971 |
|
13972 /* Get the value from a foo(<param_value>) style call */ |
|
13973 if (IN_param_value == NULL) |
|
13974 IN_param_value = function_call_param_iterator.next(); |
|
13975 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
13976 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
13977 |
|
13978 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
13979 { |
|
13980 |
|
13981 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
13982 return return_type_symbol; |
|
13983 |
|
13984 } |
|
13985 |
|
13986 ERROR; |
|
13987 } |
|
13988 |
|
13989 }/*function_int_to_usint*/ |
|
13990 break; |
|
13991 |
|
13992 /**** |
|
13993 *INT_TO_ULINT |
|
13994 */ |
|
13995 case function_int_to_ulint : |
|
13996 { |
|
13997 symbol_c *last_type_symbol = NULL; |
|
13998 |
|
13999 { |
|
14000 identifier_c param_name("IN"); |
|
14001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14002 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14003 |
|
14004 /* Get the value from a foo(<param_value>) style call */ |
|
14005 if (IN_param_value == NULL) |
|
14006 IN_param_value = function_call_param_iterator.next(); |
|
14007 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14008 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14009 |
|
14010 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
14011 { |
|
14012 |
|
14013 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
14014 return return_type_symbol; |
|
14015 |
|
14016 } |
|
14017 |
|
14018 ERROR; |
|
14019 } |
|
14020 |
|
14021 }/*function_int_to_ulint*/ |
|
14022 break; |
|
14023 |
|
14024 /**** |
|
14025 *INT_TO_BOOL |
|
14026 */ |
|
14027 case function_int_to_bool : |
|
14028 { |
|
14029 symbol_c *last_type_symbol = NULL; |
|
14030 |
|
14031 { |
|
14032 identifier_c param_name("IN"); |
|
14033 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14034 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14035 |
|
14036 /* Get the value from a foo(<param_value>) style call */ |
|
14037 if (IN_param_value == NULL) |
|
14038 IN_param_value = function_call_param_iterator.next(); |
|
14039 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14040 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14041 |
|
14042 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
14043 { |
|
14044 |
|
14045 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14046 return return_type_symbol; |
|
14047 |
|
14048 } |
|
14049 |
|
14050 ERROR; |
|
14051 } |
|
14052 |
|
14053 }/*function_int_to_bool*/ |
|
14054 break; |
|
14055 |
|
14056 /**** |
|
14057 *INT_TO_TIME |
|
14058 */ |
|
14059 case function_int_to_time : |
|
14060 { |
|
14061 symbol_c *last_type_symbol = NULL; |
|
14062 |
|
14063 { |
|
14064 identifier_c param_name("IN"); |
|
14065 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14066 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14067 |
|
14068 /* Get the value from a foo(<param_value>) style call */ |
|
14069 if (IN_param_value == NULL) |
|
14070 IN_param_value = function_call_param_iterator.next(); |
|
14071 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14072 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14073 |
|
14074 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
14075 { |
|
14076 |
|
14077 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
14078 return return_type_symbol; |
|
14079 |
|
14080 } |
|
14081 |
|
14082 ERROR; |
|
14083 } |
|
14084 |
|
14085 }/*function_int_to_time*/ |
|
14086 break; |
|
14087 |
|
14088 /**** |
|
14089 *INT_TO_INT |
|
14090 */ |
|
14091 case function_int_to_int : |
|
14092 { |
|
14093 symbol_c *last_type_symbol = NULL; |
|
14094 |
|
14095 { |
|
14096 identifier_c param_name("IN"); |
|
14097 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14098 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14099 |
|
14100 /* Get the value from a foo(<param_value>) style call */ |
|
14101 if (IN_param_value == NULL) |
|
14102 IN_param_value = function_call_param_iterator.next(); |
|
14103 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14104 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14105 |
|
14106 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
14107 { |
|
14108 |
|
14109 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
14110 return return_type_symbol; |
|
14111 |
|
14112 } |
|
14113 |
|
14114 ERROR; |
|
14115 } |
|
14116 |
|
14117 }/*function_int_to_int*/ |
|
14118 break; |
|
14119 |
|
14120 /**** |
|
14121 *TRUNC |
|
14122 */ |
|
14123 case function_trunc : |
|
14124 { |
|
14125 symbol_c *last_type_symbol = NULL; |
|
14126 |
|
14127 { |
|
14128 identifier_c param_name("IN"); |
|
14129 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14130 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14131 |
|
14132 /* Get the value from a foo(<param_value>) style call */ |
|
14133 if (IN_param_value == NULL) |
|
14134 IN_param_value = function_call_param_iterator.next(); |
|
14135 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14137 |
|
14138 if(search_expression_type->is_real_type(IN_param_value)) |
|
14139 { |
|
14140 |
|
14141 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14142 return return_type_symbol; |
|
14143 |
|
14144 } |
|
14145 |
|
14146 ERROR; |
|
14147 } |
|
14148 |
|
14149 }/*function_trunc*/ |
|
14150 break; |
|
14151 |
|
14152 /**** |
|
14153 *BCD_TO_SINT |
|
14154 */ |
|
14155 case function_bcd_to_sint : |
|
14156 { |
|
14157 symbol_c *last_type_symbol = NULL; |
|
14158 |
|
14159 { |
|
14160 identifier_c param_name("IN"); |
|
14161 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14162 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14163 |
|
14164 /* Get the value from a foo(<param_value>) style call */ |
|
14165 if (IN_param_value == NULL) |
|
14166 IN_param_value = function_call_param_iterator.next(); |
|
14167 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14168 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14169 |
|
14170 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14171 { |
|
14172 |
|
14173 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
14174 return return_type_symbol; |
|
14175 |
|
14176 } |
|
14177 |
|
14178 ERROR; |
|
14179 } |
|
14180 |
|
14181 }/*function_bcd_to_sint*/ |
|
14182 break; |
|
14183 |
|
14184 /**** |
|
14185 *BCD_TO_LINT |
|
14186 */ |
|
14187 case function_bcd_to_lint : |
|
14188 { |
|
14189 symbol_c *last_type_symbol = NULL; |
|
14190 |
|
14191 { |
|
14192 identifier_c param_name("IN"); |
|
14193 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14194 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14195 |
|
14196 /* Get the value from a foo(<param_value>) style call */ |
|
14197 if (IN_param_value == NULL) |
|
14198 IN_param_value = function_call_param_iterator.next(); |
|
14199 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14200 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14201 |
|
14202 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14203 { |
|
14204 |
|
14205 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
14206 return return_type_symbol; |
|
14207 |
|
14208 } |
|
14209 |
|
14210 ERROR; |
|
14211 } |
|
14212 |
|
14213 }/*function_bcd_to_lint*/ |
|
14214 break; |
|
14215 |
|
14216 /**** |
|
14217 *BCD_TO_DINT |
|
14218 */ |
|
14219 case function_bcd_to_dint : |
|
14220 { |
|
14221 symbol_c *last_type_symbol = NULL; |
|
14222 |
|
14223 { |
|
14224 identifier_c param_name("IN"); |
|
14225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14226 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14227 |
|
14228 /* Get the value from a foo(<param_value>) style call */ |
|
14229 if (IN_param_value == NULL) |
|
14230 IN_param_value = function_call_param_iterator.next(); |
|
14231 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14232 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14233 |
|
14234 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14235 { |
|
14236 |
|
14237 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
14238 return return_type_symbol; |
|
14239 |
|
14240 } |
|
14241 |
|
14242 ERROR; |
|
14243 } |
|
14244 |
|
14245 }/*function_bcd_to_dint*/ |
|
14246 break; |
|
14247 |
|
14248 /**** |
|
14249 *BCD_TO_UDINT |
|
14250 */ |
|
14251 case function_bcd_to_udint : |
|
14252 { |
|
14253 symbol_c *last_type_symbol = NULL; |
|
14254 |
|
14255 { |
|
14256 identifier_c param_name("IN"); |
|
14257 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14258 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14259 |
|
14260 /* Get the value from a foo(<param_value>) style call */ |
|
14261 if (IN_param_value == NULL) |
|
14262 IN_param_value = function_call_param_iterator.next(); |
|
14263 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14264 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14265 |
|
14266 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14267 { |
|
14268 |
|
14269 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
14270 return return_type_symbol; |
|
14271 |
|
14272 } |
|
14273 |
|
14274 ERROR; |
|
14275 } |
|
14276 |
|
14277 }/*function_bcd_to_udint*/ |
|
14278 break; |
|
14279 |
|
14280 /**** |
|
14281 *BCD_TO_UINT |
|
14282 */ |
|
14283 case function_bcd_to_uint : |
|
14284 { |
|
14285 symbol_c *last_type_symbol = NULL; |
|
14286 |
|
14287 { |
|
14288 identifier_c param_name("IN"); |
|
14289 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14290 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14291 |
|
14292 /* Get the value from a foo(<param_value>) style call */ |
|
14293 if (IN_param_value == NULL) |
|
14294 IN_param_value = function_call_param_iterator.next(); |
|
14295 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14296 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14297 |
|
14298 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14299 { |
|
14300 |
|
14301 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
14302 return return_type_symbol; |
|
14303 |
|
14304 } |
|
14305 |
|
14306 ERROR; |
|
14307 } |
|
14308 |
|
14309 }/*function_bcd_to_uint*/ |
|
14310 break; |
|
14311 |
|
14312 /**** |
|
14313 *BCD_TO_USINT |
|
14314 */ |
|
14315 case function_bcd_to_usint : |
|
14316 { |
|
14317 symbol_c *last_type_symbol = NULL; |
|
14318 |
|
14319 { |
|
14320 identifier_c param_name("IN"); |
|
14321 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14322 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14323 |
|
14324 /* Get the value from a foo(<param_value>) style call */ |
|
14325 if (IN_param_value == NULL) |
|
14326 IN_param_value = function_call_param_iterator.next(); |
|
14327 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14328 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14329 |
|
14330 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14331 { |
|
14332 |
|
14333 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
14334 return return_type_symbol; |
|
14335 |
|
14336 } |
|
14337 |
|
14338 ERROR; |
|
14339 } |
|
14340 |
|
14341 }/*function_bcd_to_usint*/ |
|
14342 break; |
|
14343 |
|
14344 /**** |
|
14345 *BCD_TO_ULINT |
|
14346 */ |
|
14347 case function_bcd_to_ulint : |
|
14348 { |
|
14349 symbol_c *last_type_symbol = NULL; |
|
14350 |
|
14351 { |
|
14352 identifier_c param_name("IN"); |
|
14353 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14354 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14355 |
|
14356 /* Get the value from a foo(<param_value>) style call */ |
|
14357 if (IN_param_value == NULL) |
|
14358 IN_param_value = function_call_param_iterator.next(); |
|
14359 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14360 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14361 |
|
14362 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14363 { |
|
14364 |
|
14365 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
14366 return return_type_symbol; |
|
14367 |
|
14368 } |
|
14369 |
|
14370 ERROR; |
|
14371 } |
|
14372 |
|
14373 }/*function_bcd_to_ulint*/ |
|
14374 break; |
|
14375 |
|
14376 /**** |
|
14377 *BCD_TO_INT |
|
14378 */ |
|
14379 case function_bcd_to_int : |
|
14380 { |
|
14381 symbol_c *last_type_symbol = NULL; |
|
14382 |
|
14383 { |
|
14384 identifier_c param_name("IN"); |
|
14385 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14386 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14387 |
|
14388 /* Get the value from a foo(<param_value>) style call */ |
|
14389 if (IN_param_value == NULL) |
|
14390 IN_param_value = function_call_param_iterator.next(); |
|
14391 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14392 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14393 |
|
14394 if(search_expression_type->is_binary_type(IN_param_value)) |
|
14395 { |
|
14396 |
|
14397 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
14398 return return_type_symbol; |
|
14399 |
|
14400 } |
|
14401 |
|
14402 ERROR; |
|
14403 } |
|
14404 |
|
14405 }/*function_bcd_to_int*/ |
|
14406 break; |
|
14407 |
|
14408 /**** |
|
14409 *SINT_TO_BCD |
|
14410 */ |
|
14411 case function_sint_to_bcd : |
|
14412 { |
|
14413 symbol_c *last_type_symbol = NULL; |
|
14414 |
|
14415 { |
|
14416 identifier_c param_name("IN"); |
|
14417 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14418 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14419 |
|
14420 /* Get the value from a foo(<param_value>) style call */ |
|
14421 if (IN_param_value == NULL) |
|
14422 IN_param_value = function_call_param_iterator.next(); |
|
14423 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14424 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14425 |
|
14426 if (typeid(*last_type_symbol) == typeid(sint_type_name_c)) |
|
14427 { |
|
14428 |
|
14429 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14430 return return_type_symbol; |
|
14431 |
|
14432 } |
|
14433 |
|
14434 ERROR; |
|
14435 } |
|
14436 |
|
14437 }/*function_sint_to_bcd*/ |
|
14438 break; |
|
14439 |
|
14440 /**** |
|
14441 *LINT_TO_BCD |
|
14442 */ |
|
14443 case function_lint_to_bcd : |
|
14444 { |
|
14445 symbol_c *last_type_symbol = NULL; |
|
14446 |
|
14447 { |
|
14448 identifier_c param_name("IN"); |
|
14449 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14450 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14451 |
|
14452 /* Get the value from a foo(<param_value>) style call */ |
|
14453 if (IN_param_value == NULL) |
|
14454 IN_param_value = function_call_param_iterator.next(); |
|
14455 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14456 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14457 |
|
14458 if (typeid(*last_type_symbol) == typeid(lint_type_name_c)) |
|
14459 { |
|
14460 |
|
14461 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14462 return return_type_symbol; |
|
14463 |
|
14464 } |
|
14465 |
|
14466 ERROR; |
|
14467 } |
|
14468 |
|
14469 }/*function_lint_to_bcd*/ |
|
14470 break; |
|
14471 |
|
14472 /**** |
|
14473 *DINT_TO_BCD |
|
14474 */ |
|
14475 case function_dint_to_bcd : |
|
14476 { |
|
14477 symbol_c *last_type_symbol = NULL; |
|
14478 |
|
14479 { |
|
14480 identifier_c param_name("IN"); |
|
14481 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14482 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14483 |
|
14484 /* Get the value from a foo(<param_value>) style call */ |
|
14485 if (IN_param_value == NULL) |
|
14486 IN_param_value = function_call_param_iterator.next(); |
|
14487 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14488 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14489 |
|
14490 if (typeid(*last_type_symbol) == typeid(dint_type_name_c)) |
|
14491 { |
|
14492 |
|
14493 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14494 return return_type_symbol; |
|
14495 |
|
14496 } |
|
14497 |
|
14498 ERROR; |
|
14499 } |
|
14500 |
|
14501 }/*function_dint_to_bcd*/ |
|
14502 break; |
|
14503 |
|
14504 /**** |
|
14505 *UDINT_TO_BCD |
|
14506 */ |
|
14507 case function_udint_to_bcd : |
|
14508 { |
|
14509 symbol_c *last_type_symbol = NULL; |
|
14510 |
|
14511 { |
|
14512 identifier_c param_name("IN"); |
|
14513 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14514 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14515 |
|
14516 /* Get the value from a foo(<param_value>) style call */ |
|
14517 if (IN_param_value == NULL) |
|
14518 IN_param_value = function_call_param_iterator.next(); |
|
14519 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14520 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14521 |
|
14522 if (typeid(*last_type_symbol) == typeid(udint_type_name_c)) |
|
14523 { |
|
14524 |
|
14525 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14526 return return_type_symbol; |
|
14527 |
|
14528 } |
|
14529 |
|
14530 ERROR; |
|
14531 } |
|
14532 |
|
14533 }/*function_udint_to_bcd*/ |
|
14534 break; |
|
14535 |
|
14536 /**** |
|
14537 *UINT_TO_BCD |
|
14538 */ |
|
14539 case function_uint_to_bcd : |
|
14540 { |
|
14541 symbol_c *last_type_symbol = NULL; |
|
14542 |
|
14543 { |
|
14544 identifier_c param_name("IN"); |
|
14545 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14546 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14547 |
|
14548 /* Get the value from a foo(<param_value>) style call */ |
|
14549 if (IN_param_value == NULL) |
|
14550 IN_param_value = function_call_param_iterator.next(); |
|
14551 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14552 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14553 |
|
14554 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
14555 { |
|
14556 |
|
14557 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14558 return return_type_symbol; |
|
14559 |
|
14560 } |
|
14561 |
|
14562 ERROR; |
|
14563 } |
|
14564 |
|
14565 }/*function_uint_to_bcd*/ |
|
14566 break; |
|
14567 |
|
14568 /**** |
|
14569 *USINT_TO_BCD |
|
14570 */ |
|
14571 case function_usint_to_bcd : |
|
14572 { |
|
14573 symbol_c *last_type_symbol = NULL; |
|
14574 |
|
14575 { |
|
14576 identifier_c param_name("IN"); |
|
14577 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14578 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14579 |
|
14580 /* Get the value from a foo(<param_value>) style call */ |
|
14581 if (IN_param_value == NULL) |
|
14582 IN_param_value = function_call_param_iterator.next(); |
|
14583 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14584 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14585 |
|
14586 if (typeid(*last_type_symbol) == typeid(usint_type_name_c)) |
|
14587 { |
|
14588 |
|
14589 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14590 return return_type_symbol; |
|
14591 |
|
14592 } |
|
14593 |
|
14594 ERROR; |
|
14595 } |
|
14596 |
|
14597 }/*function_usint_to_bcd*/ |
|
14598 break; |
|
14599 |
|
14600 /**** |
|
14601 *ULINT_TO_BCD |
|
14602 */ |
|
14603 case function_ulint_to_bcd : |
|
14604 { |
|
14605 symbol_c *last_type_symbol = NULL; |
|
14606 |
|
14607 { |
|
14608 identifier_c param_name("IN"); |
|
14609 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14610 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14611 |
|
14612 /* Get the value from a foo(<param_value>) style call */ |
|
14613 if (IN_param_value == NULL) |
|
14614 IN_param_value = function_call_param_iterator.next(); |
|
14615 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14616 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14617 |
|
14618 if (typeid(*last_type_symbol) == typeid(ulint_type_name_c)) |
|
14619 { |
|
14620 |
|
14621 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14622 return return_type_symbol; |
|
14623 |
|
14624 } |
|
14625 |
|
14626 ERROR; |
|
14627 } |
|
14628 |
|
14629 }/*function_ulint_to_bcd*/ |
|
14630 break; |
|
14631 |
|
14632 /**** |
|
14633 *INT_TO_BCD |
|
14634 */ |
|
14635 case function_int_to_bcd : |
|
14636 { |
|
14637 symbol_c *last_type_symbol = NULL; |
|
14638 |
|
14639 { |
|
14640 identifier_c param_name("IN"); |
|
14641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14642 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14643 |
|
14644 /* Get the value from a foo(<param_value>) style call */ |
|
14645 if (IN_param_value == NULL) |
|
14646 IN_param_value = function_call_param_iterator.next(); |
|
14647 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14648 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14649 |
|
14650 if (typeid(*last_type_symbol) == typeid(int_type_name_c)) |
|
14651 { |
|
14652 |
|
14653 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
14654 return return_type_symbol; |
|
14655 |
|
14656 } |
|
14657 |
|
14658 ERROR; |
|
14659 } |
|
14660 |
|
14661 }/*function_int_to_bcd*/ |
|
14662 break; |
|
14663 |
|
14664 /**** |
|
14665 *DATE_AND_TIME_TO_TIME_OF_DAY |
|
14666 */ |
|
14667 case function_date_and_time_to_time_of_day : |
|
14668 { |
|
14669 symbol_c *last_type_symbol = NULL; |
|
14670 |
|
14671 { |
|
14672 identifier_c param_name("IN"); |
|
14673 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14674 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14675 |
|
14676 /* Get the value from a foo(<param_value>) style call */ |
|
14677 if (IN_param_value == NULL) |
|
14678 IN_param_value = function_call_param_iterator.next(); |
|
14679 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14680 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14681 |
|
14682 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
14683 { |
|
14684 |
|
14685 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
14686 return return_type_symbol; |
|
14687 |
|
14688 } |
|
14689 |
|
14690 ERROR; |
|
14691 } |
|
14692 |
|
14693 }/*function_date_and_time_to_time_of_day*/ |
|
14694 break; |
|
14695 |
|
14696 /**** |
|
14697 *DATE_AND_TIME_TO_DATE |
|
14698 */ |
|
14699 case function_date_and_time_to_date : |
|
14700 { |
|
14701 symbol_c *last_type_symbol = NULL; |
|
14702 |
|
14703 { |
|
14704 identifier_c param_name("IN"); |
|
14705 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14706 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14707 |
|
14708 /* Get the value from a foo(<param_value>) style call */ |
|
14709 if (IN_param_value == NULL) |
|
14710 IN_param_value = function_call_param_iterator.next(); |
|
14711 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14712 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14713 |
|
14714 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
14715 { |
|
14716 |
|
14717 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
14718 return return_type_symbol; |
|
14719 |
|
14720 } |
|
14721 |
|
14722 ERROR; |
|
14723 } |
|
14724 |
|
14725 }/*function_date_and_time_to_date*/ |
|
14726 break; |
|
14727 |
|
14728 /**** |
|
14729 *ABS |
|
14730 */ |
|
14731 case function_abs : |
|
14732 { |
|
14733 symbol_c *last_type_symbol = NULL; |
|
14734 |
|
14735 { |
|
14736 identifier_c param_name("IN"); |
|
14737 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14738 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14739 |
|
14740 /* Get the value from a foo(<param_value>) style call */ |
|
14741 if (IN_param_value == NULL) |
|
14742 IN_param_value = function_call_param_iterator.next(); |
|
14743 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14744 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14745 |
|
14746 if(search_expression_type->is_num_type(IN_param_value)) |
|
14747 { |
|
14748 |
|
14749 symbol_c * return_type_symbol = IN_type_symbol; |
|
14750 return return_type_symbol; |
|
14751 |
|
14752 } |
|
14753 |
|
14754 ERROR; |
|
14755 } |
|
14756 |
|
14757 }/*function_abs*/ |
|
14758 break; |
|
14759 |
|
14760 /**** |
|
14761 *SQRT |
|
14762 */ |
|
14763 case function_sqrt : |
|
14764 { |
|
14765 symbol_c *last_type_symbol = NULL; |
|
14766 |
|
14767 { |
|
14768 identifier_c param_name("IN"); |
|
14769 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14770 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14771 |
|
14772 /* Get the value from a foo(<param_value>) style call */ |
|
14773 if (IN_param_value == NULL) |
|
14774 IN_param_value = function_call_param_iterator.next(); |
|
14775 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14776 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14777 |
|
14778 if(search_expression_type->is_real_type(IN_param_value)) |
|
14779 { |
|
14780 |
|
14781 symbol_c * return_type_symbol = IN_type_symbol; |
|
14782 return return_type_symbol; |
|
14783 |
|
14784 } |
|
14785 |
|
14786 ERROR; |
|
14787 } |
|
14788 |
|
14789 }/*function_sqrt*/ |
|
14790 break; |
|
14791 |
|
14792 /**** |
|
14793 *LN |
|
14794 */ |
|
14795 case function_ln : |
|
14796 { |
|
14797 symbol_c *last_type_symbol = NULL; |
|
14798 |
|
14799 { |
|
14800 identifier_c param_name("IN"); |
|
14801 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14802 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14803 |
|
14804 /* Get the value from a foo(<param_value>) style call */ |
|
14805 if (IN_param_value == NULL) |
|
14806 IN_param_value = function_call_param_iterator.next(); |
|
14807 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14808 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14809 |
|
14810 if(search_expression_type->is_real_type(IN_param_value)) |
|
14811 { |
|
14812 |
|
14813 symbol_c * return_type_symbol = IN_type_symbol; |
|
14814 return return_type_symbol; |
|
14815 |
|
14816 } |
|
14817 |
|
14818 ERROR; |
|
14819 } |
|
14820 |
|
14821 }/*function_ln*/ |
|
14822 break; |
|
14823 |
|
14824 /**** |
|
14825 *LOG |
|
14826 */ |
|
14827 case function_log : |
|
14828 { |
|
14829 symbol_c *last_type_symbol = NULL; |
|
14830 |
|
14831 { |
|
14832 identifier_c param_name("IN"); |
|
14833 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14834 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14835 |
|
14836 /* Get the value from a foo(<param_value>) style call */ |
|
14837 if (IN_param_value == NULL) |
|
14838 IN_param_value = function_call_param_iterator.next(); |
|
14839 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14840 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14841 |
|
14842 if(search_expression_type->is_real_type(IN_param_value)) |
|
14843 { |
|
14844 |
|
14845 symbol_c * return_type_symbol = IN_type_symbol; |
|
14846 return return_type_symbol; |
|
14847 |
|
14848 } |
|
14849 |
|
14850 ERROR; |
|
14851 } |
|
14852 |
|
14853 }/*function_log*/ |
|
14854 break; |
|
14855 |
|
14856 /**** |
|
14857 *EXP |
|
14858 */ |
|
14859 case function_exp : |
|
14860 { |
|
14861 symbol_c *last_type_symbol = NULL; |
|
14862 |
|
14863 { |
|
14864 identifier_c param_name("IN"); |
|
14865 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14866 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14867 |
|
14868 /* Get the value from a foo(<param_value>) style call */ |
|
14869 if (IN_param_value == NULL) |
|
14870 IN_param_value = function_call_param_iterator.next(); |
|
14871 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14872 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14873 |
|
14874 if(search_expression_type->is_real_type(IN_param_value)) |
|
14875 { |
|
14876 |
|
14877 symbol_c * return_type_symbol = IN_type_symbol; |
|
14878 return return_type_symbol; |
|
14879 |
|
14880 } |
|
14881 |
|
14882 ERROR; |
|
14883 } |
|
14884 |
|
14885 }/*function_exp*/ |
|
14886 break; |
|
14887 |
|
14888 /**** |
|
14889 *SIN |
|
14890 */ |
|
14891 case function_sin : |
|
14892 { |
|
14893 symbol_c *last_type_symbol = NULL; |
|
14894 |
|
14895 { |
|
14896 identifier_c param_name("IN"); |
|
14897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14898 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14899 |
|
14900 /* Get the value from a foo(<param_value>) style call */ |
|
14901 if (IN_param_value == NULL) |
|
14902 IN_param_value = function_call_param_iterator.next(); |
|
14903 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14905 |
|
14906 if(search_expression_type->is_real_type(IN_param_value)) |
|
14907 { |
|
14908 |
|
14909 symbol_c * return_type_symbol = IN_type_symbol; |
|
14910 return return_type_symbol; |
|
14911 |
|
14912 } |
|
14913 |
|
14914 ERROR; |
|
14915 } |
|
14916 |
|
14917 }/*function_sin*/ |
|
14918 break; |
|
14919 |
|
14920 /**** |
|
14921 *COS |
|
14922 */ |
|
14923 case function_cos : |
|
14924 { |
|
14925 symbol_c *last_type_symbol = NULL; |
|
14926 |
|
14927 { |
|
14928 identifier_c param_name("IN"); |
|
14929 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14930 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14931 |
|
14932 /* Get the value from a foo(<param_value>) style call */ |
|
14933 if (IN_param_value == NULL) |
|
14934 IN_param_value = function_call_param_iterator.next(); |
|
14935 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14936 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14937 |
|
14938 if(search_expression_type->is_real_type(IN_param_value)) |
|
14939 { |
|
14940 |
|
14941 symbol_c * return_type_symbol = IN_type_symbol; |
|
14942 return return_type_symbol; |
|
14943 |
|
14944 } |
|
14945 |
|
14946 ERROR; |
|
14947 } |
|
14948 |
|
14949 }/*function_cos*/ |
|
14950 break; |
|
14951 |
|
14952 /**** |
|
14953 *TAN |
|
14954 */ |
|
14955 case function_tan : |
|
14956 { |
|
14957 symbol_c *last_type_symbol = NULL; |
|
14958 |
|
14959 { |
|
14960 identifier_c param_name("IN"); |
|
14961 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14962 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14963 |
|
14964 /* Get the value from a foo(<param_value>) style call */ |
|
14965 if (IN_param_value == NULL) |
|
14966 IN_param_value = function_call_param_iterator.next(); |
|
14967 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14968 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14969 |
|
14970 if(search_expression_type->is_real_type(IN_param_value)) |
|
14971 { |
|
14972 |
|
14973 symbol_c * return_type_symbol = IN_type_symbol; |
|
14974 return return_type_symbol; |
|
14975 |
|
14976 } |
|
14977 |
|
14978 ERROR; |
|
14979 } |
|
14980 |
|
14981 }/*function_tan*/ |
|
14982 break; |
|
14983 |
|
14984 /**** |
|
14985 *ASIN |
|
14986 */ |
|
14987 case function_asin : |
|
14988 { |
|
14989 symbol_c *last_type_symbol = NULL; |
|
14990 |
|
14991 { |
|
14992 identifier_c param_name("IN"); |
|
14993 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14994 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14995 |
|
14996 /* Get the value from a foo(<param_value>) style call */ |
|
14997 if (IN_param_value == NULL) |
|
14998 IN_param_value = function_call_param_iterator.next(); |
|
14999 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15000 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15001 |
|
15002 if(search_expression_type->is_real_type(IN_param_value)) |
|
15003 { |
|
15004 |
|
15005 symbol_c * return_type_symbol = IN_type_symbol; |
|
15006 return return_type_symbol; |
|
15007 |
|
15008 } |
|
15009 |
|
15010 ERROR; |
|
15011 } |
|
15012 |
|
15013 }/*function_asin*/ |
|
15014 break; |
|
15015 |
|
15016 /**** |
|
15017 *ACOS |
|
15018 */ |
|
15019 case function_acos : |
|
15020 { |
|
15021 symbol_c *last_type_symbol = NULL; |
|
15022 |
|
15023 { |
|
15024 identifier_c param_name("IN"); |
|
15025 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15026 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15027 |
|
15028 /* Get the value from a foo(<param_value>) style call */ |
|
15029 if (IN_param_value == NULL) |
|
15030 IN_param_value = function_call_param_iterator.next(); |
|
15031 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15032 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15033 |
|
15034 if(search_expression_type->is_real_type(IN_param_value)) |
|
15035 { |
|
15036 |
|
15037 symbol_c * return_type_symbol = IN_type_symbol; |
|
15038 return return_type_symbol; |
|
15039 |
|
15040 } |
|
15041 |
|
15042 ERROR; |
|
15043 } |
|
15044 |
|
15045 }/*function_acos*/ |
|
15046 break; |
|
15047 |
|
15048 /**** |
|
15049 *ATAN |
|
15050 */ |
|
15051 case function_atan : |
|
15052 { |
|
15053 symbol_c *last_type_symbol = NULL; |
|
15054 |
|
15055 { |
|
15056 identifier_c param_name("IN"); |
|
15057 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15058 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15059 |
|
15060 /* Get the value from a foo(<param_value>) style call */ |
|
15061 if (IN_param_value == NULL) |
|
15062 IN_param_value = function_call_param_iterator.next(); |
|
15063 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15064 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15065 |
|
15066 if(search_expression_type->is_real_type(IN_param_value)) |
|
15067 { |
|
15068 |
|
15069 symbol_c * return_type_symbol = IN_type_symbol; |
|
15070 return return_type_symbol; |
|
15071 |
|
15072 } |
|
15073 |
|
15074 ERROR; |
|
15075 } |
|
15076 |
|
15077 }/*function_atan*/ |
|
15078 break; |
|
15079 |
|
15080 /**** |
|
15081 *ADD |
|
15082 */ |
|
15083 case function_add : |
|
15084 { |
|
15085 symbol_c *last_type_symbol = NULL; |
|
15086 |
|
15087 { |
|
15088 identifier_c param_name("IN1"); |
|
15089 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15090 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15091 |
|
15092 /* Get the value from a foo(<param_value>) style call */ |
|
15093 if (IN1_param_value == NULL) |
|
15094 IN1_param_value = function_call_param_iterator.next(); |
|
15095 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15096 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15097 |
|
15098 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15099 { |
|
15100 |
|
15101 { |
|
15102 identifier_c param_name("IN2"); |
|
15103 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15104 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15105 |
|
15106 /* Get the value from a foo(<param_value>) style call */ |
|
15107 if (IN2_param_value == NULL) |
|
15108 IN2_param_value = function_call_param_iterator.next(); |
|
15109 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15110 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15111 |
|
15112 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15113 { |
|
15114 |
|
15115 symbol_c * return_type_symbol = last_type_symbol; |
|
15116 return return_type_symbol; |
|
15117 |
|
15118 } |
|
15119 |
|
15120 ERROR; |
|
15121 } |
|
15122 |
|
15123 } |
|
15124 |
|
15125 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
15126 { |
|
15127 |
|
15128 { |
|
15129 identifier_c param_name("IN2"); |
|
15130 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15131 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15132 |
|
15133 /* Get the value from a foo(<param_value>) style call */ |
|
15134 if (IN2_param_value == NULL) |
|
15135 IN2_param_value = function_call_param_iterator.next(); |
|
15136 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15137 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15138 |
|
15139 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15140 { |
|
15141 |
|
15142 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
15143 return return_type_symbol; |
|
15144 |
|
15145 } |
|
15146 |
|
15147 ERROR; |
|
15148 } |
|
15149 |
|
15150 } |
|
15151 |
|
15152 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
15153 { |
|
15154 |
|
15155 { |
|
15156 identifier_c param_name("IN2"); |
|
15157 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15158 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15159 |
|
15160 /* Get the value from a foo(<param_value>) style call */ |
|
15161 if (IN2_param_value == NULL) |
|
15162 IN2_param_value = function_call_param_iterator.next(); |
|
15163 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15164 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15165 |
|
15166 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15167 { |
|
15168 |
|
15169 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
15170 return return_type_symbol; |
|
15171 |
|
15172 } |
|
15173 |
|
15174 ERROR; |
|
15175 } |
|
15176 |
|
15177 } |
|
15178 |
|
15179 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15180 { |
|
15181 |
|
15182 { |
|
15183 identifier_c param_name("IN2"); |
|
15184 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15185 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15186 |
|
15187 /* Get the value from a foo(<param_value>) style call */ |
|
15188 if (IN2_param_value == NULL) |
|
15189 IN2_param_value = function_call_param_iterator.next(); |
|
15190 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15191 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15192 |
|
15193 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15194 { |
|
15195 |
|
15196 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15197 return return_type_symbol; |
|
15198 |
|
15199 } |
|
15200 |
|
15201 ERROR; |
|
15202 } |
|
15203 |
|
15204 } |
|
15205 |
|
15206 ERROR; |
|
15207 } |
|
15208 |
|
15209 }/*function_add*/ |
|
15210 break; |
|
15211 |
|
15212 /**** |
|
15213 *MUL |
|
15214 */ |
|
15215 case function_mul : |
|
15216 { |
|
15217 symbol_c *last_type_symbol = NULL; |
|
15218 |
|
15219 { |
|
15220 identifier_c param_name("IN1"); |
|
15221 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15222 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15223 |
|
15224 /* Get the value from a foo(<param_value>) style call */ |
|
15225 if (IN1_param_value == NULL) |
|
15226 IN1_param_value = function_call_param_iterator.next(); |
|
15227 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15228 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15229 |
|
15230 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15231 { |
|
15232 |
|
15233 { |
|
15234 identifier_c param_name("IN2"); |
|
15235 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15236 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15237 |
|
15238 /* Get the value from a foo(<param_value>) style call */ |
|
15239 if (IN2_param_value == NULL) |
|
15240 IN2_param_value = function_call_param_iterator.next(); |
|
15241 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15242 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15243 |
|
15244 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15245 { |
|
15246 |
|
15247 symbol_c * return_type_symbol = last_type_symbol; |
|
15248 return return_type_symbol; |
|
15249 |
|
15250 } |
|
15251 |
|
15252 ERROR; |
|
15253 } |
|
15254 |
|
15255 } |
|
15256 |
|
15257 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15258 { |
|
15259 |
|
15260 { |
|
15261 identifier_c param_name("IN2"); |
|
15262 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15263 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15264 |
|
15265 /* Get the value from a foo(<param_value>) style call */ |
|
15266 if (IN2_param_value == NULL) |
|
15267 IN2_param_value = function_call_param_iterator.next(); |
|
15268 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15269 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15270 |
|
15271 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15272 { |
|
15273 |
|
15274 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15275 return return_type_symbol; |
|
15276 |
|
15277 } |
|
15278 |
|
15279 ERROR; |
|
15280 } |
|
15281 |
|
15282 } |
|
15283 |
|
15284 ERROR; |
|
15285 } |
|
15286 |
|
15287 }/*function_mul*/ |
|
15288 break; |
|
15289 |
|
15290 /**** |
|
15291 *SUB |
|
15292 */ |
|
15293 case function_sub : |
|
15294 { |
|
15295 symbol_c *last_type_symbol = NULL; |
|
15296 |
|
15297 { |
|
15298 identifier_c param_name("IN1"); |
|
15299 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15300 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15301 |
|
15302 /* Get the value from a foo(<param_value>) style call */ |
|
15303 if (IN1_param_value == NULL) |
|
15304 IN1_param_value = function_call_param_iterator.next(); |
|
15305 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15306 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15307 |
|
15308 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15309 { |
|
15310 |
|
15311 { |
|
15312 identifier_c param_name("IN2"); |
|
15313 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15314 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15315 |
|
15316 /* Get the value from a foo(<param_value>) style call */ |
|
15317 if (IN2_param_value == NULL) |
|
15318 IN2_param_value = function_call_param_iterator.next(); |
|
15319 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15320 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15321 |
|
15322 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15323 { |
|
15324 |
|
15325 symbol_c * return_type_symbol = last_type_symbol; |
|
15326 return return_type_symbol; |
|
15327 |
|
15328 } |
|
15329 |
|
15330 ERROR; |
|
15331 } |
|
15332 |
|
15333 } |
|
15334 |
|
15335 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
15336 { |
|
15337 |
|
15338 { |
|
15339 identifier_c param_name("IN2"); |
|
15340 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15341 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15342 |
|
15343 /* Get the value from a foo(<param_value>) style call */ |
|
15344 if (IN2_param_value == NULL) |
|
15345 IN2_param_value = function_call_param_iterator.next(); |
|
15346 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15347 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15348 |
|
15349 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
15350 { |
|
15351 |
|
15352 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15353 return return_type_symbol; |
|
15354 |
|
15355 } |
|
15356 |
|
15357 ERROR; |
|
15358 } |
|
15359 |
|
15360 } |
|
15361 |
|
15362 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
15363 { |
|
15364 |
|
15365 { |
|
15366 identifier_c param_name("IN2"); |
|
15367 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15368 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15369 |
|
15370 /* Get the value from a foo(<param_value>) style call */ |
|
15371 if (IN2_param_value == NULL) |
|
15372 IN2_param_value = function_call_param_iterator.next(); |
|
15373 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15374 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15375 |
|
15376 if (typeid(*last_type_symbol) == typeid(dt_type_name_c)) |
|
15377 { |
|
15378 |
|
15379 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15380 return return_type_symbol; |
|
15381 |
|
15382 } |
|
15383 |
|
15384 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15385 { |
|
15386 |
|
15387 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
15388 return return_type_symbol; |
|
15389 |
|
15390 } |
|
15391 |
|
15392 ERROR; |
|
15393 } |
|
15394 |
|
15395 } |
|
15396 |
|
15397 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
15398 { |
|
15399 |
|
15400 { |
|
15401 identifier_c param_name("IN2"); |
|
15402 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15403 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15404 |
|
15405 /* Get the value from a foo(<param_value>) style call */ |
|
15406 if (IN2_param_value == NULL) |
|
15407 IN2_param_value = function_call_param_iterator.next(); |
|
15408 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15409 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15410 |
|
15411 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
15412 { |
|
15413 |
|
15414 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15415 return return_type_symbol; |
|
15416 |
|
15417 } |
|
15418 |
|
15419 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15420 { |
|
15421 |
|
15422 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
15423 return return_type_symbol; |
|
15424 |
|
15425 } |
|
15426 |
|
15427 ERROR; |
|
15428 } |
|
15429 |
|
15430 } |
|
15431 |
|
15432 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15433 { |
|
15434 |
|
15435 { |
|
15436 identifier_c param_name("IN2"); |
|
15437 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15438 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15439 |
|
15440 /* Get the value from a foo(<param_value>) style call */ |
|
15441 if (IN2_param_value == NULL) |
|
15442 IN2_param_value = function_call_param_iterator.next(); |
|
15443 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15444 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15445 |
|
15446 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15447 { |
|
15448 |
|
15449 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15450 return return_type_symbol; |
|
15451 |
|
15452 } |
|
15453 |
|
15454 ERROR; |
|
15455 } |
|
15456 |
|
15457 } |
|
15458 |
|
15459 ERROR; |
|
15460 } |
|
15461 |
|
15462 }/*function_sub*/ |
|
15463 break; |
|
15464 |
|
15465 /**** |
|
15466 *DIV |
|
15467 */ |
|
15468 case function_div : |
|
15469 { |
|
15470 symbol_c *last_type_symbol = NULL; |
|
15471 |
|
15472 { |
|
15473 identifier_c param_name("IN1"); |
|
15474 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15475 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15476 |
|
15477 /* Get the value from a foo(<param_value>) style call */ |
|
15478 if (IN1_param_value == NULL) |
|
15479 IN1_param_value = function_call_param_iterator.next(); |
|
15480 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15481 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15482 |
|
15483 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15484 { |
|
15485 |
|
15486 { |
|
15487 identifier_c param_name("IN2"); |
|
15488 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15489 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15490 |
|
15491 /* Get the value from a foo(<param_value>) style call */ |
|
15492 if (IN2_param_value == NULL) |
|
15493 IN2_param_value = function_call_param_iterator.next(); |
|
15494 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15495 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15496 |
|
15497 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15498 { |
|
15499 |
|
15500 symbol_c * return_type_symbol = last_type_symbol; |
|
15501 return return_type_symbol; |
|
15502 |
|
15503 } |
|
15504 |
|
15505 ERROR; |
|
15506 } |
|
15507 |
|
15508 } |
|
15509 |
|
15510 if (typeid(*last_type_symbol) == typeid(time_type_name_c)) |
|
15511 { |
|
15512 |
|
15513 { |
|
15514 identifier_c param_name("IN2"); |
|
15515 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15516 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15517 |
|
15518 /* Get the value from a foo(<param_value>) style call */ |
|
15519 if (IN2_param_value == NULL) |
|
15520 IN2_param_value = function_call_param_iterator.next(); |
|
15521 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15522 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15523 |
|
15524 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15525 { |
|
15526 |
|
15527 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
15528 return return_type_symbol; |
|
15529 |
|
15530 } |
|
15531 |
|
15532 ERROR; |
|
15533 } |
|
15534 |
|
15535 } |
|
15536 |
|
15537 ERROR; |
|
15538 } |
|
15539 |
|
15540 }/*function_div*/ |
|
15541 break; |
|
15542 |
|
15543 /**** |
|
15544 *MOD |
|
15545 */ |
|
15546 case function_mod : |
|
15547 { |
|
15548 symbol_c *last_type_symbol = NULL; |
|
15549 |
|
15550 { |
|
15551 identifier_c param_name("IN1"); |
|
15552 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15553 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15554 |
|
15555 /* Get the value from a foo(<param_value>) style call */ |
|
15556 if (IN1_param_value == NULL) |
|
15557 IN1_param_value = function_call_param_iterator.next(); |
|
15558 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15559 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15560 |
|
15561 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15562 { |
|
15563 |
|
15564 { |
|
15565 identifier_c param_name("IN2"); |
|
15566 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15567 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15568 |
|
15569 /* Get the value from a foo(<param_value>) style call */ |
|
15570 if (IN2_param_value == NULL) |
|
15571 IN2_param_value = function_call_param_iterator.next(); |
|
15572 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15573 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15574 |
|
15575 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15576 { |
|
15577 |
|
15578 symbol_c * return_type_symbol = last_type_symbol; |
|
15579 return return_type_symbol; |
|
15580 |
|
15581 } |
|
15582 |
|
15583 ERROR; |
|
15584 } |
|
15585 |
|
15586 } |
|
15587 |
|
15588 ERROR; |
|
15589 } |
|
15590 |
|
15591 }/*function_mod*/ |
|
15592 break; |
|
15593 |
|
15594 /**** |
|
15595 *EXPT |
|
15596 */ |
|
15597 case function_expt : |
|
15598 { |
|
15599 symbol_c *last_type_symbol = NULL; |
|
15600 |
|
15601 { |
|
15602 identifier_c param_name("IN1"); |
|
15603 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15604 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15605 |
|
15606 /* Get the value from a foo(<param_value>) style call */ |
|
15607 if (IN1_param_value == NULL) |
|
15608 IN1_param_value = function_call_param_iterator.next(); |
|
15609 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15610 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15611 |
|
15612 if(search_expression_type->is_num_type(IN1_param_value)) |
|
15613 { |
|
15614 |
|
15615 { |
|
15616 identifier_c param_name("IN2"); |
|
15617 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15618 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15619 |
|
15620 /* Get the value from a foo(<param_value>) style call */ |
|
15621 if (IN2_param_value == NULL) |
|
15622 IN2_param_value = function_call_param_iterator.next(); |
|
15623 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15624 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15625 |
|
15626 if(search_expression_type->is_num_type(IN2_param_value)) |
|
15627 { |
|
15628 |
|
15629 symbol_c * return_type_symbol = last_type_symbol; |
|
15630 return return_type_symbol; |
|
15631 |
|
15632 } |
|
15633 |
|
15634 ERROR; |
|
15635 } |
|
15636 |
|
15637 } |
|
15638 |
|
15639 ERROR; |
|
15640 } |
|
15641 |
|
15642 }/*function_expt*/ |
|
15643 break; |
|
15644 |
|
15645 /**** |
|
15646 *MOVE |
|
15647 */ |
|
15648 case function_move : |
|
15649 { |
|
15650 symbol_c *last_type_symbol = NULL; |
|
15651 |
|
15652 { |
|
15653 identifier_c param_name("IN"); |
|
15654 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15655 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15656 |
|
15657 /* Get the value from a foo(<param_value>) style call */ |
|
15658 if (IN_param_value == NULL) |
|
15659 IN_param_value = function_call_param_iterator.next(); |
|
15660 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15661 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15662 |
|
15663 if(search_expression_type->is_num_type(IN_param_value)) |
|
15664 { |
|
15665 |
|
15666 symbol_c * return_type_symbol = last_type_symbol; |
|
15667 return return_type_symbol; |
|
15668 |
|
15669 } |
|
15670 |
|
15671 ERROR; |
|
15672 } |
|
15673 |
|
15674 }/*function_move*/ |
|
15675 break; |
|
15676 |
|
15677 /**** |
|
15678 *SHL |
|
15679 */ |
|
15680 case function_shl : |
|
15681 { |
|
15682 symbol_c *last_type_symbol = NULL; |
|
15683 |
|
15684 { |
|
15685 identifier_c param_name("IN"); |
|
15686 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15687 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15688 |
|
15689 /* Get the value from a foo(<param_value>) style call */ |
|
15690 if (IN_param_value == NULL) |
|
15691 IN_param_value = function_call_param_iterator.next(); |
|
15692 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15693 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15694 |
|
15695 if(search_expression_type->is_binary_type(IN_param_value)) |
|
15696 { |
|
15697 |
|
15698 { |
|
15699 identifier_c param_name("N"); |
|
15700 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15701 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
15702 |
|
15703 /* Get the value from a foo(<param_value>) style call */ |
|
15704 if (N_param_value == NULL) |
|
15705 N_param_value = function_call_param_iterator.next(); |
|
15706 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
15707 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; |
|
15708 |
|
15709 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
15710 { |
|
15711 |
|
15712 symbol_c * return_type_symbol = IN_type_symbol; |
|
15713 return return_type_symbol; |
|
15714 |
|
15715 } |
|
15716 |
|
15717 ERROR; |
|
15718 } |
|
15719 |
|
15720 } |
|
15721 |
|
15722 ERROR; |
|
15723 } |
|
15724 |
|
15725 }/*function_shl*/ |
|
15726 break; |
|
15727 |
|
15728 /**** |
|
15729 *SHR |
|
15730 */ |
|
15731 case function_shr : |
|
15732 { |
|
15733 symbol_c *last_type_symbol = NULL; |
|
15734 |
|
15735 { |
|
15736 identifier_c param_name("IN"); |
|
15737 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15738 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15739 |
|
15740 /* Get the value from a foo(<param_value>) style call */ |
|
15741 if (IN_param_value == NULL) |
|
15742 IN_param_value = function_call_param_iterator.next(); |
|
15743 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15744 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15745 |
|
15746 if(search_expression_type->is_binary_type(IN_param_value)) |
|
15747 { |
|
15748 |
|
15749 { |
|
15750 identifier_c param_name("N"); |
|
15751 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15752 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
15753 |
|
15754 /* Get the value from a foo(<param_value>) style call */ |
|
15755 if (N_param_value == NULL) |
|
15756 N_param_value = function_call_param_iterator.next(); |
|
15757 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
15758 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; |
|
15759 |
|
15760 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
15761 { |
|
15762 |
|
15763 symbol_c * return_type_symbol = IN_type_symbol; |
|
15764 return return_type_symbol; |
|
15765 |
|
15766 } |
|
15767 |
|
15768 ERROR; |
|
15769 } |
|
15770 |
|
15771 } |
|
15772 |
|
15773 ERROR; |
|
15774 } |
|
15775 |
|
15776 }/*function_shr*/ |
|
15777 break; |
|
15778 |
|
15779 /**** |
|
15780 *ROR |
|
15781 */ |
|
15782 case function_ror : |
|
15783 { |
|
15784 symbol_c *last_type_symbol = NULL; |
|
15785 |
|
15786 { |
|
15787 identifier_c param_name("IN"); |
|
15788 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15789 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15790 |
|
15791 /* Get the value from a foo(<param_value>) style call */ |
|
15792 if (IN_param_value == NULL) |
|
15793 IN_param_value = function_call_param_iterator.next(); |
|
15794 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15795 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15796 |
|
15797 if(search_expression_type->is_binary_type(IN_param_value)) |
|
15798 { |
|
15799 |
|
15800 { |
|
15801 identifier_c param_name("N"); |
|
15802 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15803 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
15804 |
|
15805 /* Get the value from a foo(<param_value>) style call */ |
|
15806 if (N_param_value == NULL) |
|
15807 N_param_value = function_call_param_iterator.next(); |
|
15808 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
15809 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; |
|
15810 |
|
15811 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
15812 { |
|
15813 |
|
15814 symbol_c * return_type_symbol = IN_type_symbol; |
|
15815 return return_type_symbol; |
|
15816 |
|
15817 } |
|
15818 |
|
15819 ERROR; |
|
15820 } |
|
15821 |
|
15822 } |
|
15823 |
|
15824 ERROR; |
|
15825 } |
|
15826 |
|
15827 }/*function_ror*/ |
|
15828 break; |
|
15829 |
|
15830 /**** |
|
15831 *ROL |
|
15832 */ |
|
15833 case function_rol : |
|
15834 { |
|
15835 symbol_c *last_type_symbol = NULL; |
|
15836 |
|
15837 { |
|
15838 identifier_c param_name("IN"); |
|
15839 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15840 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
15841 |
|
15842 /* Get the value from a foo(<param_value>) style call */ |
|
15843 if (IN_param_value == NULL) |
|
15844 IN_param_value = function_call_param_iterator.next(); |
|
15845 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
15846 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
15847 |
|
15848 if(search_expression_type->is_binary_type(IN_param_value)) |
|
15849 { |
|
15850 |
|
15851 { |
|
15852 identifier_c param_name("N"); |
|
15853 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15854 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
15855 |
|
15856 /* Get the value from a foo(<param_value>) style call */ |
|
15857 if (N_param_value == NULL) |
|
15858 N_param_value = function_call_param_iterator.next(); |
|
15859 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
15860 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; |
|
15861 |
|
15862 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
15863 { |
|
15864 |
|
15865 symbol_c * return_type_symbol = IN_type_symbol; |
|
15866 return return_type_symbol; |
|
15867 |
|
15868 } |
|
15869 |
|
15870 ERROR; |
|
15871 } |
|
15872 |
|
15873 } |
|
15874 |
|
15875 ERROR; |
|
15876 } |
|
15877 |
|
15878 }/*function_rol*/ |
|
15879 break; |
|
15880 |
|
15881 /**** |
|
15882 *AND |
|
15883 */ |
|
15884 case function_and : |
|
15885 { |
|
15886 symbol_c *last_type_symbol = NULL; |
|
15887 |
|
15888 { |
|
15889 identifier_c param_name("IN1"); |
|
15890 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15891 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15892 |
|
15893 /* Get the value from a foo(<param_value>) style call */ |
|
15894 if (IN1_param_value == NULL) |
|
15895 IN1_param_value = function_call_param_iterator.next(); |
|
15896 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15897 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15898 |
|
15899 if(search_expression_type->is_binary_type(IN1_param_value)) |
|
15900 { |
|
15901 |
|
15902 { |
|
15903 identifier_c param_name("IN2"); |
|
15904 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15905 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15906 |
|
15907 /* Get the value from a foo(<param_value>) style call */ |
|
15908 if (IN2_param_value == NULL) |
|
15909 IN2_param_value = function_call_param_iterator.next(); |
|
15910 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15911 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15912 |
|
15913 if(search_expression_type->is_binary_type(IN2_param_value)) |
|
15914 { |
|
15915 |
|
15916 symbol_c * return_type_symbol = last_type_symbol; |
|
15917 return return_type_symbol; |
|
15918 |
|
15919 } |
|
15920 |
|
15921 ERROR; |
|
15922 } |
|
15923 |
|
15924 } |
|
15925 |
|
15926 ERROR; |
|
15927 } |
|
15928 |
|
15929 }/*function_and*/ |
|
15930 break; |
|
15931 |
|
15932 /**** |
|
15933 *OR |
|
15934 */ |
|
15935 case function_or : |
|
15936 { |
|
15937 symbol_c *last_type_symbol = NULL; |
|
15938 |
|
15939 { |
|
15940 identifier_c param_name("IN1"); |
|
15941 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15942 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15943 |
|
15944 /* Get the value from a foo(<param_value>) style call */ |
|
15945 if (IN1_param_value == NULL) |
|
15946 IN1_param_value = function_call_param_iterator.next(); |
|
15947 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15948 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
15949 |
|
15950 if(search_expression_type->is_binary_type(IN1_param_value)) |
|
15951 { |
|
15952 |
|
15953 { |
|
15954 identifier_c param_name("IN2"); |
|
15955 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15956 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15957 |
|
15958 /* Get the value from a foo(<param_value>) style call */ |
|
15959 if (IN2_param_value == NULL) |
|
15960 IN2_param_value = function_call_param_iterator.next(); |
|
15961 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15962 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
15963 |
|
15964 if(search_expression_type->is_binary_type(IN2_param_value)) |
|
15965 { |
|
15966 |
|
15967 symbol_c * return_type_symbol = last_type_symbol; |
|
15968 return return_type_symbol; |
|
15969 |
|
15970 } |
|
15971 |
|
15972 ERROR; |
|
15973 } |
|
15974 |
|
15975 } |
|
15976 |
|
15977 ERROR; |
|
15978 } |
|
15979 |
|
15980 }/*function_or*/ |
|
15981 break; |
|
15982 |
|
15983 /**** |
|
15984 *XOR |
|
15985 */ |
|
15986 case function_xor : |
|
15987 { |
|
15988 symbol_c *last_type_symbol = NULL; |
|
15989 |
|
15990 { |
|
15991 identifier_c param_name("IN1"); |
|
15992 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15993 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
15994 |
|
15995 /* Get the value from a foo(<param_value>) style call */ |
|
15996 if (IN1_param_value == NULL) |
|
15997 IN1_param_value = function_call_param_iterator.next(); |
|
15998 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
15999 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16000 |
|
16001 if(search_expression_type->is_binary_type(IN1_param_value)) |
|
16002 { |
|
16003 |
|
16004 { |
|
16005 identifier_c param_name("IN2"); |
|
16006 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16007 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16008 |
|
16009 /* Get the value from a foo(<param_value>) style call */ |
|
16010 if (IN2_param_value == NULL) |
|
16011 IN2_param_value = function_call_param_iterator.next(); |
|
16012 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16013 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16014 |
|
16015 if(search_expression_type->is_binary_type(IN2_param_value)) |
|
16016 { |
|
16017 |
|
16018 symbol_c * return_type_symbol = last_type_symbol; |
|
16019 return return_type_symbol; |
|
16020 |
|
16021 } |
|
16022 |
|
16023 ERROR; |
|
16024 } |
|
16025 |
|
16026 } |
|
16027 |
|
16028 ERROR; |
|
16029 } |
|
16030 |
|
16031 }/*function_xor*/ |
|
16032 break; |
|
16033 |
|
16034 /**** |
|
16035 *NOT |
|
16036 */ |
|
16037 case function_not : |
|
16038 { |
|
16039 symbol_c *last_type_symbol = NULL; |
|
16040 |
|
16041 { |
|
16042 identifier_c param_name("IN"); |
|
16043 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16044 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16045 |
|
16046 /* Get the value from a foo(<param_value>) style call */ |
|
16047 if (IN_param_value == NULL) |
|
16048 IN_param_value = function_call_param_iterator.next(); |
|
16049 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16050 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16051 |
|
16052 if(search_expression_type->is_binary_type(IN_param_value)) |
|
16053 { |
|
16054 |
|
16055 symbol_c * return_type_symbol = IN_type_symbol; |
|
16056 return return_type_symbol; |
|
16057 |
|
16058 } |
|
16059 |
|
16060 ERROR; |
|
16061 } |
|
16062 |
|
16063 }/*function_not*/ |
|
16064 break; |
|
16065 |
|
16066 /**** |
|
16067 *SEL |
|
16068 */ |
|
16069 case function_sel : |
|
16070 { |
|
16071 symbol_c *last_type_symbol = NULL; |
|
16072 |
|
16073 { |
|
16074 identifier_c param_name("G"); |
|
16075 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16076 symbol_c *G_param_value = function_call_param_iterator.search(¶m_name); |
|
16077 |
|
16078 /* Get the value from a foo(<param_value>) style call */ |
|
16079 if (G_param_value == NULL) |
|
16080 G_param_value = function_call_param_iterator.next(); |
|
16081 symbol_c *G_type_symbol = search_expression_type->get_type(G_param_value); |
|
16082 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ; |
|
16083 |
|
16084 if (typeid(*last_type_symbol) == typeid(bool_type_name_c)) |
|
16085 { |
|
16086 |
|
16087 { |
|
16088 identifier_c param_name("IN0"); |
|
16089 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16090 symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); |
|
16091 |
|
16092 /* Get the value from a foo(<param_value>) style call */ |
|
16093 if (IN0_param_value == NULL) |
|
16094 IN0_param_value = function_call_param_iterator.next(); |
|
16095 symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); |
|
16096 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; |
|
16097 |
|
16098 |
|
16099 { |
|
16100 |
|
16101 { |
|
16102 identifier_c param_name("IN1"); |
|
16103 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16104 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16105 |
|
16106 /* Get the value from a foo(<param_value>) style call */ |
|
16107 if (IN1_param_value == NULL) |
|
16108 IN1_param_value = function_call_param_iterator.next(); |
|
16109 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16110 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16111 |
|
16112 |
|
16113 { |
|
16114 |
|
16115 symbol_c * return_type_symbol = last_type_symbol; |
|
16116 return return_type_symbol; |
|
16117 |
|
16118 } |
|
16119 |
|
16120 ERROR; |
|
16121 } |
|
16122 |
|
16123 } |
|
16124 |
|
16125 ERROR; |
|
16126 } |
|
16127 |
|
16128 } |
|
16129 |
|
16130 ERROR; |
|
16131 } |
|
16132 |
|
16133 }/*function_sel*/ |
|
16134 break; |
|
16135 |
|
16136 /**** |
|
16137 *MAX |
|
16138 */ |
|
16139 case function_max : |
|
16140 { |
|
16141 symbol_c *last_type_symbol = NULL; |
|
16142 |
|
16143 { |
|
16144 identifier_c param_name("IN1"); |
|
16145 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16146 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16147 |
|
16148 /* Get the value from a foo(<param_value>) style call */ |
|
16149 if (IN1_param_value == NULL) |
|
16150 IN1_param_value = function_call_param_iterator.next(); |
|
16151 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16152 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16153 |
|
16154 |
|
16155 { |
|
16156 |
|
16157 { |
|
16158 identifier_c param_name("IN2"); |
|
16159 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16160 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16161 |
|
16162 /* Get the value from a foo(<param_value>) style call */ |
|
16163 if (IN2_param_value == NULL) |
|
16164 IN2_param_value = function_call_param_iterator.next(); |
|
16165 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16166 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16167 |
|
16168 |
|
16169 { |
|
16170 |
|
16171 symbol_c * return_type_symbol = last_type_symbol; |
|
16172 return return_type_symbol; |
|
16173 |
|
16174 } |
|
16175 |
|
16176 ERROR; |
|
16177 } |
|
16178 |
|
16179 } |
|
16180 |
|
16181 ERROR; |
|
16182 } |
|
16183 |
|
16184 }/*function_max*/ |
|
16185 break; |
|
16186 |
|
16187 /**** |
|
16188 *MIN |
|
16189 */ |
|
16190 case function_min : |
|
16191 { |
|
16192 symbol_c *last_type_symbol = NULL; |
|
16193 |
|
16194 { |
|
16195 identifier_c param_name("IN1"); |
|
16196 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16197 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16198 |
|
16199 /* Get the value from a foo(<param_value>) style call */ |
|
16200 if (IN1_param_value == NULL) |
|
16201 IN1_param_value = function_call_param_iterator.next(); |
|
16202 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16203 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16204 |
|
16205 |
|
16206 { |
|
16207 |
|
16208 { |
|
16209 identifier_c param_name("IN2"); |
|
16210 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16211 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16212 |
|
16213 /* Get the value from a foo(<param_value>) style call */ |
|
16214 if (IN2_param_value == NULL) |
|
16215 IN2_param_value = function_call_param_iterator.next(); |
|
16216 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16217 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16218 |
|
16219 |
|
16220 { |
|
16221 |
|
16222 symbol_c * return_type_symbol = last_type_symbol; |
|
16223 return return_type_symbol; |
|
16224 |
|
16225 } |
|
16226 |
|
16227 ERROR; |
|
16228 } |
|
16229 |
|
16230 } |
|
16231 |
|
16232 ERROR; |
|
16233 } |
|
16234 |
|
16235 }/*function_min*/ |
|
16236 break; |
|
16237 |
|
16238 /**** |
|
16239 *LIMIT |
|
16240 */ |
|
16241 case function_limit : |
|
16242 { |
|
16243 symbol_c *last_type_symbol = NULL; |
|
16244 |
|
16245 { |
|
16246 identifier_c param_name("MN"); |
|
16247 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16248 symbol_c *MN_param_value = function_call_param_iterator.search(¶m_name); |
|
16249 |
|
16250 /* Get the value from a foo(<param_value>) style call */ |
|
16251 if (MN_param_value == NULL) |
|
16252 MN_param_value = function_call_param_iterator.next(); |
|
16253 symbol_c *MN_type_symbol = search_expression_type->get_type(MN_param_value); |
|
16254 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ; |
|
16255 |
|
16256 |
|
16257 { |
|
16258 |
|
16259 { |
|
16260 identifier_c param_name("IN"); |
|
16261 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16262 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16263 |
|
16264 /* Get the value from a foo(<param_value>) style call */ |
|
16265 if (IN_param_value == NULL) |
|
16266 IN_param_value = function_call_param_iterator.next(); |
|
16267 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16268 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16269 |
|
16270 |
|
16271 { |
|
16272 |
|
16273 { |
|
16274 identifier_c param_name("MX"); |
|
16275 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16276 symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name); |
|
16277 |
|
16278 /* Get the value from a foo(<param_value>) style call */ |
|
16279 if (MX_param_value == NULL) |
|
16280 MX_param_value = function_call_param_iterator.next(); |
|
16281 symbol_c *MX_type_symbol = search_expression_type->get_type(MX_param_value); |
|
16282 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; |
|
16283 |
|
16284 |
|
16285 { |
|
16286 |
|
16287 symbol_c * return_type_symbol = IN_type_symbol; |
|
16288 return return_type_symbol; |
|
16289 |
|
16290 } |
|
16291 |
|
16292 ERROR; |
|
16293 } |
|
16294 |
|
16295 } |
|
16296 |
|
16297 ERROR; |
|
16298 } |
|
16299 |
|
16300 } |
|
16301 |
|
16302 ERROR; |
|
16303 } |
|
16304 |
|
16305 }/*function_limit*/ |
|
16306 break; |
|
16307 |
|
16308 /**** |
|
16309 *MUX |
|
16310 */ |
|
16311 case function_mux : |
|
16312 { |
|
16313 symbol_c *last_type_symbol = NULL; |
|
16314 |
|
16315 { |
|
16316 identifier_c param_name("K"); |
|
16317 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16318 symbol_c *K_param_value = function_call_param_iterator.search(¶m_name); |
|
16319 |
|
16320 /* Get the value from a foo(<param_value>) style call */ |
|
16321 if (K_param_value == NULL) |
|
16322 K_param_value = function_call_param_iterator.next(); |
|
16323 symbol_c *K_type_symbol = search_expression_type->get_type(K_param_value); |
|
16324 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ; |
|
16325 |
|
16326 if(search_expression_type->is_integer_type(K_param_value)) |
|
16327 { |
|
16328 |
|
16329 { |
|
16330 identifier_c param_name("IN0"); |
|
16331 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16332 symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); |
|
16333 |
|
16334 /* Get the value from a foo(<param_value>) style call */ |
|
16335 if (IN0_param_value == NULL) |
|
16336 IN0_param_value = function_call_param_iterator.next(); |
|
16337 symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); |
|
16338 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; |
|
16339 |
|
16340 |
|
16341 { |
|
16342 |
|
16343 { |
|
16344 identifier_c param_name("IN1"); |
|
16345 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16346 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16347 |
|
16348 /* Get the value from a foo(<param_value>) style call */ |
|
16349 if (IN1_param_value == NULL) |
|
16350 IN1_param_value = function_call_param_iterator.next(); |
|
16351 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16352 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16353 |
|
16354 |
|
16355 { |
|
16356 |
|
16357 symbol_c * return_type_symbol = last_type_symbol; |
|
16358 return return_type_symbol; |
|
16359 |
|
16360 } |
|
16361 |
|
16362 ERROR; |
|
16363 } |
|
16364 |
|
16365 } |
|
16366 |
|
16367 ERROR; |
|
16368 } |
|
16369 |
|
16370 } |
|
16371 |
|
16372 ERROR; |
|
16373 } |
|
16374 |
|
16375 }/*function_mux*/ |
|
16376 break; |
|
16377 |
|
16378 /**** |
|
16379 *GT |
|
16380 */ |
|
16381 case function_gt : |
|
16382 { |
|
16383 symbol_c *last_type_symbol = NULL; |
|
16384 |
|
16385 { |
|
16386 identifier_c param_name("IN1"); |
|
16387 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16388 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16389 |
|
16390 /* Get the value from a foo(<param_value>) style call */ |
|
16391 if (IN1_param_value == NULL) |
|
16392 IN1_param_value = function_call_param_iterator.next(); |
|
16393 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16394 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16395 |
|
16396 |
|
16397 { |
|
16398 |
|
16399 { |
|
16400 identifier_c param_name("IN2"); |
|
16401 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16402 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16403 |
|
16404 /* Get the value from a foo(<param_value>) style call */ |
|
16405 if (IN2_param_value == NULL) |
|
16406 IN2_param_value = function_call_param_iterator.next(); |
|
16407 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16408 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16409 |
|
16410 |
|
16411 { |
|
16412 |
|
16413 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16414 return return_type_symbol; |
|
16415 |
|
16416 } |
|
16417 |
|
16418 ERROR; |
|
16419 } |
|
16420 |
|
16421 } |
|
16422 |
|
16423 ERROR; |
|
16424 } |
|
16425 |
|
16426 }/*function_gt*/ |
|
16427 break; |
|
16428 |
|
16429 /**** |
|
16430 *GE |
|
16431 */ |
|
16432 case function_ge : |
|
16433 { |
|
16434 symbol_c *last_type_symbol = NULL; |
|
16435 |
|
16436 { |
|
16437 identifier_c param_name("IN1"); |
|
16438 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16439 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16440 |
|
16441 /* Get the value from a foo(<param_value>) style call */ |
|
16442 if (IN1_param_value == NULL) |
|
16443 IN1_param_value = function_call_param_iterator.next(); |
|
16444 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16445 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16446 |
|
16447 |
|
16448 { |
|
16449 |
|
16450 { |
|
16451 identifier_c param_name("IN2"); |
|
16452 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16453 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16454 |
|
16455 /* Get the value from a foo(<param_value>) style call */ |
|
16456 if (IN2_param_value == NULL) |
|
16457 IN2_param_value = function_call_param_iterator.next(); |
|
16458 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16459 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16460 |
|
16461 |
|
16462 { |
|
16463 |
|
16464 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16465 return return_type_symbol; |
|
16466 |
|
16467 } |
|
16468 |
|
16469 ERROR; |
|
16470 } |
|
16471 |
|
16472 } |
|
16473 |
|
16474 ERROR; |
|
16475 } |
|
16476 |
|
16477 }/*function_ge*/ |
|
16478 break; |
|
16479 |
|
16480 /**** |
|
16481 *EQ |
|
16482 */ |
|
16483 case function_eq : |
|
16484 { |
|
16485 symbol_c *last_type_symbol = NULL; |
|
16486 |
|
16487 { |
|
16488 identifier_c param_name("IN1"); |
|
16489 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16490 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16491 |
|
16492 /* Get the value from a foo(<param_value>) style call */ |
|
16493 if (IN1_param_value == NULL) |
|
16494 IN1_param_value = function_call_param_iterator.next(); |
|
16495 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16496 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16497 |
|
16498 |
|
16499 { |
|
16500 |
|
16501 { |
|
16502 identifier_c param_name("IN2"); |
|
16503 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16504 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16505 |
|
16506 /* Get the value from a foo(<param_value>) style call */ |
|
16507 if (IN2_param_value == NULL) |
|
16508 IN2_param_value = function_call_param_iterator.next(); |
|
16509 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16510 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16511 |
|
16512 |
|
16513 { |
|
16514 |
|
16515 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16516 return return_type_symbol; |
|
16517 |
|
16518 } |
|
16519 |
|
16520 ERROR; |
|
16521 } |
|
16522 |
|
16523 } |
|
16524 |
|
16525 ERROR; |
|
16526 } |
|
16527 |
|
16528 }/*function_eq*/ |
|
16529 break; |
|
16530 |
|
16531 /**** |
|
16532 *LT |
|
16533 */ |
|
16534 case function_lt : |
|
16535 { |
|
16536 symbol_c *last_type_symbol = NULL; |
|
16537 |
|
16538 { |
|
16539 identifier_c param_name("IN1"); |
|
16540 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16541 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16542 |
|
16543 /* Get the value from a foo(<param_value>) style call */ |
|
16544 if (IN1_param_value == NULL) |
|
16545 IN1_param_value = function_call_param_iterator.next(); |
|
16546 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16547 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16548 |
|
16549 |
|
16550 { |
|
16551 |
|
16552 { |
|
16553 identifier_c param_name("IN2"); |
|
16554 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16555 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16556 |
|
16557 /* Get the value from a foo(<param_value>) style call */ |
|
16558 if (IN2_param_value == NULL) |
|
16559 IN2_param_value = function_call_param_iterator.next(); |
|
16560 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16561 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16562 |
|
16563 |
|
16564 { |
|
16565 |
|
16566 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16567 return return_type_symbol; |
|
16568 |
|
16569 } |
|
16570 |
|
16571 ERROR; |
|
16572 } |
|
16573 |
|
16574 } |
|
16575 |
|
16576 ERROR; |
|
16577 } |
|
16578 |
|
16579 }/*function_lt*/ |
|
16580 break; |
|
16581 |
|
16582 /**** |
|
16583 *LE |
|
16584 */ |
|
16585 case function_le : |
|
16586 { |
|
16587 symbol_c *last_type_symbol = NULL; |
|
16588 |
|
16589 { |
|
16590 identifier_c param_name("IN1"); |
|
16591 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16592 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16593 |
|
16594 /* Get the value from a foo(<param_value>) style call */ |
|
16595 if (IN1_param_value == NULL) |
|
16596 IN1_param_value = function_call_param_iterator.next(); |
|
16597 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16598 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16599 |
|
16600 |
|
16601 { |
|
16602 |
|
16603 { |
|
16604 identifier_c param_name("IN2"); |
|
16605 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16606 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16607 |
|
16608 /* Get the value from a foo(<param_value>) style call */ |
|
16609 if (IN2_param_value == NULL) |
|
16610 IN2_param_value = function_call_param_iterator.next(); |
|
16611 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16612 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16613 |
|
16614 |
|
16615 { |
|
16616 |
|
16617 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16618 return return_type_symbol; |
|
16619 |
|
16620 } |
|
16621 |
|
16622 ERROR; |
|
16623 } |
|
16624 |
|
16625 } |
|
16626 |
|
16627 ERROR; |
|
16628 } |
|
16629 |
|
16630 }/*function_le*/ |
|
16631 break; |
|
16632 |
|
16633 /**** |
|
16634 *NE |
|
16635 */ |
|
16636 case function_ne : |
|
16637 { |
|
16638 symbol_c *last_type_symbol = NULL; |
|
16639 |
|
16640 { |
|
16641 identifier_c param_name("IN1"); |
|
16642 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16643 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16644 |
|
16645 /* Get the value from a foo(<param_value>) style call */ |
|
16646 if (IN1_param_value == NULL) |
|
16647 IN1_param_value = function_call_param_iterator.next(); |
|
16648 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16649 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16650 |
|
16651 |
|
16652 { |
|
16653 |
|
16654 { |
|
16655 identifier_c param_name("IN2"); |
|
16656 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16657 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16658 |
|
16659 /* Get the value from a foo(<param_value>) style call */ |
|
16660 if (IN2_param_value == NULL) |
|
16661 IN2_param_value = function_call_param_iterator.next(); |
|
16662 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16663 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16664 |
|
16665 |
|
16666 { |
|
16667 |
|
16668 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
16669 return return_type_symbol; |
|
16670 |
|
16671 } |
|
16672 |
|
16673 ERROR; |
|
16674 } |
|
16675 |
|
16676 } |
|
16677 |
|
16678 ERROR; |
|
16679 } |
|
16680 |
|
16681 }/*function_ne*/ |
|
16682 break; |
|
16683 |
|
16684 /**** |
|
16685 *LEN |
|
16686 */ |
|
16687 case function_len : |
|
16688 { |
|
16689 symbol_c *last_type_symbol = NULL; |
|
16690 |
|
16691 { |
|
16692 identifier_c param_name("IN"); |
|
16693 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16694 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16695 |
|
16696 /* Get the value from a foo(<param_value>) style call */ |
|
16697 if (IN_param_value == NULL) |
|
16698 IN_param_value = function_call_param_iterator.next(); |
|
16699 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16700 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16701 |
|
16702 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16703 { |
|
16704 |
|
16705 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
16706 return return_type_symbol; |
|
16707 |
|
16708 } |
|
16709 |
|
16710 ERROR; |
|
16711 } |
|
16712 |
|
16713 }/*function_len*/ |
|
16714 break; |
|
16715 |
|
16716 /**** |
|
16717 *LEFT |
|
16718 */ |
|
16719 case function_left : |
|
16720 { |
|
16721 symbol_c *last_type_symbol = NULL; |
|
16722 |
|
16723 { |
|
16724 identifier_c param_name("IN"); |
|
16725 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16726 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16727 |
|
16728 /* Get the value from a foo(<param_value>) style call */ |
|
16729 if (IN_param_value == NULL) |
|
16730 IN_param_value = function_call_param_iterator.next(); |
|
16731 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16732 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16733 |
|
16734 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16735 { |
|
16736 |
|
16737 { |
|
16738 identifier_c param_name("L"); |
|
16739 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16740 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
16741 |
|
16742 /* Get the value from a foo(<param_value>) style call */ |
|
16743 if (L_param_value == NULL) |
|
16744 L_param_value = function_call_param_iterator.next(); |
|
16745 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
16746 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; |
|
16747 |
|
16748 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
16749 { |
|
16750 |
|
16751 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
16752 return return_type_symbol; |
|
16753 |
|
16754 } |
|
16755 |
|
16756 ERROR; |
|
16757 } |
|
16758 |
|
16759 } |
|
16760 |
|
16761 ERROR; |
|
16762 } |
|
16763 |
|
16764 }/*function_left*/ |
|
16765 break; |
|
16766 |
|
16767 /**** |
|
16768 *RIGHT |
|
16769 */ |
|
16770 case function_right : |
|
16771 { |
|
16772 symbol_c *last_type_symbol = NULL; |
|
16773 |
|
16774 { |
|
16775 identifier_c param_name("IN"); |
|
16776 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16777 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16778 |
|
16779 /* Get the value from a foo(<param_value>) style call */ |
|
16780 if (IN_param_value == NULL) |
|
16781 IN_param_value = function_call_param_iterator.next(); |
|
16782 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16783 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16784 |
|
16785 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16786 { |
|
16787 |
|
16788 { |
|
16789 identifier_c param_name("L"); |
|
16790 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16791 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
16792 |
|
16793 /* Get the value from a foo(<param_value>) style call */ |
|
16794 if (L_param_value == NULL) |
|
16795 L_param_value = function_call_param_iterator.next(); |
|
16796 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
16797 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; |
|
16798 |
|
16799 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
16800 { |
|
16801 |
|
16802 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
16803 return return_type_symbol; |
|
16804 |
|
16805 } |
|
16806 |
|
16807 ERROR; |
|
16808 } |
|
16809 |
|
16810 } |
|
16811 |
|
16812 ERROR; |
|
16813 } |
|
16814 |
|
16815 }/*function_right*/ |
|
16816 break; |
|
16817 |
|
16818 /**** |
|
16819 *MID |
|
16820 */ |
|
16821 case function_mid : |
|
16822 { |
|
16823 symbol_c *last_type_symbol = NULL; |
|
16824 |
|
16825 { |
|
16826 identifier_c param_name("IN"); |
|
16827 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16828 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
16829 |
|
16830 /* Get the value from a foo(<param_value>) style call */ |
|
16831 if (IN_param_value == NULL) |
|
16832 IN_param_value = function_call_param_iterator.next(); |
|
16833 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
16834 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
16835 |
|
16836 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16837 { |
|
16838 |
|
16839 { |
|
16840 identifier_c param_name("L"); |
|
16841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16842 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
16843 |
|
16844 /* Get the value from a foo(<param_value>) style call */ |
|
16845 if (L_param_value == NULL) |
|
16846 L_param_value = function_call_param_iterator.next(); |
|
16847 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
16848 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; |
|
16849 |
|
16850 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
16851 { |
|
16852 |
|
16853 { |
|
16854 identifier_c param_name("P"); |
|
16855 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16856 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
16857 |
|
16858 /* Get the value from a foo(<param_value>) style call */ |
|
16859 if (P_param_value == NULL) |
|
16860 P_param_value = function_call_param_iterator.next(); |
|
16861 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
16862 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; |
|
16863 |
|
16864 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
16865 { |
|
16866 |
|
16867 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
16868 return return_type_symbol; |
|
16869 |
|
16870 } |
|
16871 |
|
16872 ERROR; |
|
16873 } |
|
16874 |
|
16875 } |
|
16876 |
|
16877 ERROR; |
|
16878 } |
|
16879 |
|
16880 } |
|
16881 |
|
16882 ERROR; |
|
16883 } |
|
16884 |
|
16885 }/*function_mid*/ |
|
16886 break; |
|
16887 |
|
16888 /**** |
|
16889 *CONCAT |
|
16890 */ |
|
16891 case function_concat : |
|
16892 { |
|
16893 symbol_c *last_type_symbol = NULL; |
|
16894 |
|
16895 { |
|
16896 identifier_c param_name("IN1"); |
|
16897 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16898 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16899 |
|
16900 /* Get the value from a foo(<param_value>) style call */ |
|
16901 if (IN1_param_value == NULL) |
|
16902 IN1_param_value = function_call_param_iterator.next(); |
|
16903 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16904 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16905 |
|
16906 if (typeid(*last_type_symbol) == typeid(date_type_name_c)) |
|
16907 { |
|
16908 |
|
16909 { |
|
16910 identifier_c param_name("IN2"); |
|
16911 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16912 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16913 |
|
16914 /* Get the value from a foo(<param_value>) style call */ |
|
16915 if (IN2_param_value == NULL) |
|
16916 IN2_param_value = function_call_param_iterator.next(); |
|
16917 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16918 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16919 |
|
16920 if (typeid(*last_type_symbol) == typeid(tod_type_name_c)) |
|
16921 { |
|
16922 |
|
16923 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
16924 return return_type_symbol; |
|
16925 |
|
16926 } |
|
16927 |
|
16928 ERROR; |
|
16929 } |
|
16930 |
|
16931 } |
|
16932 |
|
16933 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16934 { |
|
16935 |
|
16936 { |
|
16937 identifier_c param_name("IN2"); |
|
16938 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16939 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16940 |
|
16941 /* Get the value from a foo(<param_value>) style call */ |
|
16942 if (IN2_param_value == NULL) |
|
16943 IN2_param_value = function_call_param_iterator.next(); |
|
16944 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16945 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16946 |
|
16947 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16948 { |
|
16949 |
|
16950 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
16951 return return_type_symbol; |
|
16952 |
|
16953 } |
|
16954 |
|
16955 ERROR; |
|
16956 } |
|
16957 |
|
16958 } |
|
16959 |
|
16960 ERROR; |
|
16961 } |
|
16962 |
|
16963 }/*function_concat*/ |
|
16964 break; |
|
16965 |
|
16966 /**** |
|
16967 *INSERT |
|
16968 */ |
|
16969 case function_insert : |
|
16970 { |
|
16971 symbol_c *last_type_symbol = NULL; |
|
16972 |
|
16973 { |
|
16974 identifier_c param_name("IN1"); |
|
16975 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16976 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
16977 |
|
16978 /* Get the value from a foo(<param_value>) style call */ |
|
16979 if (IN1_param_value == NULL) |
|
16980 IN1_param_value = function_call_param_iterator.next(); |
|
16981 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
16982 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
16983 |
|
16984 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16985 { |
|
16986 |
|
16987 { |
|
16988 identifier_c param_name("IN2"); |
|
16989 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
16990 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
16991 |
|
16992 /* Get the value from a foo(<param_value>) style call */ |
|
16993 if (IN2_param_value == NULL) |
|
16994 IN2_param_value = function_call_param_iterator.next(); |
|
16995 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
16996 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
16997 |
|
16998 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
16999 { |
|
17000 |
|
17001 { |
|
17002 identifier_c param_name("P"); |
|
17003 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17004 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
17005 |
|
17006 /* Get the value from a foo(<param_value>) style call */ |
|
17007 if (P_param_value == NULL) |
|
17008 P_param_value = function_call_param_iterator.next(); |
|
17009 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
17010 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; |
|
17011 |
|
17012 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
17013 { |
|
17014 |
|
17015 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
17016 return return_type_symbol; |
|
17017 |
|
17018 } |
|
17019 |
|
17020 ERROR; |
|
17021 } |
|
17022 |
|
17023 } |
|
17024 |
|
17025 ERROR; |
|
17026 } |
|
17027 |
|
17028 } |
|
17029 |
|
17030 ERROR; |
|
17031 } |
|
17032 |
|
17033 }/*function_insert*/ |
|
17034 break; |
|
17035 |
|
17036 /**** |
|
17037 *DELETE |
|
17038 */ |
|
17039 case function_delete : |
|
17040 { |
|
17041 symbol_c *last_type_symbol = NULL; |
|
17042 |
|
17043 { |
|
17044 identifier_c param_name("IN"); |
|
17045 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17046 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
17047 |
|
17048 /* Get the value from a foo(<param_value>) style call */ |
|
17049 if (IN_param_value == NULL) |
|
17050 IN_param_value = function_call_param_iterator.next(); |
|
17051 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
17052 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
17053 |
|
17054 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
17055 { |
|
17056 |
|
17057 { |
|
17058 identifier_c param_name("L"); |
|
17059 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17060 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
17061 |
|
17062 /* Get the value from a foo(<param_value>) style call */ |
|
17063 if (L_param_value == NULL) |
|
17064 L_param_value = function_call_param_iterator.next(); |
|
17065 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
17066 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; |
|
17067 |
|
17068 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
17069 { |
|
17070 |
|
17071 { |
|
17072 identifier_c param_name("P"); |
|
17073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17074 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
17075 |
|
17076 /* Get the value from a foo(<param_value>) style call */ |
|
17077 if (P_param_value == NULL) |
|
17078 P_param_value = function_call_param_iterator.next(); |
|
17079 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
17080 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; |
|
17081 |
|
17082 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
17083 { |
|
17084 |
|
17085 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
17086 return return_type_symbol; |
|
17087 |
|
17088 } |
|
17089 |
|
17090 ERROR; |
|
17091 } |
|
17092 |
|
17093 } |
|
17094 |
|
17095 ERROR; |
|
17096 } |
|
17097 |
|
17098 } |
|
17099 |
|
17100 ERROR; |
|
17101 } |
|
17102 |
|
17103 }/*function_delete*/ |
|
17104 break; |
|
17105 |
|
17106 /**** |
|
17107 *REPLACE |
|
17108 */ |
|
17109 case function_replace : |
|
17110 { |
|
17111 symbol_c *last_type_symbol = NULL; |
|
17112 |
|
17113 { |
|
17114 identifier_c param_name("IN1"); |
|
17115 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17116 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
17117 |
|
17118 /* Get the value from a foo(<param_value>) style call */ |
|
17119 if (IN1_param_value == NULL) |
|
17120 IN1_param_value = function_call_param_iterator.next(); |
|
17121 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
17122 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
17123 |
|
17124 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
17125 { |
|
17126 |
|
17127 { |
|
17128 identifier_c param_name("IN2"); |
|
17129 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17130 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
17131 |
|
17132 /* Get the value from a foo(<param_value>) style call */ |
|
17133 if (IN2_param_value == NULL) |
|
17134 IN2_param_value = function_call_param_iterator.next(); |
|
17135 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
17136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
17137 |
|
17138 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
17139 { |
|
17140 |
|
17141 { |
|
17142 identifier_c param_name("L"); |
|
17143 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17144 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
17145 |
|
17146 /* Get the value from a foo(<param_value>) style call */ |
|
17147 if (L_param_value == NULL) |
|
17148 L_param_value = function_call_param_iterator.next(); |
|
17149 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
17150 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; |
|
17151 |
|
17152 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
17153 { |
|
17154 |
|
17155 { |
|
17156 identifier_c param_name("P"); |
|
17157 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17158 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
17159 |
|
17160 /* Get the value from a foo(<param_value>) style call */ |
|
17161 if (P_param_value == NULL) |
|
17162 P_param_value = function_call_param_iterator.next(); |
|
17163 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
17164 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; |
|
17165 |
|
17166 if (typeid(*last_type_symbol) == typeid(uint_type_name_c)) |
|
17167 { |
|
17168 |
|
17169 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
17170 return return_type_symbol; |
|
17171 |
|
17172 } |
|
17173 |
|
17174 ERROR; |
|
17175 } |
|
17176 |
|
17177 } |
|
17178 |
|
17179 ERROR; |
|
17180 } |
|
17181 |
|
17182 } |
|
17183 |
|
17184 ERROR; |
|
17185 } |
|
17186 |
|
17187 } |
|
17188 |
|
17189 ERROR; |
|
17190 } |
|
17191 |
|
17192 }/*function_replace*/ |
|
17193 break; |
|
17194 |
|
17195 /**** |
|
17196 *FIND |
|
17197 */ |
|
17198 case function_find : |
|
17199 { |
|
17200 symbol_c *last_type_symbol = NULL; |
|
17201 |
|
17202 { |
|
17203 identifier_c param_name("IN1"); |
|
17204 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17205 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
17206 |
|
17207 /* Get the value from a foo(<param_value>) style call */ |
|
17208 if (IN1_param_value == NULL) |
|
17209 IN1_param_value = function_call_param_iterator.next(); |
|
17210 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
17211 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; |
|
17212 |
|
17213 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
17214 { |
|
17215 |
|
17216 { |
|
17217 identifier_c param_name("IN2"); |
|
17218 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
17219 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
17220 |
|
17221 /* Get the value from a foo(<param_value>) style call */ |
|
17222 if (IN2_param_value == NULL) |
|
17223 IN2_param_value = function_call_param_iterator.next(); |
|
17224 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
17225 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; |
|
17226 |
|
17227 if (typeid(*last_type_symbol) == typeid(string_type_name_c)) |
|
17228 { |
|
17229 |
|
17230 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
17231 return return_type_symbol; |
|
17232 |
|
17233 } |
|
17234 |
|
17235 ERROR; |
|
17236 } |
|
17237 |
|
17238 } |
|
17239 |
|
17240 ERROR; |
|
17241 } |
|
17242 |
|
17243 }/*function_find*/ |
|
17244 break; |
|
17245 |
|
17246 case function_none : |
|
17247 ERROR; |
|
17248 } |
|
17249 return NULL; |