|
1 /* |
|
2 * (c) 2003 Mario de Sousa |
|
3 * |
|
4 * Offered to the public under the terms of the GNU General Public License |
|
5 * as published by the Free Software Foundation; either version 2 of the |
|
6 * License, or (at your option) any later version. |
|
7 * |
|
8 * This program is distributed in the hope that it will be useful, but |
|
9 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
11 * Public License for more details. |
|
12 * |
|
13 * This code is made available on the understanding that it will not be |
|
14 * used in safety-critical situations without a full and competent review. |
|
15 */ |
|
16 |
|
17 /* |
|
18 * An IEC 61131-3 IL and ST compiler. |
|
19 * |
|
20 * Based on the |
|
21 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
22 * |
|
23 */ |
|
24 |
|
25 |
|
26 /**** |
|
27 * IEC 61131-3 standard function lib |
|
28 * generated code, do not edit by hand |
|
29 */ |
|
30 switch(current_function_type){ |
|
31 |
|
32 /**** |
|
33 *BOOL_TO_SINT |
|
34 */ |
|
35 case function_bool_to_sint : |
|
36 { |
|
37 symbol_c *last_type_symbol = NULL; |
|
38 |
|
39 { |
|
40 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
41 symbol_c *IN_param_value = &this->default_variable_name; |
|
42 |
|
43 symbol_c *IN_type_symbol = param_data_type; |
|
44 last_type_symbol = param_data_type; |
|
45 |
|
46 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
47 { |
|
48 |
|
49 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
50 s4o.print("("); |
|
51 return_type_symbol->accept(*this); |
|
52 s4o.print(")"); |
|
53 IN_param_value->accept(*this); |
|
54 return NULL; |
|
55 |
|
56 } |
|
57 |
|
58 ERROR; |
|
59 } |
|
60 |
|
61 }/*function_bool_to_sint*/ |
|
62 break; |
|
63 |
|
64 /**** |
|
65 *BOOL_TO_INT |
|
66 */ |
|
67 case function_bool_to_int : |
|
68 { |
|
69 symbol_c *last_type_symbol = NULL; |
|
70 |
|
71 { |
|
72 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
73 symbol_c *IN_param_value = &this->default_variable_name; |
|
74 |
|
75 symbol_c *IN_type_symbol = param_data_type; |
|
76 last_type_symbol = param_data_type; |
|
77 |
|
78 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
79 { |
|
80 |
|
81 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
82 s4o.print("("); |
|
83 return_type_symbol->accept(*this); |
|
84 s4o.print(")"); |
|
85 IN_param_value->accept(*this); |
|
86 return NULL; |
|
87 |
|
88 } |
|
89 |
|
90 ERROR; |
|
91 } |
|
92 |
|
93 }/*function_bool_to_int*/ |
|
94 break; |
|
95 |
|
96 /**** |
|
97 *BOOL_TO_DINT |
|
98 */ |
|
99 case function_bool_to_dint : |
|
100 { |
|
101 symbol_c *last_type_symbol = NULL; |
|
102 |
|
103 { |
|
104 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
105 symbol_c *IN_param_value = &this->default_variable_name; |
|
106 |
|
107 symbol_c *IN_type_symbol = param_data_type; |
|
108 last_type_symbol = param_data_type; |
|
109 |
|
110 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
111 { |
|
112 |
|
113 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
114 s4o.print("("); |
|
115 return_type_symbol->accept(*this); |
|
116 s4o.print(")"); |
|
117 IN_param_value->accept(*this); |
|
118 return NULL; |
|
119 |
|
120 } |
|
121 |
|
122 ERROR; |
|
123 } |
|
124 |
|
125 }/*function_bool_to_dint*/ |
|
126 break; |
|
127 |
|
128 /**** |
|
129 *BOOL_TO_LINT |
|
130 */ |
|
131 case function_bool_to_lint : |
|
132 { |
|
133 symbol_c *last_type_symbol = NULL; |
|
134 |
|
135 { |
|
136 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
137 symbol_c *IN_param_value = &this->default_variable_name; |
|
138 |
|
139 symbol_c *IN_type_symbol = param_data_type; |
|
140 last_type_symbol = param_data_type; |
|
141 |
|
142 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
143 { |
|
144 |
|
145 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
146 s4o.print("("); |
|
147 return_type_symbol->accept(*this); |
|
148 s4o.print(")"); |
|
149 IN_param_value->accept(*this); |
|
150 return NULL; |
|
151 |
|
152 } |
|
153 |
|
154 ERROR; |
|
155 } |
|
156 |
|
157 }/*function_bool_to_lint*/ |
|
158 break; |
|
159 |
|
160 /**** |
|
161 *BOOL_TO_USINT |
|
162 */ |
|
163 case function_bool_to_usint : |
|
164 { |
|
165 symbol_c *last_type_symbol = NULL; |
|
166 |
|
167 { |
|
168 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
169 symbol_c *IN_param_value = &this->default_variable_name; |
|
170 |
|
171 symbol_c *IN_type_symbol = param_data_type; |
|
172 last_type_symbol = param_data_type; |
|
173 |
|
174 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
175 { |
|
176 |
|
177 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
178 s4o.print("("); |
|
179 return_type_symbol->accept(*this); |
|
180 s4o.print(")"); |
|
181 IN_param_value->accept(*this); |
|
182 return NULL; |
|
183 |
|
184 } |
|
185 |
|
186 ERROR; |
|
187 } |
|
188 |
|
189 }/*function_bool_to_usint*/ |
|
190 break; |
|
191 |
|
192 /**** |
|
193 *BOOL_TO_UINT |
|
194 */ |
|
195 case function_bool_to_uint : |
|
196 { |
|
197 symbol_c *last_type_symbol = NULL; |
|
198 |
|
199 { |
|
200 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
201 symbol_c *IN_param_value = &this->default_variable_name; |
|
202 |
|
203 symbol_c *IN_type_symbol = param_data_type; |
|
204 last_type_symbol = param_data_type; |
|
205 |
|
206 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
207 { |
|
208 |
|
209 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
210 s4o.print("("); |
|
211 return_type_symbol->accept(*this); |
|
212 s4o.print(")"); |
|
213 IN_param_value->accept(*this); |
|
214 return NULL; |
|
215 |
|
216 } |
|
217 |
|
218 ERROR; |
|
219 } |
|
220 |
|
221 }/*function_bool_to_uint*/ |
|
222 break; |
|
223 |
|
224 /**** |
|
225 *BOOL_TO_UDINT |
|
226 */ |
|
227 case function_bool_to_udint : |
|
228 { |
|
229 symbol_c *last_type_symbol = NULL; |
|
230 |
|
231 { |
|
232 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
233 symbol_c *IN_param_value = &this->default_variable_name; |
|
234 |
|
235 symbol_c *IN_type_symbol = param_data_type; |
|
236 last_type_symbol = param_data_type; |
|
237 |
|
238 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
239 { |
|
240 |
|
241 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
242 s4o.print("("); |
|
243 return_type_symbol->accept(*this); |
|
244 s4o.print(")"); |
|
245 IN_param_value->accept(*this); |
|
246 return NULL; |
|
247 |
|
248 } |
|
249 |
|
250 ERROR; |
|
251 } |
|
252 |
|
253 }/*function_bool_to_udint*/ |
|
254 break; |
|
255 |
|
256 /**** |
|
257 *BOOL_TO_ULINT |
|
258 */ |
|
259 case function_bool_to_ulint : |
|
260 { |
|
261 symbol_c *last_type_symbol = NULL; |
|
262 |
|
263 { |
|
264 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
265 symbol_c *IN_param_value = &this->default_variable_name; |
|
266 |
|
267 symbol_c *IN_type_symbol = param_data_type; |
|
268 last_type_symbol = param_data_type; |
|
269 |
|
270 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
271 { |
|
272 |
|
273 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
274 s4o.print("("); |
|
275 return_type_symbol->accept(*this); |
|
276 s4o.print(")"); |
|
277 IN_param_value->accept(*this); |
|
278 return NULL; |
|
279 |
|
280 } |
|
281 |
|
282 ERROR; |
|
283 } |
|
284 |
|
285 }/*function_bool_to_ulint*/ |
|
286 break; |
|
287 |
|
288 /**** |
|
289 *BOOL_TO_REAL |
|
290 */ |
|
291 case function_bool_to_real : |
|
292 { |
|
293 symbol_c *last_type_symbol = NULL; |
|
294 |
|
295 { |
|
296 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
297 symbol_c *IN_param_value = &this->default_variable_name; |
|
298 |
|
299 symbol_c *IN_type_symbol = param_data_type; |
|
300 last_type_symbol = param_data_type; |
|
301 |
|
302 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
303 { |
|
304 |
|
305 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
306 s4o.print("("); |
|
307 return_type_symbol->accept(*this); |
|
308 s4o.print(")"); |
|
309 IN_param_value->accept(*this); |
|
310 return NULL; |
|
311 |
|
312 } |
|
313 |
|
314 ERROR; |
|
315 } |
|
316 |
|
317 }/*function_bool_to_real*/ |
|
318 break; |
|
319 |
|
320 /**** |
|
321 *BOOL_TO_LREAL |
|
322 */ |
|
323 case function_bool_to_lreal : |
|
324 { |
|
325 symbol_c *last_type_symbol = NULL; |
|
326 |
|
327 { |
|
328 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
329 symbol_c *IN_param_value = &this->default_variable_name; |
|
330 |
|
331 symbol_c *IN_type_symbol = param_data_type; |
|
332 last_type_symbol = param_data_type; |
|
333 |
|
334 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
335 { |
|
336 |
|
337 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
338 s4o.print("("); |
|
339 return_type_symbol->accept(*this); |
|
340 s4o.print(")"); |
|
341 IN_param_value->accept(*this); |
|
342 return NULL; |
|
343 |
|
344 } |
|
345 |
|
346 ERROR; |
|
347 } |
|
348 |
|
349 }/*function_bool_to_lreal*/ |
|
350 break; |
|
351 |
|
352 /**** |
|
353 *BOOL_TO_TIME |
|
354 */ |
|
355 case function_bool_to_time : |
|
356 { |
|
357 symbol_c *last_type_symbol = NULL; |
|
358 |
|
359 { |
|
360 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
361 symbol_c *IN_param_value = &this->default_variable_name; |
|
362 |
|
363 symbol_c *IN_type_symbol = param_data_type; |
|
364 last_type_symbol = param_data_type; |
|
365 |
|
366 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
367 { |
|
368 |
|
369 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
370 s4o.print("("); |
|
371 return_type_symbol->accept(*this); |
|
372 s4o.print(")__int_to_time("); |
|
373 IN_param_value->accept(*this); |
|
374 s4o.print(")"); |
|
375 return NULL; |
|
376 |
|
377 } |
|
378 |
|
379 ERROR; |
|
380 } |
|
381 |
|
382 }/*function_bool_to_time*/ |
|
383 break; |
|
384 |
|
385 /**** |
|
386 *BOOL_TO_DATE |
|
387 */ |
|
388 case function_bool_to_date : |
|
389 { |
|
390 symbol_c *last_type_symbol = NULL; |
|
391 |
|
392 { |
|
393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
394 symbol_c *IN_param_value = &this->default_variable_name; |
|
395 |
|
396 symbol_c *IN_type_symbol = param_data_type; |
|
397 last_type_symbol = param_data_type; |
|
398 |
|
399 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
400 { |
|
401 |
|
402 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
403 s4o.print("("); |
|
404 return_type_symbol->accept(*this); |
|
405 s4o.print(")__int_to_time("); |
|
406 IN_param_value->accept(*this); |
|
407 s4o.print(")"); |
|
408 return NULL; |
|
409 |
|
410 } |
|
411 |
|
412 ERROR; |
|
413 } |
|
414 |
|
415 }/*function_bool_to_date*/ |
|
416 break; |
|
417 |
|
418 /**** |
|
419 *BOOL_TO_TOD |
|
420 */ |
|
421 case function_bool_to_tod : |
|
422 { |
|
423 symbol_c *last_type_symbol = NULL; |
|
424 |
|
425 { |
|
426 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
427 symbol_c *IN_param_value = &this->default_variable_name; |
|
428 |
|
429 symbol_c *IN_type_symbol = param_data_type; |
|
430 last_type_symbol = param_data_type; |
|
431 |
|
432 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
433 { |
|
434 |
|
435 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
436 s4o.print("("); |
|
437 return_type_symbol->accept(*this); |
|
438 s4o.print(")__int_to_time("); |
|
439 IN_param_value->accept(*this); |
|
440 s4o.print(")"); |
|
441 return NULL; |
|
442 |
|
443 } |
|
444 |
|
445 ERROR; |
|
446 } |
|
447 |
|
448 }/*function_bool_to_tod*/ |
|
449 break; |
|
450 |
|
451 /**** |
|
452 *BOOL_TO_DT |
|
453 */ |
|
454 case function_bool_to_dt : |
|
455 { |
|
456 symbol_c *last_type_symbol = NULL; |
|
457 |
|
458 { |
|
459 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
460 symbol_c *IN_param_value = &this->default_variable_name; |
|
461 |
|
462 symbol_c *IN_type_symbol = param_data_type; |
|
463 last_type_symbol = param_data_type; |
|
464 |
|
465 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
466 { |
|
467 |
|
468 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
469 s4o.print("("); |
|
470 return_type_symbol->accept(*this); |
|
471 s4o.print(")__int_to_time("); |
|
472 IN_param_value->accept(*this); |
|
473 s4o.print(")"); |
|
474 return NULL; |
|
475 |
|
476 } |
|
477 |
|
478 ERROR; |
|
479 } |
|
480 |
|
481 }/*function_bool_to_dt*/ |
|
482 break; |
|
483 |
|
484 /**** |
|
485 *BOOL_TO_STRING |
|
486 */ |
|
487 case function_bool_to_string : |
|
488 { |
|
489 symbol_c *last_type_symbol = NULL; |
|
490 |
|
491 { |
|
492 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
493 symbol_c *IN_param_value = &this->default_variable_name; |
|
494 |
|
495 symbol_c *IN_type_symbol = param_data_type; |
|
496 last_type_symbol = param_data_type; |
|
497 |
|
498 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
499 { |
|
500 |
|
501 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
502 s4o.print("("); |
|
503 return_type_symbol->accept(*this); |
|
504 s4o.print(")__bool_to_string("); |
|
505 IN_param_value->accept(*this); |
|
506 s4o.print(")"); |
|
507 return NULL; |
|
508 |
|
509 } |
|
510 |
|
511 ERROR; |
|
512 } |
|
513 |
|
514 }/*function_bool_to_string*/ |
|
515 break; |
|
516 |
|
517 /**** |
|
518 *BOOL_TO_BYTE |
|
519 */ |
|
520 case function_bool_to_byte : |
|
521 { |
|
522 symbol_c *last_type_symbol = NULL; |
|
523 |
|
524 { |
|
525 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
526 symbol_c *IN_param_value = &this->default_variable_name; |
|
527 |
|
528 symbol_c *IN_type_symbol = param_data_type; |
|
529 last_type_symbol = param_data_type; |
|
530 |
|
531 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
532 { |
|
533 |
|
534 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
535 s4o.print("("); |
|
536 return_type_symbol->accept(*this); |
|
537 s4o.print(")"); |
|
538 IN_param_value->accept(*this); |
|
539 return NULL; |
|
540 |
|
541 } |
|
542 |
|
543 ERROR; |
|
544 } |
|
545 |
|
546 }/*function_bool_to_byte*/ |
|
547 break; |
|
548 |
|
549 /**** |
|
550 *BOOL_TO_WORD |
|
551 */ |
|
552 case function_bool_to_word : |
|
553 { |
|
554 symbol_c *last_type_symbol = NULL; |
|
555 |
|
556 { |
|
557 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
558 symbol_c *IN_param_value = &this->default_variable_name; |
|
559 |
|
560 symbol_c *IN_type_symbol = param_data_type; |
|
561 last_type_symbol = param_data_type; |
|
562 |
|
563 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
564 { |
|
565 |
|
566 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
567 s4o.print("("); |
|
568 return_type_symbol->accept(*this); |
|
569 s4o.print(")"); |
|
570 IN_param_value->accept(*this); |
|
571 return NULL; |
|
572 |
|
573 } |
|
574 |
|
575 ERROR; |
|
576 } |
|
577 |
|
578 }/*function_bool_to_word*/ |
|
579 break; |
|
580 |
|
581 /**** |
|
582 *BOOL_TO_DWORD |
|
583 */ |
|
584 case function_bool_to_dword : |
|
585 { |
|
586 symbol_c *last_type_symbol = NULL; |
|
587 |
|
588 { |
|
589 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
590 symbol_c *IN_param_value = &this->default_variable_name; |
|
591 |
|
592 symbol_c *IN_type_symbol = param_data_type; |
|
593 last_type_symbol = param_data_type; |
|
594 |
|
595 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
596 { |
|
597 |
|
598 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
599 s4o.print("("); |
|
600 return_type_symbol->accept(*this); |
|
601 s4o.print(")"); |
|
602 IN_param_value->accept(*this); |
|
603 return NULL; |
|
604 |
|
605 } |
|
606 |
|
607 ERROR; |
|
608 } |
|
609 |
|
610 }/*function_bool_to_dword*/ |
|
611 break; |
|
612 |
|
613 /**** |
|
614 *BOOL_TO_LWORD |
|
615 */ |
|
616 case function_bool_to_lword : |
|
617 { |
|
618 symbol_c *last_type_symbol = NULL; |
|
619 |
|
620 { |
|
621 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
622 symbol_c *IN_param_value = &this->default_variable_name; |
|
623 |
|
624 symbol_c *IN_type_symbol = param_data_type; |
|
625 last_type_symbol = param_data_type; |
|
626 |
|
627 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
628 { |
|
629 |
|
630 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
631 s4o.print("("); |
|
632 return_type_symbol->accept(*this); |
|
633 s4o.print(")"); |
|
634 IN_param_value->accept(*this); |
|
635 return NULL; |
|
636 |
|
637 } |
|
638 |
|
639 ERROR; |
|
640 } |
|
641 |
|
642 }/*function_bool_to_lword*/ |
|
643 break; |
|
644 |
|
645 /**** |
|
646 *SINT_TO_BOOL |
|
647 */ |
|
648 case function_sint_to_bool : |
|
649 { |
|
650 symbol_c *last_type_symbol = NULL; |
|
651 |
|
652 { |
|
653 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
654 symbol_c *IN_param_value = &this->default_variable_name; |
|
655 |
|
656 symbol_c *IN_type_symbol = param_data_type; |
|
657 last_type_symbol = param_data_type; |
|
658 |
|
659 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
660 { |
|
661 |
|
662 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
663 s4o.print("("); |
|
664 return_type_symbol->accept(*this); |
|
665 s4o.print(")"); |
|
666 IN_param_value->accept(*this); |
|
667 return NULL; |
|
668 |
|
669 } |
|
670 |
|
671 ERROR; |
|
672 } |
|
673 |
|
674 }/*function_sint_to_bool*/ |
|
675 break; |
|
676 |
|
677 /**** |
|
678 *SINT_TO_INT |
|
679 */ |
|
680 case function_sint_to_int : |
|
681 { |
|
682 symbol_c *last_type_symbol = NULL; |
|
683 |
|
684 { |
|
685 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
686 symbol_c *IN_param_value = &this->default_variable_name; |
|
687 |
|
688 symbol_c *IN_type_symbol = param_data_type; |
|
689 last_type_symbol = param_data_type; |
|
690 |
|
691 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
692 { |
|
693 |
|
694 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
695 s4o.print("("); |
|
696 return_type_symbol->accept(*this); |
|
697 s4o.print(")"); |
|
698 IN_param_value->accept(*this); |
|
699 return NULL; |
|
700 |
|
701 } |
|
702 |
|
703 ERROR; |
|
704 } |
|
705 |
|
706 }/*function_sint_to_int*/ |
|
707 break; |
|
708 |
|
709 /**** |
|
710 *SINT_TO_DINT |
|
711 */ |
|
712 case function_sint_to_dint : |
|
713 { |
|
714 symbol_c *last_type_symbol = NULL; |
|
715 |
|
716 { |
|
717 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
718 symbol_c *IN_param_value = &this->default_variable_name; |
|
719 |
|
720 symbol_c *IN_type_symbol = param_data_type; |
|
721 last_type_symbol = param_data_type; |
|
722 |
|
723 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
724 { |
|
725 |
|
726 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
727 s4o.print("("); |
|
728 return_type_symbol->accept(*this); |
|
729 s4o.print(")"); |
|
730 IN_param_value->accept(*this); |
|
731 return NULL; |
|
732 |
|
733 } |
|
734 |
|
735 ERROR; |
|
736 } |
|
737 |
|
738 }/*function_sint_to_dint*/ |
|
739 break; |
|
740 |
|
741 /**** |
|
742 *SINT_TO_LINT |
|
743 */ |
|
744 case function_sint_to_lint : |
|
745 { |
|
746 symbol_c *last_type_symbol = NULL; |
|
747 |
|
748 { |
|
749 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
750 symbol_c *IN_param_value = &this->default_variable_name; |
|
751 |
|
752 symbol_c *IN_type_symbol = param_data_type; |
|
753 last_type_symbol = param_data_type; |
|
754 |
|
755 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
756 { |
|
757 |
|
758 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
759 s4o.print("("); |
|
760 return_type_symbol->accept(*this); |
|
761 s4o.print(")"); |
|
762 IN_param_value->accept(*this); |
|
763 return NULL; |
|
764 |
|
765 } |
|
766 |
|
767 ERROR; |
|
768 } |
|
769 |
|
770 }/*function_sint_to_lint*/ |
|
771 break; |
|
772 |
|
773 /**** |
|
774 *SINT_TO_USINT |
|
775 */ |
|
776 case function_sint_to_usint : |
|
777 { |
|
778 symbol_c *last_type_symbol = NULL; |
|
779 |
|
780 { |
|
781 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
782 symbol_c *IN_param_value = &this->default_variable_name; |
|
783 |
|
784 symbol_c *IN_type_symbol = param_data_type; |
|
785 last_type_symbol = param_data_type; |
|
786 |
|
787 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
788 { |
|
789 |
|
790 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
791 s4o.print("("); |
|
792 return_type_symbol->accept(*this); |
|
793 s4o.print(")"); |
|
794 IN_param_value->accept(*this); |
|
795 return NULL; |
|
796 |
|
797 } |
|
798 |
|
799 ERROR; |
|
800 } |
|
801 |
|
802 }/*function_sint_to_usint*/ |
|
803 break; |
|
804 |
|
805 /**** |
|
806 *SINT_TO_UINT |
|
807 */ |
|
808 case function_sint_to_uint : |
|
809 { |
|
810 symbol_c *last_type_symbol = NULL; |
|
811 |
|
812 { |
|
813 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
814 symbol_c *IN_param_value = &this->default_variable_name; |
|
815 |
|
816 symbol_c *IN_type_symbol = param_data_type; |
|
817 last_type_symbol = param_data_type; |
|
818 |
|
819 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
820 { |
|
821 |
|
822 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
823 s4o.print("("); |
|
824 return_type_symbol->accept(*this); |
|
825 s4o.print(")"); |
|
826 IN_param_value->accept(*this); |
|
827 return NULL; |
|
828 |
|
829 } |
|
830 |
|
831 ERROR; |
|
832 } |
|
833 |
|
834 }/*function_sint_to_uint*/ |
|
835 break; |
|
836 |
|
837 /**** |
|
838 *SINT_TO_UDINT |
|
839 */ |
|
840 case function_sint_to_udint : |
|
841 { |
|
842 symbol_c *last_type_symbol = NULL; |
|
843 |
|
844 { |
|
845 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
846 symbol_c *IN_param_value = &this->default_variable_name; |
|
847 |
|
848 symbol_c *IN_type_symbol = param_data_type; |
|
849 last_type_symbol = param_data_type; |
|
850 |
|
851 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
852 { |
|
853 |
|
854 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
855 s4o.print("("); |
|
856 return_type_symbol->accept(*this); |
|
857 s4o.print(")"); |
|
858 IN_param_value->accept(*this); |
|
859 return NULL; |
|
860 |
|
861 } |
|
862 |
|
863 ERROR; |
|
864 } |
|
865 |
|
866 }/*function_sint_to_udint*/ |
|
867 break; |
|
868 |
|
869 /**** |
|
870 *SINT_TO_ULINT |
|
871 */ |
|
872 case function_sint_to_ulint : |
|
873 { |
|
874 symbol_c *last_type_symbol = NULL; |
|
875 |
|
876 { |
|
877 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
878 symbol_c *IN_param_value = &this->default_variable_name; |
|
879 |
|
880 symbol_c *IN_type_symbol = param_data_type; |
|
881 last_type_symbol = param_data_type; |
|
882 |
|
883 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
884 { |
|
885 |
|
886 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
887 s4o.print("("); |
|
888 return_type_symbol->accept(*this); |
|
889 s4o.print(")"); |
|
890 IN_param_value->accept(*this); |
|
891 return NULL; |
|
892 |
|
893 } |
|
894 |
|
895 ERROR; |
|
896 } |
|
897 |
|
898 }/*function_sint_to_ulint*/ |
|
899 break; |
|
900 |
|
901 /**** |
|
902 *SINT_TO_REAL |
|
903 */ |
|
904 case function_sint_to_real : |
|
905 { |
|
906 symbol_c *last_type_symbol = NULL; |
|
907 |
|
908 { |
|
909 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
910 symbol_c *IN_param_value = &this->default_variable_name; |
|
911 |
|
912 symbol_c *IN_type_symbol = param_data_type; |
|
913 last_type_symbol = param_data_type; |
|
914 |
|
915 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
916 { |
|
917 |
|
918 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
919 s4o.print("("); |
|
920 return_type_symbol->accept(*this); |
|
921 s4o.print(")"); |
|
922 IN_param_value->accept(*this); |
|
923 return NULL; |
|
924 |
|
925 } |
|
926 |
|
927 ERROR; |
|
928 } |
|
929 |
|
930 }/*function_sint_to_real*/ |
|
931 break; |
|
932 |
|
933 /**** |
|
934 *SINT_TO_LREAL |
|
935 */ |
|
936 case function_sint_to_lreal : |
|
937 { |
|
938 symbol_c *last_type_symbol = NULL; |
|
939 |
|
940 { |
|
941 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
942 symbol_c *IN_param_value = &this->default_variable_name; |
|
943 |
|
944 symbol_c *IN_type_symbol = param_data_type; |
|
945 last_type_symbol = param_data_type; |
|
946 |
|
947 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
948 { |
|
949 |
|
950 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
951 s4o.print("("); |
|
952 return_type_symbol->accept(*this); |
|
953 s4o.print(")"); |
|
954 IN_param_value->accept(*this); |
|
955 return NULL; |
|
956 |
|
957 } |
|
958 |
|
959 ERROR; |
|
960 } |
|
961 |
|
962 }/*function_sint_to_lreal*/ |
|
963 break; |
|
964 |
|
965 /**** |
|
966 *SINT_TO_TIME |
|
967 */ |
|
968 case function_sint_to_time : |
|
969 { |
|
970 symbol_c *last_type_symbol = NULL; |
|
971 |
|
972 { |
|
973 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
974 symbol_c *IN_param_value = &this->default_variable_name; |
|
975 |
|
976 symbol_c *IN_type_symbol = param_data_type; |
|
977 last_type_symbol = param_data_type; |
|
978 |
|
979 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
980 { |
|
981 |
|
982 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
983 s4o.print("("); |
|
984 return_type_symbol->accept(*this); |
|
985 s4o.print(")__int_to_time("); |
|
986 IN_param_value->accept(*this); |
|
987 s4o.print(")"); |
|
988 return NULL; |
|
989 |
|
990 } |
|
991 |
|
992 ERROR; |
|
993 } |
|
994 |
|
995 }/*function_sint_to_time*/ |
|
996 break; |
|
997 |
|
998 /**** |
|
999 *SINT_TO_DATE |
|
1000 */ |
|
1001 case function_sint_to_date : |
|
1002 { |
|
1003 symbol_c *last_type_symbol = NULL; |
|
1004 |
|
1005 { |
|
1006 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1007 symbol_c *IN_param_value = &this->default_variable_name; |
|
1008 |
|
1009 symbol_c *IN_type_symbol = param_data_type; |
|
1010 last_type_symbol = param_data_type; |
|
1011 |
|
1012 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1013 { |
|
1014 |
|
1015 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
1016 s4o.print("("); |
|
1017 return_type_symbol->accept(*this); |
|
1018 s4o.print(")__int_to_time("); |
|
1019 IN_param_value->accept(*this); |
|
1020 s4o.print(")"); |
|
1021 return NULL; |
|
1022 |
|
1023 } |
|
1024 |
|
1025 ERROR; |
|
1026 } |
|
1027 |
|
1028 }/*function_sint_to_date*/ |
|
1029 break; |
|
1030 |
|
1031 /**** |
|
1032 *SINT_TO_TOD |
|
1033 */ |
|
1034 case function_sint_to_tod : |
|
1035 { |
|
1036 symbol_c *last_type_symbol = NULL; |
|
1037 |
|
1038 { |
|
1039 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1040 symbol_c *IN_param_value = &this->default_variable_name; |
|
1041 |
|
1042 symbol_c *IN_type_symbol = param_data_type; |
|
1043 last_type_symbol = param_data_type; |
|
1044 |
|
1045 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1046 { |
|
1047 |
|
1048 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
1049 s4o.print("("); |
|
1050 return_type_symbol->accept(*this); |
|
1051 s4o.print(")__int_to_time("); |
|
1052 IN_param_value->accept(*this); |
|
1053 s4o.print(")"); |
|
1054 return NULL; |
|
1055 |
|
1056 } |
|
1057 |
|
1058 ERROR; |
|
1059 } |
|
1060 |
|
1061 }/*function_sint_to_tod*/ |
|
1062 break; |
|
1063 |
|
1064 /**** |
|
1065 *SINT_TO_DT |
|
1066 */ |
|
1067 case function_sint_to_dt : |
|
1068 { |
|
1069 symbol_c *last_type_symbol = NULL; |
|
1070 |
|
1071 { |
|
1072 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1073 symbol_c *IN_param_value = &this->default_variable_name; |
|
1074 |
|
1075 symbol_c *IN_type_symbol = param_data_type; |
|
1076 last_type_symbol = param_data_type; |
|
1077 |
|
1078 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1079 { |
|
1080 |
|
1081 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
1082 s4o.print("("); |
|
1083 return_type_symbol->accept(*this); |
|
1084 s4o.print(")__int_to_time("); |
|
1085 IN_param_value->accept(*this); |
|
1086 s4o.print(")"); |
|
1087 return NULL; |
|
1088 |
|
1089 } |
|
1090 |
|
1091 ERROR; |
|
1092 } |
|
1093 |
|
1094 }/*function_sint_to_dt*/ |
|
1095 break; |
|
1096 |
|
1097 /**** |
|
1098 *SINT_TO_STRING |
|
1099 */ |
|
1100 case function_sint_to_string : |
|
1101 { |
|
1102 symbol_c *last_type_symbol = NULL; |
|
1103 |
|
1104 { |
|
1105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1106 symbol_c *IN_param_value = &this->default_variable_name; |
|
1107 |
|
1108 symbol_c *IN_type_symbol = param_data_type; |
|
1109 last_type_symbol = param_data_type; |
|
1110 |
|
1111 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1112 { |
|
1113 |
|
1114 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
1115 s4o.print("("); |
|
1116 return_type_symbol->accept(*this); |
|
1117 s4o.print(")__sint_to_string("); |
|
1118 IN_param_value->accept(*this); |
|
1119 s4o.print(")"); |
|
1120 return NULL; |
|
1121 |
|
1122 } |
|
1123 |
|
1124 ERROR; |
|
1125 } |
|
1126 |
|
1127 }/*function_sint_to_string*/ |
|
1128 break; |
|
1129 |
|
1130 /**** |
|
1131 *SINT_TO_BYTE |
|
1132 */ |
|
1133 case function_sint_to_byte : |
|
1134 { |
|
1135 symbol_c *last_type_symbol = NULL; |
|
1136 |
|
1137 { |
|
1138 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1139 symbol_c *IN_param_value = &this->default_variable_name; |
|
1140 |
|
1141 symbol_c *IN_type_symbol = param_data_type; |
|
1142 last_type_symbol = param_data_type; |
|
1143 |
|
1144 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1145 { |
|
1146 |
|
1147 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
1148 s4o.print("("); |
|
1149 return_type_symbol->accept(*this); |
|
1150 s4o.print(")"); |
|
1151 IN_param_value->accept(*this); |
|
1152 return NULL; |
|
1153 |
|
1154 } |
|
1155 |
|
1156 ERROR; |
|
1157 } |
|
1158 |
|
1159 }/*function_sint_to_byte*/ |
|
1160 break; |
|
1161 |
|
1162 /**** |
|
1163 *SINT_TO_WORD |
|
1164 */ |
|
1165 case function_sint_to_word : |
|
1166 { |
|
1167 symbol_c *last_type_symbol = NULL; |
|
1168 |
|
1169 { |
|
1170 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1171 symbol_c *IN_param_value = &this->default_variable_name; |
|
1172 |
|
1173 symbol_c *IN_type_symbol = param_data_type; |
|
1174 last_type_symbol = param_data_type; |
|
1175 |
|
1176 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1177 { |
|
1178 |
|
1179 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
1180 s4o.print("("); |
|
1181 return_type_symbol->accept(*this); |
|
1182 s4o.print(")"); |
|
1183 IN_param_value->accept(*this); |
|
1184 return NULL; |
|
1185 |
|
1186 } |
|
1187 |
|
1188 ERROR; |
|
1189 } |
|
1190 |
|
1191 }/*function_sint_to_word*/ |
|
1192 break; |
|
1193 |
|
1194 /**** |
|
1195 *SINT_TO_DWORD |
|
1196 */ |
|
1197 case function_sint_to_dword : |
|
1198 { |
|
1199 symbol_c *last_type_symbol = NULL; |
|
1200 |
|
1201 { |
|
1202 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1203 symbol_c *IN_param_value = &this->default_variable_name; |
|
1204 |
|
1205 symbol_c *IN_type_symbol = param_data_type; |
|
1206 last_type_symbol = param_data_type; |
|
1207 |
|
1208 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1209 { |
|
1210 |
|
1211 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
1212 s4o.print("("); |
|
1213 return_type_symbol->accept(*this); |
|
1214 s4o.print(")"); |
|
1215 IN_param_value->accept(*this); |
|
1216 return NULL; |
|
1217 |
|
1218 } |
|
1219 |
|
1220 ERROR; |
|
1221 } |
|
1222 |
|
1223 }/*function_sint_to_dword*/ |
|
1224 break; |
|
1225 |
|
1226 /**** |
|
1227 *SINT_TO_LWORD |
|
1228 */ |
|
1229 case function_sint_to_lword : |
|
1230 { |
|
1231 symbol_c *last_type_symbol = NULL; |
|
1232 |
|
1233 { |
|
1234 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1235 symbol_c *IN_param_value = &this->default_variable_name; |
|
1236 |
|
1237 symbol_c *IN_type_symbol = param_data_type; |
|
1238 last_type_symbol = param_data_type; |
|
1239 |
|
1240 if(search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1241 { |
|
1242 |
|
1243 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
1244 s4o.print("("); |
|
1245 return_type_symbol->accept(*this); |
|
1246 s4o.print(")"); |
|
1247 IN_param_value->accept(*this); |
|
1248 return NULL; |
|
1249 |
|
1250 } |
|
1251 |
|
1252 ERROR; |
|
1253 } |
|
1254 |
|
1255 }/*function_sint_to_lword*/ |
|
1256 break; |
|
1257 |
|
1258 /**** |
|
1259 *INT_TO_BOOL |
|
1260 */ |
|
1261 case function_int_to_bool : |
|
1262 { |
|
1263 symbol_c *last_type_symbol = NULL; |
|
1264 |
|
1265 { |
|
1266 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1267 symbol_c *IN_param_value = &this->default_variable_name; |
|
1268 |
|
1269 symbol_c *IN_type_symbol = param_data_type; |
|
1270 last_type_symbol = param_data_type; |
|
1271 |
|
1272 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1273 { |
|
1274 |
|
1275 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
1276 s4o.print("("); |
|
1277 return_type_symbol->accept(*this); |
|
1278 s4o.print(")"); |
|
1279 IN_param_value->accept(*this); |
|
1280 return NULL; |
|
1281 |
|
1282 } |
|
1283 |
|
1284 ERROR; |
|
1285 } |
|
1286 |
|
1287 }/*function_int_to_bool*/ |
|
1288 break; |
|
1289 |
|
1290 /**** |
|
1291 *INT_TO_SINT |
|
1292 */ |
|
1293 case function_int_to_sint : |
|
1294 { |
|
1295 symbol_c *last_type_symbol = NULL; |
|
1296 |
|
1297 { |
|
1298 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1299 symbol_c *IN_param_value = &this->default_variable_name; |
|
1300 |
|
1301 symbol_c *IN_type_symbol = param_data_type; |
|
1302 last_type_symbol = param_data_type; |
|
1303 |
|
1304 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1305 { |
|
1306 |
|
1307 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
1308 s4o.print("("); |
|
1309 return_type_symbol->accept(*this); |
|
1310 s4o.print(")"); |
|
1311 IN_param_value->accept(*this); |
|
1312 return NULL; |
|
1313 |
|
1314 } |
|
1315 |
|
1316 ERROR; |
|
1317 } |
|
1318 |
|
1319 }/*function_int_to_sint*/ |
|
1320 break; |
|
1321 |
|
1322 /**** |
|
1323 *INT_TO_DINT |
|
1324 */ |
|
1325 case function_int_to_dint : |
|
1326 { |
|
1327 symbol_c *last_type_symbol = NULL; |
|
1328 |
|
1329 { |
|
1330 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1331 symbol_c *IN_param_value = &this->default_variable_name; |
|
1332 |
|
1333 symbol_c *IN_type_symbol = param_data_type; |
|
1334 last_type_symbol = param_data_type; |
|
1335 |
|
1336 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1337 { |
|
1338 |
|
1339 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
1340 s4o.print("("); |
|
1341 return_type_symbol->accept(*this); |
|
1342 s4o.print(")"); |
|
1343 IN_param_value->accept(*this); |
|
1344 return NULL; |
|
1345 |
|
1346 } |
|
1347 |
|
1348 ERROR; |
|
1349 } |
|
1350 |
|
1351 }/*function_int_to_dint*/ |
|
1352 break; |
|
1353 |
|
1354 /**** |
|
1355 *INT_TO_LINT |
|
1356 */ |
|
1357 case function_int_to_lint : |
|
1358 { |
|
1359 symbol_c *last_type_symbol = NULL; |
|
1360 |
|
1361 { |
|
1362 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1363 symbol_c *IN_param_value = &this->default_variable_name; |
|
1364 |
|
1365 symbol_c *IN_type_symbol = param_data_type; |
|
1366 last_type_symbol = param_data_type; |
|
1367 |
|
1368 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1369 { |
|
1370 |
|
1371 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
1372 s4o.print("("); |
|
1373 return_type_symbol->accept(*this); |
|
1374 s4o.print(")"); |
|
1375 IN_param_value->accept(*this); |
|
1376 return NULL; |
|
1377 |
|
1378 } |
|
1379 |
|
1380 ERROR; |
|
1381 } |
|
1382 |
|
1383 }/*function_int_to_lint*/ |
|
1384 break; |
|
1385 |
|
1386 /**** |
|
1387 *INT_TO_USINT |
|
1388 */ |
|
1389 case function_int_to_usint : |
|
1390 { |
|
1391 symbol_c *last_type_symbol = NULL; |
|
1392 |
|
1393 { |
|
1394 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1395 symbol_c *IN_param_value = &this->default_variable_name; |
|
1396 |
|
1397 symbol_c *IN_type_symbol = param_data_type; |
|
1398 last_type_symbol = param_data_type; |
|
1399 |
|
1400 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1401 { |
|
1402 |
|
1403 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
1404 s4o.print("("); |
|
1405 return_type_symbol->accept(*this); |
|
1406 s4o.print(")"); |
|
1407 IN_param_value->accept(*this); |
|
1408 return NULL; |
|
1409 |
|
1410 } |
|
1411 |
|
1412 ERROR; |
|
1413 } |
|
1414 |
|
1415 }/*function_int_to_usint*/ |
|
1416 break; |
|
1417 |
|
1418 /**** |
|
1419 *INT_TO_UINT |
|
1420 */ |
|
1421 case function_int_to_uint : |
|
1422 { |
|
1423 symbol_c *last_type_symbol = NULL; |
|
1424 |
|
1425 { |
|
1426 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1427 symbol_c *IN_param_value = &this->default_variable_name; |
|
1428 |
|
1429 symbol_c *IN_type_symbol = param_data_type; |
|
1430 last_type_symbol = param_data_type; |
|
1431 |
|
1432 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1433 { |
|
1434 |
|
1435 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
1436 s4o.print("("); |
|
1437 return_type_symbol->accept(*this); |
|
1438 s4o.print(")"); |
|
1439 IN_param_value->accept(*this); |
|
1440 return NULL; |
|
1441 |
|
1442 } |
|
1443 |
|
1444 ERROR; |
|
1445 } |
|
1446 |
|
1447 }/*function_int_to_uint*/ |
|
1448 break; |
|
1449 |
|
1450 /**** |
|
1451 *INT_TO_UDINT |
|
1452 */ |
|
1453 case function_int_to_udint : |
|
1454 { |
|
1455 symbol_c *last_type_symbol = NULL; |
|
1456 |
|
1457 { |
|
1458 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1459 symbol_c *IN_param_value = &this->default_variable_name; |
|
1460 |
|
1461 symbol_c *IN_type_symbol = param_data_type; |
|
1462 last_type_symbol = param_data_type; |
|
1463 |
|
1464 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1465 { |
|
1466 |
|
1467 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
1468 s4o.print("("); |
|
1469 return_type_symbol->accept(*this); |
|
1470 s4o.print(")"); |
|
1471 IN_param_value->accept(*this); |
|
1472 return NULL; |
|
1473 |
|
1474 } |
|
1475 |
|
1476 ERROR; |
|
1477 } |
|
1478 |
|
1479 }/*function_int_to_udint*/ |
|
1480 break; |
|
1481 |
|
1482 /**** |
|
1483 *INT_TO_ULINT |
|
1484 */ |
|
1485 case function_int_to_ulint : |
|
1486 { |
|
1487 symbol_c *last_type_symbol = NULL; |
|
1488 |
|
1489 { |
|
1490 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1491 symbol_c *IN_param_value = &this->default_variable_name; |
|
1492 |
|
1493 symbol_c *IN_type_symbol = param_data_type; |
|
1494 last_type_symbol = param_data_type; |
|
1495 |
|
1496 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1497 { |
|
1498 |
|
1499 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
1500 s4o.print("("); |
|
1501 return_type_symbol->accept(*this); |
|
1502 s4o.print(")"); |
|
1503 IN_param_value->accept(*this); |
|
1504 return NULL; |
|
1505 |
|
1506 } |
|
1507 |
|
1508 ERROR; |
|
1509 } |
|
1510 |
|
1511 }/*function_int_to_ulint*/ |
|
1512 break; |
|
1513 |
|
1514 /**** |
|
1515 *INT_TO_REAL |
|
1516 */ |
|
1517 case function_int_to_real : |
|
1518 { |
|
1519 symbol_c *last_type_symbol = NULL; |
|
1520 |
|
1521 { |
|
1522 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1523 symbol_c *IN_param_value = &this->default_variable_name; |
|
1524 |
|
1525 symbol_c *IN_type_symbol = param_data_type; |
|
1526 last_type_symbol = param_data_type; |
|
1527 |
|
1528 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1529 { |
|
1530 |
|
1531 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
1532 s4o.print("("); |
|
1533 return_type_symbol->accept(*this); |
|
1534 s4o.print(")"); |
|
1535 IN_param_value->accept(*this); |
|
1536 return NULL; |
|
1537 |
|
1538 } |
|
1539 |
|
1540 ERROR; |
|
1541 } |
|
1542 |
|
1543 }/*function_int_to_real*/ |
|
1544 break; |
|
1545 |
|
1546 /**** |
|
1547 *INT_TO_LREAL |
|
1548 */ |
|
1549 case function_int_to_lreal : |
|
1550 { |
|
1551 symbol_c *last_type_symbol = NULL; |
|
1552 |
|
1553 { |
|
1554 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1555 symbol_c *IN_param_value = &this->default_variable_name; |
|
1556 |
|
1557 symbol_c *IN_type_symbol = param_data_type; |
|
1558 last_type_symbol = param_data_type; |
|
1559 |
|
1560 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1561 { |
|
1562 |
|
1563 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
1564 s4o.print("("); |
|
1565 return_type_symbol->accept(*this); |
|
1566 s4o.print(")"); |
|
1567 IN_param_value->accept(*this); |
|
1568 return NULL; |
|
1569 |
|
1570 } |
|
1571 |
|
1572 ERROR; |
|
1573 } |
|
1574 |
|
1575 }/*function_int_to_lreal*/ |
|
1576 break; |
|
1577 |
|
1578 /**** |
|
1579 *INT_TO_TIME |
|
1580 */ |
|
1581 case function_int_to_time : |
|
1582 { |
|
1583 symbol_c *last_type_symbol = NULL; |
|
1584 |
|
1585 { |
|
1586 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1587 symbol_c *IN_param_value = &this->default_variable_name; |
|
1588 |
|
1589 symbol_c *IN_type_symbol = param_data_type; |
|
1590 last_type_symbol = param_data_type; |
|
1591 |
|
1592 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1593 { |
|
1594 |
|
1595 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
1596 s4o.print("("); |
|
1597 return_type_symbol->accept(*this); |
|
1598 s4o.print(")__int_to_time("); |
|
1599 IN_param_value->accept(*this); |
|
1600 s4o.print(")"); |
|
1601 return NULL; |
|
1602 |
|
1603 } |
|
1604 |
|
1605 ERROR; |
|
1606 } |
|
1607 |
|
1608 }/*function_int_to_time*/ |
|
1609 break; |
|
1610 |
|
1611 /**** |
|
1612 *INT_TO_DATE |
|
1613 */ |
|
1614 case function_int_to_date : |
|
1615 { |
|
1616 symbol_c *last_type_symbol = NULL; |
|
1617 |
|
1618 { |
|
1619 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1620 symbol_c *IN_param_value = &this->default_variable_name; |
|
1621 |
|
1622 symbol_c *IN_type_symbol = param_data_type; |
|
1623 last_type_symbol = param_data_type; |
|
1624 |
|
1625 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1626 { |
|
1627 |
|
1628 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
1629 s4o.print("("); |
|
1630 return_type_symbol->accept(*this); |
|
1631 s4o.print(")__int_to_time("); |
|
1632 IN_param_value->accept(*this); |
|
1633 s4o.print(")"); |
|
1634 return NULL; |
|
1635 |
|
1636 } |
|
1637 |
|
1638 ERROR; |
|
1639 } |
|
1640 |
|
1641 }/*function_int_to_date*/ |
|
1642 break; |
|
1643 |
|
1644 /**** |
|
1645 *INT_TO_TOD |
|
1646 */ |
|
1647 case function_int_to_tod : |
|
1648 { |
|
1649 symbol_c *last_type_symbol = NULL; |
|
1650 |
|
1651 { |
|
1652 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1653 symbol_c *IN_param_value = &this->default_variable_name; |
|
1654 |
|
1655 symbol_c *IN_type_symbol = param_data_type; |
|
1656 last_type_symbol = param_data_type; |
|
1657 |
|
1658 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1659 { |
|
1660 |
|
1661 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
1662 s4o.print("("); |
|
1663 return_type_symbol->accept(*this); |
|
1664 s4o.print(")__int_to_time("); |
|
1665 IN_param_value->accept(*this); |
|
1666 s4o.print(")"); |
|
1667 return NULL; |
|
1668 |
|
1669 } |
|
1670 |
|
1671 ERROR; |
|
1672 } |
|
1673 |
|
1674 }/*function_int_to_tod*/ |
|
1675 break; |
|
1676 |
|
1677 /**** |
|
1678 *INT_TO_DT |
|
1679 */ |
|
1680 case function_int_to_dt : |
|
1681 { |
|
1682 symbol_c *last_type_symbol = NULL; |
|
1683 |
|
1684 { |
|
1685 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1686 symbol_c *IN_param_value = &this->default_variable_name; |
|
1687 |
|
1688 symbol_c *IN_type_symbol = param_data_type; |
|
1689 last_type_symbol = param_data_type; |
|
1690 |
|
1691 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1692 { |
|
1693 |
|
1694 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
1695 s4o.print("("); |
|
1696 return_type_symbol->accept(*this); |
|
1697 s4o.print(")__int_to_time("); |
|
1698 IN_param_value->accept(*this); |
|
1699 s4o.print(")"); |
|
1700 return NULL; |
|
1701 |
|
1702 } |
|
1703 |
|
1704 ERROR; |
|
1705 } |
|
1706 |
|
1707 }/*function_int_to_dt*/ |
|
1708 break; |
|
1709 |
|
1710 /**** |
|
1711 *INT_TO_STRING |
|
1712 */ |
|
1713 case function_int_to_string : |
|
1714 { |
|
1715 symbol_c *last_type_symbol = NULL; |
|
1716 |
|
1717 { |
|
1718 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1719 symbol_c *IN_param_value = &this->default_variable_name; |
|
1720 |
|
1721 symbol_c *IN_type_symbol = param_data_type; |
|
1722 last_type_symbol = param_data_type; |
|
1723 |
|
1724 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1725 { |
|
1726 |
|
1727 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
1728 s4o.print("("); |
|
1729 return_type_symbol->accept(*this); |
|
1730 s4o.print(")__sint_to_string("); |
|
1731 IN_param_value->accept(*this); |
|
1732 s4o.print(")"); |
|
1733 return NULL; |
|
1734 |
|
1735 } |
|
1736 |
|
1737 ERROR; |
|
1738 } |
|
1739 |
|
1740 }/*function_int_to_string*/ |
|
1741 break; |
|
1742 |
|
1743 /**** |
|
1744 *INT_TO_BYTE |
|
1745 */ |
|
1746 case function_int_to_byte : |
|
1747 { |
|
1748 symbol_c *last_type_symbol = NULL; |
|
1749 |
|
1750 { |
|
1751 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1752 symbol_c *IN_param_value = &this->default_variable_name; |
|
1753 |
|
1754 symbol_c *IN_type_symbol = param_data_type; |
|
1755 last_type_symbol = param_data_type; |
|
1756 |
|
1757 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1758 { |
|
1759 |
|
1760 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
1761 s4o.print("("); |
|
1762 return_type_symbol->accept(*this); |
|
1763 s4o.print(")"); |
|
1764 IN_param_value->accept(*this); |
|
1765 return NULL; |
|
1766 |
|
1767 } |
|
1768 |
|
1769 ERROR; |
|
1770 } |
|
1771 |
|
1772 }/*function_int_to_byte*/ |
|
1773 break; |
|
1774 |
|
1775 /**** |
|
1776 *INT_TO_WORD |
|
1777 */ |
|
1778 case function_int_to_word : |
|
1779 { |
|
1780 symbol_c *last_type_symbol = NULL; |
|
1781 |
|
1782 { |
|
1783 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1784 symbol_c *IN_param_value = &this->default_variable_name; |
|
1785 |
|
1786 symbol_c *IN_type_symbol = param_data_type; |
|
1787 last_type_symbol = param_data_type; |
|
1788 |
|
1789 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1790 { |
|
1791 |
|
1792 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
1793 s4o.print("("); |
|
1794 return_type_symbol->accept(*this); |
|
1795 s4o.print(")"); |
|
1796 IN_param_value->accept(*this); |
|
1797 return NULL; |
|
1798 |
|
1799 } |
|
1800 |
|
1801 ERROR; |
|
1802 } |
|
1803 |
|
1804 }/*function_int_to_word*/ |
|
1805 break; |
|
1806 |
|
1807 /**** |
|
1808 *INT_TO_DWORD |
|
1809 */ |
|
1810 case function_int_to_dword : |
|
1811 { |
|
1812 symbol_c *last_type_symbol = NULL; |
|
1813 |
|
1814 { |
|
1815 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1816 symbol_c *IN_param_value = &this->default_variable_name; |
|
1817 |
|
1818 symbol_c *IN_type_symbol = param_data_type; |
|
1819 last_type_symbol = param_data_type; |
|
1820 |
|
1821 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1822 { |
|
1823 |
|
1824 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
1825 s4o.print("("); |
|
1826 return_type_symbol->accept(*this); |
|
1827 s4o.print(")"); |
|
1828 IN_param_value->accept(*this); |
|
1829 return NULL; |
|
1830 |
|
1831 } |
|
1832 |
|
1833 ERROR; |
|
1834 } |
|
1835 |
|
1836 }/*function_int_to_dword*/ |
|
1837 break; |
|
1838 |
|
1839 /**** |
|
1840 *INT_TO_LWORD |
|
1841 */ |
|
1842 case function_int_to_lword : |
|
1843 { |
|
1844 symbol_c *last_type_symbol = NULL; |
|
1845 |
|
1846 { |
|
1847 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1848 symbol_c *IN_param_value = &this->default_variable_name; |
|
1849 |
|
1850 symbol_c *IN_type_symbol = param_data_type; |
|
1851 last_type_symbol = param_data_type; |
|
1852 |
|
1853 if(search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) |
|
1854 { |
|
1855 |
|
1856 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
1857 s4o.print("("); |
|
1858 return_type_symbol->accept(*this); |
|
1859 s4o.print(")"); |
|
1860 IN_param_value->accept(*this); |
|
1861 return NULL; |
|
1862 |
|
1863 } |
|
1864 |
|
1865 ERROR; |
|
1866 } |
|
1867 |
|
1868 }/*function_int_to_lword*/ |
|
1869 break; |
|
1870 |
|
1871 /**** |
|
1872 *DINT_TO_BOOL |
|
1873 */ |
|
1874 case function_dint_to_bool : |
|
1875 { |
|
1876 symbol_c *last_type_symbol = NULL; |
|
1877 |
|
1878 { |
|
1879 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1880 symbol_c *IN_param_value = &this->default_variable_name; |
|
1881 |
|
1882 symbol_c *IN_type_symbol = param_data_type; |
|
1883 last_type_symbol = param_data_type; |
|
1884 |
|
1885 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
1886 { |
|
1887 |
|
1888 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
1889 s4o.print("("); |
|
1890 return_type_symbol->accept(*this); |
|
1891 s4o.print(")"); |
|
1892 IN_param_value->accept(*this); |
|
1893 return NULL; |
|
1894 |
|
1895 } |
|
1896 |
|
1897 ERROR; |
|
1898 } |
|
1899 |
|
1900 }/*function_dint_to_bool*/ |
|
1901 break; |
|
1902 |
|
1903 /**** |
|
1904 *DINT_TO_SINT |
|
1905 */ |
|
1906 case function_dint_to_sint : |
|
1907 { |
|
1908 symbol_c *last_type_symbol = NULL; |
|
1909 |
|
1910 { |
|
1911 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1912 symbol_c *IN_param_value = &this->default_variable_name; |
|
1913 |
|
1914 symbol_c *IN_type_symbol = param_data_type; |
|
1915 last_type_symbol = param_data_type; |
|
1916 |
|
1917 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
1918 { |
|
1919 |
|
1920 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
1921 s4o.print("("); |
|
1922 return_type_symbol->accept(*this); |
|
1923 s4o.print(")"); |
|
1924 IN_param_value->accept(*this); |
|
1925 return NULL; |
|
1926 |
|
1927 } |
|
1928 |
|
1929 ERROR; |
|
1930 } |
|
1931 |
|
1932 }/*function_dint_to_sint*/ |
|
1933 break; |
|
1934 |
|
1935 /**** |
|
1936 *DINT_TO_INT |
|
1937 */ |
|
1938 case function_dint_to_int : |
|
1939 { |
|
1940 symbol_c *last_type_symbol = NULL; |
|
1941 |
|
1942 { |
|
1943 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1944 symbol_c *IN_param_value = &this->default_variable_name; |
|
1945 |
|
1946 symbol_c *IN_type_symbol = param_data_type; |
|
1947 last_type_symbol = param_data_type; |
|
1948 |
|
1949 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
1950 { |
|
1951 |
|
1952 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
1953 s4o.print("("); |
|
1954 return_type_symbol->accept(*this); |
|
1955 s4o.print(")"); |
|
1956 IN_param_value->accept(*this); |
|
1957 return NULL; |
|
1958 |
|
1959 } |
|
1960 |
|
1961 ERROR; |
|
1962 } |
|
1963 |
|
1964 }/*function_dint_to_int*/ |
|
1965 break; |
|
1966 |
|
1967 /**** |
|
1968 *DINT_TO_LINT |
|
1969 */ |
|
1970 case function_dint_to_lint : |
|
1971 { |
|
1972 symbol_c *last_type_symbol = NULL; |
|
1973 |
|
1974 { |
|
1975 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
1976 symbol_c *IN_param_value = &this->default_variable_name; |
|
1977 |
|
1978 symbol_c *IN_type_symbol = param_data_type; |
|
1979 last_type_symbol = param_data_type; |
|
1980 |
|
1981 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
1982 { |
|
1983 |
|
1984 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
1985 s4o.print("("); |
|
1986 return_type_symbol->accept(*this); |
|
1987 s4o.print(")"); |
|
1988 IN_param_value->accept(*this); |
|
1989 return NULL; |
|
1990 |
|
1991 } |
|
1992 |
|
1993 ERROR; |
|
1994 } |
|
1995 |
|
1996 }/*function_dint_to_lint*/ |
|
1997 break; |
|
1998 |
|
1999 /**** |
|
2000 *DINT_TO_USINT |
|
2001 */ |
|
2002 case function_dint_to_usint : |
|
2003 { |
|
2004 symbol_c *last_type_symbol = NULL; |
|
2005 |
|
2006 { |
|
2007 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2008 symbol_c *IN_param_value = &this->default_variable_name; |
|
2009 |
|
2010 symbol_c *IN_type_symbol = param_data_type; |
|
2011 last_type_symbol = param_data_type; |
|
2012 |
|
2013 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2014 { |
|
2015 |
|
2016 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
2017 s4o.print("("); |
|
2018 return_type_symbol->accept(*this); |
|
2019 s4o.print(")"); |
|
2020 IN_param_value->accept(*this); |
|
2021 return NULL; |
|
2022 |
|
2023 } |
|
2024 |
|
2025 ERROR; |
|
2026 } |
|
2027 |
|
2028 }/*function_dint_to_usint*/ |
|
2029 break; |
|
2030 |
|
2031 /**** |
|
2032 *DINT_TO_UINT |
|
2033 */ |
|
2034 case function_dint_to_uint : |
|
2035 { |
|
2036 symbol_c *last_type_symbol = NULL; |
|
2037 |
|
2038 { |
|
2039 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2040 symbol_c *IN_param_value = &this->default_variable_name; |
|
2041 |
|
2042 symbol_c *IN_type_symbol = param_data_type; |
|
2043 last_type_symbol = param_data_type; |
|
2044 |
|
2045 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2046 { |
|
2047 |
|
2048 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
2049 s4o.print("("); |
|
2050 return_type_symbol->accept(*this); |
|
2051 s4o.print(")"); |
|
2052 IN_param_value->accept(*this); |
|
2053 return NULL; |
|
2054 |
|
2055 } |
|
2056 |
|
2057 ERROR; |
|
2058 } |
|
2059 |
|
2060 }/*function_dint_to_uint*/ |
|
2061 break; |
|
2062 |
|
2063 /**** |
|
2064 *DINT_TO_UDINT |
|
2065 */ |
|
2066 case function_dint_to_udint : |
|
2067 { |
|
2068 symbol_c *last_type_symbol = NULL; |
|
2069 |
|
2070 { |
|
2071 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2072 symbol_c *IN_param_value = &this->default_variable_name; |
|
2073 |
|
2074 symbol_c *IN_type_symbol = param_data_type; |
|
2075 last_type_symbol = param_data_type; |
|
2076 |
|
2077 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2078 { |
|
2079 |
|
2080 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
2081 s4o.print("("); |
|
2082 return_type_symbol->accept(*this); |
|
2083 s4o.print(")"); |
|
2084 IN_param_value->accept(*this); |
|
2085 return NULL; |
|
2086 |
|
2087 } |
|
2088 |
|
2089 ERROR; |
|
2090 } |
|
2091 |
|
2092 }/*function_dint_to_udint*/ |
|
2093 break; |
|
2094 |
|
2095 /**** |
|
2096 *DINT_TO_ULINT |
|
2097 */ |
|
2098 case function_dint_to_ulint : |
|
2099 { |
|
2100 symbol_c *last_type_symbol = NULL; |
|
2101 |
|
2102 { |
|
2103 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2104 symbol_c *IN_param_value = &this->default_variable_name; |
|
2105 |
|
2106 symbol_c *IN_type_symbol = param_data_type; |
|
2107 last_type_symbol = param_data_type; |
|
2108 |
|
2109 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2110 { |
|
2111 |
|
2112 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
2113 s4o.print("("); |
|
2114 return_type_symbol->accept(*this); |
|
2115 s4o.print(")"); |
|
2116 IN_param_value->accept(*this); |
|
2117 return NULL; |
|
2118 |
|
2119 } |
|
2120 |
|
2121 ERROR; |
|
2122 } |
|
2123 |
|
2124 }/*function_dint_to_ulint*/ |
|
2125 break; |
|
2126 |
|
2127 /**** |
|
2128 *DINT_TO_REAL |
|
2129 */ |
|
2130 case function_dint_to_real : |
|
2131 { |
|
2132 symbol_c *last_type_symbol = NULL; |
|
2133 |
|
2134 { |
|
2135 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2136 symbol_c *IN_param_value = &this->default_variable_name; |
|
2137 |
|
2138 symbol_c *IN_type_symbol = param_data_type; |
|
2139 last_type_symbol = param_data_type; |
|
2140 |
|
2141 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2142 { |
|
2143 |
|
2144 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
2145 s4o.print("("); |
|
2146 return_type_symbol->accept(*this); |
|
2147 s4o.print(")"); |
|
2148 IN_param_value->accept(*this); |
|
2149 return NULL; |
|
2150 |
|
2151 } |
|
2152 |
|
2153 ERROR; |
|
2154 } |
|
2155 |
|
2156 }/*function_dint_to_real*/ |
|
2157 break; |
|
2158 |
|
2159 /**** |
|
2160 *DINT_TO_LREAL |
|
2161 */ |
|
2162 case function_dint_to_lreal : |
|
2163 { |
|
2164 symbol_c *last_type_symbol = NULL; |
|
2165 |
|
2166 { |
|
2167 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2168 symbol_c *IN_param_value = &this->default_variable_name; |
|
2169 |
|
2170 symbol_c *IN_type_symbol = param_data_type; |
|
2171 last_type_symbol = param_data_type; |
|
2172 |
|
2173 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2174 { |
|
2175 |
|
2176 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
2177 s4o.print("("); |
|
2178 return_type_symbol->accept(*this); |
|
2179 s4o.print(")"); |
|
2180 IN_param_value->accept(*this); |
|
2181 return NULL; |
|
2182 |
|
2183 } |
|
2184 |
|
2185 ERROR; |
|
2186 } |
|
2187 |
|
2188 }/*function_dint_to_lreal*/ |
|
2189 break; |
|
2190 |
|
2191 /**** |
|
2192 *DINT_TO_TIME |
|
2193 */ |
|
2194 case function_dint_to_time : |
|
2195 { |
|
2196 symbol_c *last_type_symbol = NULL; |
|
2197 |
|
2198 { |
|
2199 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2200 symbol_c *IN_param_value = &this->default_variable_name; |
|
2201 |
|
2202 symbol_c *IN_type_symbol = param_data_type; |
|
2203 last_type_symbol = param_data_type; |
|
2204 |
|
2205 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2206 { |
|
2207 |
|
2208 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
2209 s4o.print("("); |
|
2210 return_type_symbol->accept(*this); |
|
2211 s4o.print(")__int_to_time("); |
|
2212 IN_param_value->accept(*this); |
|
2213 s4o.print(")"); |
|
2214 return NULL; |
|
2215 |
|
2216 } |
|
2217 |
|
2218 ERROR; |
|
2219 } |
|
2220 |
|
2221 }/*function_dint_to_time*/ |
|
2222 break; |
|
2223 |
|
2224 /**** |
|
2225 *DINT_TO_DATE |
|
2226 */ |
|
2227 case function_dint_to_date : |
|
2228 { |
|
2229 symbol_c *last_type_symbol = NULL; |
|
2230 |
|
2231 { |
|
2232 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2233 symbol_c *IN_param_value = &this->default_variable_name; |
|
2234 |
|
2235 symbol_c *IN_type_symbol = param_data_type; |
|
2236 last_type_symbol = param_data_type; |
|
2237 |
|
2238 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2239 { |
|
2240 |
|
2241 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
2242 s4o.print("("); |
|
2243 return_type_symbol->accept(*this); |
|
2244 s4o.print(")__int_to_time("); |
|
2245 IN_param_value->accept(*this); |
|
2246 s4o.print(")"); |
|
2247 return NULL; |
|
2248 |
|
2249 } |
|
2250 |
|
2251 ERROR; |
|
2252 } |
|
2253 |
|
2254 }/*function_dint_to_date*/ |
|
2255 break; |
|
2256 |
|
2257 /**** |
|
2258 *DINT_TO_TOD |
|
2259 */ |
|
2260 case function_dint_to_tod : |
|
2261 { |
|
2262 symbol_c *last_type_symbol = NULL; |
|
2263 |
|
2264 { |
|
2265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2266 symbol_c *IN_param_value = &this->default_variable_name; |
|
2267 |
|
2268 symbol_c *IN_type_symbol = param_data_type; |
|
2269 last_type_symbol = param_data_type; |
|
2270 |
|
2271 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2272 { |
|
2273 |
|
2274 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
2275 s4o.print("("); |
|
2276 return_type_symbol->accept(*this); |
|
2277 s4o.print(")__int_to_time("); |
|
2278 IN_param_value->accept(*this); |
|
2279 s4o.print(")"); |
|
2280 return NULL; |
|
2281 |
|
2282 } |
|
2283 |
|
2284 ERROR; |
|
2285 } |
|
2286 |
|
2287 }/*function_dint_to_tod*/ |
|
2288 break; |
|
2289 |
|
2290 /**** |
|
2291 *DINT_TO_DT |
|
2292 */ |
|
2293 case function_dint_to_dt : |
|
2294 { |
|
2295 symbol_c *last_type_symbol = NULL; |
|
2296 |
|
2297 { |
|
2298 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2299 symbol_c *IN_param_value = &this->default_variable_name; |
|
2300 |
|
2301 symbol_c *IN_type_symbol = param_data_type; |
|
2302 last_type_symbol = param_data_type; |
|
2303 |
|
2304 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2305 { |
|
2306 |
|
2307 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
2308 s4o.print("("); |
|
2309 return_type_symbol->accept(*this); |
|
2310 s4o.print(")__int_to_time("); |
|
2311 IN_param_value->accept(*this); |
|
2312 s4o.print(")"); |
|
2313 return NULL; |
|
2314 |
|
2315 } |
|
2316 |
|
2317 ERROR; |
|
2318 } |
|
2319 |
|
2320 }/*function_dint_to_dt*/ |
|
2321 break; |
|
2322 |
|
2323 /**** |
|
2324 *DINT_TO_STRING |
|
2325 */ |
|
2326 case function_dint_to_string : |
|
2327 { |
|
2328 symbol_c *last_type_symbol = NULL; |
|
2329 |
|
2330 { |
|
2331 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2332 symbol_c *IN_param_value = &this->default_variable_name; |
|
2333 |
|
2334 symbol_c *IN_type_symbol = param_data_type; |
|
2335 last_type_symbol = param_data_type; |
|
2336 |
|
2337 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2338 { |
|
2339 |
|
2340 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
2341 s4o.print("("); |
|
2342 return_type_symbol->accept(*this); |
|
2343 s4o.print(")__sint_to_string("); |
|
2344 IN_param_value->accept(*this); |
|
2345 s4o.print(")"); |
|
2346 return NULL; |
|
2347 |
|
2348 } |
|
2349 |
|
2350 ERROR; |
|
2351 } |
|
2352 |
|
2353 }/*function_dint_to_string*/ |
|
2354 break; |
|
2355 |
|
2356 /**** |
|
2357 *DINT_TO_BYTE |
|
2358 */ |
|
2359 case function_dint_to_byte : |
|
2360 { |
|
2361 symbol_c *last_type_symbol = NULL; |
|
2362 |
|
2363 { |
|
2364 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2365 symbol_c *IN_param_value = &this->default_variable_name; |
|
2366 |
|
2367 symbol_c *IN_type_symbol = param_data_type; |
|
2368 last_type_symbol = param_data_type; |
|
2369 |
|
2370 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2371 { |
|
2372 |
|
2373 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
2374 s4o.print("("); |
|
2375 return_type_symbol->accept(*this); |
|
2376 s4o.print(")"); |
|
2377 IN_param_value->accept(*this); |
|
2378 return NULL; |
|
2379 |
|
2380 } |
|
2381 |
|
2382 ERROR; |
|
2383 } |
|
2384 |
|
2385 }/*function_dint_to_byte*/ |
|
2386 break; |
|
2387 |
|
2388 /**** |
|
2389 *DINT_TO_WORD |
|
2390 */ |
|
2391 case function_dint_to_word : |
|
2392 { |
|
2393 symbol_c *last_type_symbol = NULL; |
|
2394 |
|
2395 { |
|
2396 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2397 symbol_c *IN_param_value = &this->default_variable_name; |
|
2398 |
|
2399 symbol_c *IN_type_symbol = param_data_type; |
|
2400 last_type_symbol = param_data_type; |
|
2401 |
|
2402 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2403 { |
|
2404 |
|
2405 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
2406 s4o.print("("); |
|
2407 return_type_symbol->accept(*this); |
|
2408 s4o.print(")"); |
|
2409 IN_param_value->accept(*this); |
|
2410 return NULL; |
|
2411 |
|
2412 } |
|
2413 |
|
2414 ERROR; |
|
2415 } |
|
2416 |
|
2417 }/*function_dint_to_word*/ |
|
2418 break; |
|
2419 |
|
2420 /**** |
|
2421 *DINT_TO_DWORD |
|
2422 */ |
|
2423 case function_dint_to_dword : |
|
2424 { |
|
2425 symbol_c *last_type_symbol = NULL; |
|
2426 |
|
2427 { |
|
2428 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2429 symbol_c *IN_param_value = &this->default_variable_name; |
|
2430 |
|
2431 symbol_c *IN_type_symbol = param_data_type; |
|
2432 last_type_symbol = param_data_type; |
|
2433 |
|
2434 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2435 { |
|
2436 |
|
2437 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
2438 s4o.print("("); |
|
2439 return_type_symbol->accept(*this); |
|
2440 s4o.print(")"); |
|
2441 IN_param_value->accept(*this); |
|
2442 return NULL; |
|
2443 |
|
2444 } |
|
2445 |
|
2446 ERROR; |
|
2447 } |
|
2448 |
|
2449 }/*function_dint_to_dword*/ |
|
2450 break; |
|
2451 |
|
2452 /**** |
|
2453 *DINT_TO_LWORD |
|
2454 */ |
|
2455 case function_dint_to_lword : |
|
2456 { |
|
2457 symbol_c *last_type_symbol = NULL; |
|
2458 |
|
2459 { |
|
2460 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2461 symbol_c *IN_param_value = &this->default_variable_name; |
|
2462 |
|
2463 symbol_c *IN_type_symbol = param_data_type; |
|
2464 last_type_symbol = param_data_type; |
|
2465 |
|
2466 if(search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) |
|
2467 { |
|
2468 |
|
2469 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
2470 s4o.print("("); |
|
2471 return_type_symbol->accept(*this); |
|
2472 s4o.print(")"); |
|
2473 IN_param_value->accept(*this); |
|
2474 return NULL; |
|
2475 |
|
2476 } |
|
2477 |
|
2478 ERROR; |
|
2479 } |
|
2480 |
|
2481 }/*function_dint_to_lword*/ |
|
2482 break; |
|
2483 |
|
2484 /**** |
|
2485 *LINT_TO_BOOL |
|
2486 */ |
|
2487 case function_lint_to_bool : |
|
2488 { |
|
2489 symbol_c *last_type_symbol = NULL; |
|
2490 |
|
2491 { |
|
2492 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2493 symbol_c *IN_param_value = &this->default_variable_name; |
|
2494 |
|
2495 symbol_c *IN_type_symbol = param_data_type; |
|
2496 last_type_symbol = param_data_type; |
|
2497 |
|
2498 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2499 { |
|
2500 |
|
2501 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
2502 s4o.print("("); |
|
2503 return_type_symbol->accept(*this); |
|
2504 s4o.print(")"); |
|
2505 IN_param_value->accept(*this); |
|
2506 return NULL; |
|
2507 |
|
2508 } |
|
2509 |
|
2510 ERROR; |
|
2511 } |
|
2512 |
|
2513 }/*function_lint_to_bool*/ |
|
2514 break; |
|
2515 |
|
2516 /**** |
|
2517 *LINT_TO_SINT |
|
2518 */ |
|
2519 case function_lint_to_sint : |
|
2520 { |
|
2521 symbol_c *last_type_symbol = NULL; |
|
2522 |
|
2523 { |
|
2524 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2525 symbol_c *IN_param_value = &this->default_variable_name; |
|
2526 |
|
2527 symbol_c *IN_type_symbol = param_data_type; |
|
2528 last_type_symbol = param_data_type; |
|
2529 |
|
2530 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2531 { |
|
2532 |
|
2533 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
2534 s4o.print("("); |
|
2535 return_type_symbol->accept(*this); |
|
2536 s4o.print(")"); |
|
2537 IN_param_value->accept(*this); |
|
2538 return NULL; |
|
2539 |
|
2540 } |
|
2541 |
|
2542 ERROR; |
|
2543 } |
|
2544 |
|
2545 }/*function_lint_to_sint*/ |
|
2546 break; |
|
2547 |
|
2548 /**** |
|
2549 *LINT_TO_INT |
|
2550 */ |
|
2551 case function_lint_to_int : |
|
2552 { |
|
2553 symbol_c *last_type_symbol = NULL; |
|
2554 |
|
2555 { |
|
2556 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2557 symbol_c *IN_param_value = &this->default_variable_name; |
|
2558 |
|
2559 symbol_c *IN_type_symbol = param_data_type; |
|
2560 last_type_symbol = param_data_type; |
|
2561 |
|
2562 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2563 { |
|
2564 |
|
2565 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
2566 s4o.print("("); |
|
2567 return_type_symbol->accept(*this); |
|
2568 s4o.print(")"); |
|
2569 IN_param_value->accept(*this); |
|
2570 return NULL; |
|
2571 |
|
2572 } |
|
2573 |
|
2574 ERROR; |
|
2575 } |
|
2576 |
|
2577 }/*function_lint_to_int*/ |
|
2578 break; |
|
2579 |
|
2580 /**** |
|
2581 *LINT_TO_DINT |
|
2582 */ |
|
2583 case function_lint_to_dint : |
|
2584 { |
|
2585 symbol_c *last_type_symbol = NULL; |
|
2586 |
|
2587 { |
|
2588 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2589 symbol_c *IN_param_value = &this->default_variable_name; |
|
2590 |
|
2591 symbol_c *IN_type_symbol = param_data_type; |
|
2592 last_type_symbol = param_data_type; |
|
2593 |
|
2594 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2595 { |
|
2596 |
|
2597 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
2598 s4o.print("("); |
|
2599 return_type_symbol->accept(*this); |
|
2600 s4o.print(")"); |
|
2601 IN_param_value->accept(*this); |
|
2602 return NULL; |
|
2603 |
|
2604 } |
|
2605 |
|
2606 ERROR; |
|
2607 } |
|
2608 |
|
2609 }/*function_lint_to_dint*/ |
|
2610 break; |
|
2611 |
|
2612 /**** |
|
2613 *LINT_TO_USINT |
|
2614 */ |
|
2615 case function_lint_to_usint : |
|
2616 { |
|
2617 symbol_c *last_type_symbol = NULL; |
|
2618 |
|
2619 { |
|
2620 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2621 symbol_c *IN_param_value = &this->default_variable_name; |
|
2622 |
|
2623 symbol_c *IN_type_symbol = param_data_type; |
|
2624 last_type_symbol = param_data_type; |
|
2625 |
|
2626 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2627 { |
|
2628 |
|
2629 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
2630 s4o.print("("); |
|
2631 return_type_symbol->accept(*this); |
|
2632 s4o.print(")"); |
|
2633 IN_param_value->accept(*this); |
|
2634 return NULL; |
|
2635 |
|
2636 } |
|
2637 |
|
2638 ERROR; |
|
2639 } |
|
2640 |
|
2641 }/*function_lint_to_usint*/ |
|
2642 break; |
|
2643 |
|
2644 /**** |
|
2645 *LINT_TO_UINT |
|
2646 */ |
|
2647 case function_lint_to_uint : |
|
2648 { |
|
2649 symbol_c *last_type_symbol = NULL; |
|
2650 |
|
2651 { |
|
2652 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2653 symbol_c *IN_param_value = &this->default_variable_name; |
|
2654 |
|
2655 symbol_c *IN_type_symbol = param_data_type; |
|
2656 last_type_symbol = param_data_type; |
|
2657 |
|
2658 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2659 { |
|
2660 |
|
2661 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
2662 s4o.print("("); |
|
2663 return_type_symbol->accept(*this); |
|
2664 s4o.print(")"); |
|
2665 IN_param_value->accept(*this); |
|
2666 return NULL; |
|
2667 |
|
2668 } |
|
2669 |
|
2670 ERROR; |
|
2671 } |
|
2672 |
|
2673 }/*function_lint_to_uint*/ |
|
2674 break; |
|
2675 |
|
2676 /**** |
|
2677 *LINT_TO_UDINT |
|
2678 */ |
|
2679 case function_lint_to_udint : |
|
2680 { |
|
2681 symbol_c *last_type_symbol = NULL; |
|
2682 |
|
2683 { |
|
2684 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2685 symbol_c *IN_param_value = &this->default_variable_name; |
|
2686 |
|
2687 symbol_c *IN_type_symbol = param_data_type; |
|
2688 last_type_symbol = param_data_type; |
|
2689 |
|
2690 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2691 { |
|
2692 |
|
2693 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
2694 s4o.print("("); |
|
2695 return_type_symbol->accept(*this); |
|
2696 s4o.print(")"); |
|
2697 IN_param_value->accept(*this); |
|
2698 return NULL; |
|
2699 |
|
2700 } |
|
2701 |
|
2702 ERROR; |
|
2703 } |
|
2704 |
|
2705 }/*function_lint_to_udint*/ |
|
2706 break; |
|
2707 |
|
2708 /**** |
|
2709 *LINT_TO_ULINT |
|
2710 */ |
|
2711 case function_lint_to_ulint : |
|
2712 { |
|
2713 symbol_c *last_type_symbol = NULL; |
|
2714 |
|
2715 { |
|
2716 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2717 symbol_c *IN_param_value = &this->default_variable_name; |
|
2718 |
|
2719 symbol_c *IN_type_symbol = param_data_type; |
|
2720 last_type_symbol = param_data_type; |
|
2721 |
|
2722 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2723 { |
|
2724 |
|
2725 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
2726 s4o.print("("); |
|
2727 return_type_symbol->accept(*this); |
|
2728 s4o.print(")"); |
|
2729 IN_param_value->accept(*this); |
|
2730 return NULL; |
|
2731 |
|
2732 } |
|
2733 |
|
2734 ERROR; |
|
2735 } |
|
2736 |
|
2737 }/*function_lint_to_ulint*/ |
|
2738 break; |
|
2739 |
|
2740 /**** |
|
2741 *LINT_TO_REAL |
|
2742 */ |
|
2743 case function_lint_to_real : |
|
2744 { |
|
2745 symbol_c *last_type_symbol = NULL; |
|
2746 |
|
2747 { |
|
2748 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2749 symbol_c *IN_param_value = &this->default_variable_name; |
|
2750 |
|
2751 symbol_c *IN_type_symbol = param_data_type; |
|
2752 last_type_symbol = param_data_type; |
|
2753 |
|
2754 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2755 { |
|
2756 |
|
2757 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
2758 s4o.print("("); |
|
2759 return_type_symbol->accept(*this); |
|
2760 s4o.print(")"); |
|
2761 IN_param_value->accept(*this); |
|
2762 return NULL; |
|
2763 |
|
2764 } |
|
2765 |
|
2766 ERROR; |
|
2767 } |
|
2768 |
|
2769 }/*function_lint_to_real*/ |
|
2770 break; |
|
2771 |
|
2772 /**** |
|
2773 *LINT_TO_LREAL |
|
2774 */ |
|
2775 case function_lint_to_lreal : |
|
2776 { |
|
2777 symbol_c *last_type_symbol = NULL; |
|
2778 |
|
2779 { |
|
2780 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2781 symbol_c *IN_param_value = &this->default_variable_name; |
|
2782 |
|
2783 symbol_c *IN_type_symbol = param_data_type; |
|
2784 last_type_symbol = param_data_type; |
|
2785 |
|
2786 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2787 { |
|
2788 |
|
2789 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
2790 s4o.print("("); |
|
2791 return_type_symbol->accept(*this); |
|
2792 s4o.print(")"); |
|
2793 IN_param_value->accept(*this); |
|
2794 return NULL; |
|
2795 |
|
2796 } |
|
2797 |
|
2798 ERROR; |
|
2799 } |
|
2800 |
|
2801 }/*function_lint_to_lreal*/ |
|
2802 break; |
|
2803 |
|
2804 /**** |
|
2805 *LINT_TO_TIME |
|
2806 */ |
|
2807 case function_lint_to_time : |
|
2808 { |
|
2809 symbol_c *last_type_symbol = NULL; |
|
2810 |
|
2811 { |
|
2812 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2813 symbol_c *IN_param_value = &this->default_variable_name; |
|
2814 |
|
2815 symbol_c *IN_type_symbol = param_data_type; |
|
2816 last_type_symbol = param_data_type; |
|
2817 |
|
2818 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2819 { |
|
2820 |
|
2821 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
2822 s4o.print("("); |
|
2823 return_type_symbol->accept(*this); |
|
2824 s4o.print(")__int_to_time("); |
|
2825 IN_param_value->accept(*this); |
|
2826 s4o.print(")"); |
|
2827 return NULL; |
|
2828 |
|
2829 } |
|
2830 |
|
2831 ERROR; |
|
2832 } |
|
2833 |
|
2834 }/*function_lint_to_time*/ |
|
2835 break; |
|
2836 |
|
2837 /**** |
|
2838 *LINT_TO_DATE |
|
2839 */ |
|
2840 case function_lint_to_date : |
|
2841 { |
|
2842 symbol_c *last_type_symbol = NULL; |
|
2843 |
|
2844 { |
|
2845 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2846 symbol_c *IN_param_value = &this->default_variable_name; |
|
2847 |
|
2848 symbol_c *IN_type_symbol = param_data_type; |
|
2849 last_type_symbol = param_data_type; |
|
2850 |
|
2851 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2852 { |
|
2853 |
|
2854 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
2855 s4o.print("("); |
|
2856 return_type_symbol->accept(*this); |
|
2857 s4o.print(")__int_to_time("); |
|
2858 IN_param_value->accept(*this); |
|
2859 s4o.print(")"); |
|
2860 return NULL; |
|
2861 |
|
2862 } |
|
2863 |
|
2864 ERROR; |
|
2865 } |
|
2866 |
|
2867 }/*function_lint_to_date*/ |
|
2868 break; |
|
2869 |
|
2870 /**** |
|
2871 *LINT_TO_TOD |
|
2872 */ |
|
2873 case function_lint_to_tod : |
|
2874 { |
|
2875 symbol_c *last_type_symbol = NULL; |
|
2876 |
|
2877 { |
|
2878 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2879 symbol_c *IN_param_value = &this->default_variable_name; |
|
2880 |
|
2881 symbol_c *IN_type_symbol = param_data_type; |
|
2882 last_type_symbol = param_data_type; |
|
2883 |
|
2884 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2885 { |
|
2886 |
|
2887 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
2888 s4o.print("("); |
|
2889 return_type_symbol->accept(*this); |
|
2890 s4o.print(")__int_to_time("); |
|
2891 IN_param_value->accept(*this); |
|
2892 s4o.print(")"); |
|
2893 return NULL; |
|
2894 |
|
2895 } |
|
2896 |
|
2897 ERROR; |
|
2898 } |
|
2899 |
|
2900 }/*function_lint_to_tod*/ |
|
2901 break; |
|
2902 |
|
2903 /**** |
|
2904 *LINT_TO_DT |
|
2905 */ |
|
2906 case function_lint_to_dt : |
|
2907 { |
|
2908 symbol_c *last_type_symbol = NULL; |
|
2909 |
|
2910 { |
|
2911 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2912 symbol_c *IN_param_value = &this->default_variable_name; |
|
2913 |
|
2914 symbol_c *IN_type_symbol = param_data_type; |
|
2915 last_type_symbol = param_data_type; |
|
2916 |
|
2917 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2918 { |
|
2919 |
|
2920 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
2921 s4o.print("("); |
|
2922 return_type_symbol->accept(*this); |
|
2923 s4o.print(")__int_to_time("); |
|
2924 IN_param_value->accept(*this); |
|
2925 s4o.print(")"); |
|
2926 return NULL; |
|
2927 |
|
2928 } |
|
2929 |
|
2930 ERROR; |
|
2931 } |
|
2932 |
|
2933 }/*function_lint_to_dt*/ |
|
2934 break; |
|
2935 |
|
2936 /**** |
|
2937 *LINT_TO_STRING |
|
2938 */ |
|
2939 case function_lint_to_string : |
|
2940 { |
|
2941 symbol_c *last_type_symbol = NULL; |
|
2942 |
|
2943 { |
|
2944 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2945 symbol_c *IN_param_value = &this->default_variable_name; |
|
2946 |
|
2947 symbol_c *IN_type_symbol = param_data_type; |
|
2948 last_type_symbol = param_data_type; |
|
2949 |
|
2950 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2951 { |
|
2952 |
|
2953 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
2954 s4o.print("("); |
|
2955 return_type_symbol->accept(*this); |
|
2956 s4o.print(")__sint_to_string("); |
|
2957 IN_param_value->accept(*this); |
|
2958 s4o.print(")"); |
|
2959 return NULL; |
|
2960 |
|
2961 } |
|
2962 |
|
2963 ERROR; |
|
2964 } |
|
2965 |
|
2966 }/*function_lint_to_string*/ |
|
2967 break; |
|
2968 |
|
2969 /**** |
|
2970 *LINT_TO_BYTE |
|
2971 */ |
|
2972 case function_lint_to_byte : |
|
2973 { |
|
2974 symbol_c *last_type_symbol = NULL; |
|
2975 |
|
2976 { |
|
2977 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
2978 symbol_c *IN_param_value = &this->default_variable_name; |
|
2979 |
|
2980 symbol_c *IN_type_symbol = param_data_type; |
|
2981 last_type_symbol = param_data_type; |
|
2982 |
|
2983 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
2984 { |
|
2985 |
|
2986 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
2987 s4o.print("("); |
|
2988 return_type_symbol->accept(*this); |
|
2989 s4o.print(")"); |
|
2990 IN_param_value->accept(*this); |
|
2991 return NULL; |
|
2992 |
|
2993 } |
|
2994 |
|
2995 ERROR; |
|
2996 } |
|
2997 |
|
2998 }/*function_lint_to_byte*/ |
|
2999 break; |
|
3000 |
|
3001 /**** |
|
3002 *LINT_TO_WORD |
|
3003 */ |
|
3004 case function_lint_to_word : |
|
3005 { |
|
3006 symbol_c *last_type_symbol = NULL; |
|
3007 |
|
3008 { |
|
3009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3010 symbol_c *IN_param_value = &this->default_variable_name; |
|
3011 |
|
3012 symbol_c *IN_type_symbol = param_data_type; |
|
3013 last_type_symbol = param_data_type; |
|
3014 |
|
3015 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
3016 { |
|
3017 |
|
3018 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
3019 s4o.print("("); |
|
3020 return_type_symbol->accept(*this); |
|
3021 s4o.print(")"); |
|
3022 IN_param_value->accept(*this); |
|
3023 return NULL; |
|
3024 |
|
3025 } |
|
3026 |
|
3027 ERROR; |
|
3028 } |
|
3029 |
|
3030 }/*function_lint_to_word*/ |
|
3031 break; |
|
3032 |
|
3033 /**** |
|
3034 *LINT_TO_DWORD |
|
3035 */ |
|
3036 case function_lint_to_dword : |
|
3037 { |
|
3038 symbol_c *last_type_symbol = NULL; |
|
3039 |
|
3040 { |
|
3041 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3042 symbol_c *IN_param_value = &this->default_variable_name; |
|
3043 |
|
3044 symbol_c *IN_type_symbol = param_data_type; |
|
3045 last_type_symbol = param_data_type; |
|
3046 |
|
3047 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
3048 { |
|
3049 |
|
3050 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
3051 s4o.print("("); |
|
3052 return_type_symbol->accept(*this); |
|
3053 s4o.print(")"); |
|
3054 IN_param_value->accept(*this); |
|
3055 return NULL; |
|
3056 |
|
3057 } |
|
3058 |
|
3059 ERROR; |
|
3060 } |
|
3061 |
|
3062 }/*function_lint_to_dword*/ |
|
3063 break; |
|
3064 |
|
3065 /**** |
|
3066 *LINT_TO_LWORD |
|
3067 */ |
|
3068 case function_lint_to_lword : |
|
3069 { |
|
3070 symbol_c *last_type_symbol = NULL; |
|
3071 |
|
3072 { |
|
3073 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3074 symbol_c *IN_param_value = &this->default_variable_name; |
|
3075 |
|
3076 symbol_c *IN_type_symbol = param_data_type; |
|
3077 last_type_symbol = param_data_type; |
|
3078 |
|
3079 if(search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
3080 { |
|
3081 |
|
3082 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
3083 s4o.print("("); |
|
3084 return_type_symbol->accept(*this); |
|
3085 s4o.print(")"); |
|
3086 IN_param_value->accept(*this); |
|
3087 return NULL; |
|
3088 |
|
3089 } |
|
3090 |
|
3091 ERROR; |
|
3092 } |
|
3093 |
|
3094 }/*function_lint_to_lword*/ |
|
3095 break; |
|
3096 |
|
3097 /**** |
|
3098 *USINT_TO_BOOL |
|
3099 */ |
|
3100 case function_usint_to_bool : |
|
3101 { |
|
3102 symbol_c *last_type_symbol = NULL; |
|
3103 |
|
3104 { |
|
3105 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3106 symbol_c *IN_param_value = &this->default_variable_name; |
|
3107 |
|
3108 symbol_c *IN_type_symbol = param_data_type; |
|
3109 last_type_symbol = param_data_type; |
|
3110 |
|
3111 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3112 { |
|
3113 |
|
3114 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
3115 s4o.print("("); |
|
3116 return_type_symbol->accept(*this); |
|
3117 s4o.print(")"); |
|
3118 IN_param_value->accept(*this); |
|
3119 return NULL; |
|
3120 |
|
3121 } |
|
3122 |
|
3123 ERROR; |
|
3124 } |
|
3125 |
|
3126 }/*function_usint_to_bool*/ |
|
3127 break; |
|
3128 |
|
3129 /**** |
|
3130 *USINT_TO_SINT |
|
3131 */ |
|
3132 case function_usint_to_sint : |
|
3133 { |
|
3134 symbol_c *last_type_symbol = NULL; |
|
3135 |
|
3136 { |
|
3137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3138 symbol_c *IN_param_value = &this->default_variable_name; |
|
3139 |
|
3140 symbol_c *IN_type_symbol = param_data_type; |
|
3141 last_type_symbol = param_data_type; |
|
3142 |
|
3143 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3144 { |
|
3145 |
|
3146 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
3147 s4o.print("("); |
|
3148 return_type_symbol->accept(*this); |
|
3149 s4o.print(")"); |
|
3150 IN_param_value->accept(*this); |
|
3151 return NULL; |
|
3152 |
|
3153 } |
|
3154 |
|
3155 ERROR; |
|
3156 } |
|
3157 |
|
3158 }/*function_usint_to_sint*/ |
|
3159 break; |
|
3160 |
|
3161 /**** |
|
3162 *USINT_TO_INT |
|
3163 */ |
|
3164 case function_usint_to_int : |
|
3165 { |
|
3166 symbol_c *last_type_symbol = NULL; |
|
3167 |
|
3168 { |
|
3169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3170 symbol_c *IN_param_value = &this->default_variable_name; |
|
3171 |
|
3172 symbol_c *IN_type_symbol = param_data_type; |
|
3173 last_type_symbol = param_data_type; |
|
3174 |
|
3175 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3176 { |
|
3177 |
|
3178 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
3179 s4o.print("("); |
|
3180 return_type_symbol->accept(*this); |
|
3181 s4o.print(")"); |
|
3182 IN_param_value->accept(*this); |
|
3183 return NULL; |
|
3184 |
|
3185 } |
|
3186 |
|
3187 ERROR; |
|
3188 } |
|
3189 |
|
3190 }/*function_usint_to_int*/ |
|
3191 break; |
|
3192 |
|
3193 /**** |
|
3194 *USINT_TO_DINT |
|
3195 */ |
|
3196 case function_usint_to_dint : |
|
3197 { |
|
3198 symbol_c *last_type_symbol = NULL; |
|
3199 |
|
3200 { |
|
3201 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3202 symbol_c *IN_param_value = &this->default_variable_name; |
|
3203 |
|
3204 symbol_c *IN_type_symbol = param_data_type; |
|
3205 last_type_symbol = param_data_type; |
|
3206 |
|
3207 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3208 { |
|
3209 |
|
3210 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
3211 s4o.print("("); |
|
3212 return_type_symbol->accept(*this); |
|
3213 s4o.print(")"); |
|
3214 IN_param_value->accept(*this); |
|
3215 return NULL; |
|
3216 |
|
3217 } |
|
3218 |
|
3219 ERROR; |
|
3220 } |
|
3221 |
|
3222 }/*function_usint_to_dint*/ |
|
3223 break; |
|
3224 |
|
3225 /**** |
|
3226 *USINT_TO_LINT |
|
3227 */ |
|
3228 case function_usint_to_lint : |
|
3229 { |
|
3230 symbol_c *last_type_symbol = NULL; |
|
3231 |
|
3232 { |
|
3233 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3234 symbol_c *IN_param_value = &this->default_variable_name; |
|
3235 |
|
3236 symbol_c *IN_type_symbol = param_data_type; |
|
3237 last_type_symbol = param_data_type; |
|
3238 |
|
3239 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3240 { |
|
3241 |
|
3242 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
3243 s4o.print("("); |
|
3244 return_type_symbol->accept(*this); |
|
3245 s4o.print(")"); |
|
3246 IN_param_value->accept(*this); |
|
3247 return NULL; |
|
3248 |
|
3249 } |
|
3250 |
|
3251 ERROR; |
|
3252 } |
|
3253 |
|
3254 }/*function_usint_to_lint*/ |
|
3255 break; |
|
3256 |
|
3257 /**** |
|
3258 *USINT_TO_UINT |
|
3259 */ |
|
3260 case function_usint_to_uint : |
|
3261 { |
|
3262 symbol_c *last_type_symbol = NULL; |
|
3263 |
|
3264 { |
|
3265 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3266 symbol_c *IN_param_value = &this->default_variable_name; |
|
3267 |
|
3268 symbol_c *IN_type_symbol = param_data_type; |
|
3269 last_type_symbol = param_data_type; |
|
3270 |
|
3271 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3272 { |
|
3273 |
|
3274 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
3275 s4o.print("("); |
|
3276 return_type_symbol->accept(*this); |
|
3277 s4o.print(")"); |
|
3278 IN_param_value->accept(*this); |
|
3279 return NULL; |
|
3280 |
|
3281 } |
|
3282 |
|
3283 ERROR; |
|
3284 } |
|
3285 |
|
3286 }/*function_usint_to_uint*/ |
|
3287 break; |
|
3288 |
|
3289 /**** |
|
3290 *USINT_TO_UDINT |
|
3291 */ |
|
3292 case function_usint_to_udint : |
|
3293 { |
|
3294 symbol_c *last_type_symbol = NULL; |
|
3295 |
|
3296 { |
|
3297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3298 symbol_c *IN_param_value = &this->default_variable_name; |
|
3299 |
|
3300 symbol_c *IN_type_symbol = param_data_type; |
|
3301 last_type_symbol = param_data_type; |
|
3302 |
|
3303 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3304 { |
|
3305 |
|
3306 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
3307 s4o.print("("); |
|
3308 return_type_symbol->accept(*this); |
|
3309 s4o.print(")"); |
|
3310 IN_param_value->accept(*this); |
|
3311 return NULL; |
|
3312 |
|
3313 } |
|
3314 |
|
3315 ERROR; |
|
3316 } |
|
3317 |
|
3318 }/*function_usint_to_udint*/ |
|
3319 break; |
|
3320 |
|
3321 /**** |
|
3322 *USINT_TO_ULINT |
|
3323 */ |
|
3324 case function_usint_to_ulint : |
|
3325 { |
|
3326 symbol_c *last_type_symbol = NULL; |
|
3327 |
|
3328 { |
|
3329 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3330 symbol_c *IN_param_value = &this->default_variable_name; |
|
3331 |
|
3332 symbol_c *IN_type_symbol = param_data_type; |
|
3333 last_type_symbol = param_data_type; |
|
3334 |
|
3335 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3336 { |
|
3337 |
|
3338 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
3339 s4o.print("("); |
|
3340 return_type_symbol->accept(*this); |
|
3341 s4o.print(")"); |
|
3342 IN_param_value->accept(*this); |
|
3343 return NULL; |
|
3344 |
|
3345 } |
|
3346 |
|
3347 ERROR; |
|
3348 } |
|
3349 |
|
3350 }/*function_usint_to_ulint*/ |
|
3351 break; |
|
3352 |
|
3353 /**** |
|
3354 *USINT_TO_REAL |
|
3355 */ |
|
3356 case function_usint_to_real : |
|
3357 { |
|
3358 symbol_c *last_type_symbol = NULL; |
|
3359 |
|
3360 { |
|
3361 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3362 symbol_c *IN_param_value = &this->default_variable_name; |
|
3363 |
|
3364 symbol_c *IN_type_symbol = param_data_type; |
|
3365 last_type_symbol = param_data_type; |
|
3366 |
|
3367 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3368 { |
|
3369 |
|
3370 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
3371 s4o.print("("); |
|
3372 return_type_symbol->accept(*this); |
|
3373 s4o.print(")"); |
|
3374 IN_param_value->accept(*this); |
|
3375 return NULL; |
|
3376 |
|
3377 } |
|
3378 |
|
3379 ERROR; |
|
3380 } |
|
3381 |
|
3382 }/*function_usint_to_real*/ |
|
3383 break; |
|
3384 |
|
3385 /**** |
|
3386 *USINT_TO_LREAL |
|
3387 */ |
|
3388 case function_usint_to_lreal : |
|
3389 { |
|
3390 symbol_c *last_type_symbol = NULL; |
|
3391 |
|
3392 { |
|
3393 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3394 symbol_c *IN_param_value = &this->default_variable_name; |
|
3395 |
|
3396 symbol_c *IN_type_symbol = param_data_type; |
|
3397 last_type_symbol = param_data_type; |
|
3398 |
|
3399 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3400 { |
|
3401 |
|
3402 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
3403 s4o.print("("); |
|
3404 return_type_symbol->accept(*this); |
|
3405 s4o.print(")"); |
|
3406 IN_param_value->accept(*this); |
|
3407 return NULL; |
|
3408 |
|
3409 } |
|
3410 |
|
3411 ERROR; |
|
3412 } |
|
3413 |
|
3414 }/*function_usint_to_lreal*/ |
|
3415 break; |
|
3416 |
|
3417 /**** |
|
3418 *USINT_TO_TIME |
|
3419 */ |
|
3420 case function_usint_to_time : |
|
3421 { |
|
3422 symbol_c *last_type_symbol = NULL; |
|
3423 |
|
3424 { |
|
3425 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3426 symbol_c *IN_param_value = &this->default_variable_name; |
|
3427 |
|
3428 symbol_c *IN_type_symbol = param_data_type; |
|
3429 last_type_symbol = param_data_type; |
|
3430 |
|
3431 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3432 { |
|
3433 |
|
3434 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
3435 s4o.print("("); |
|
3436 return_type_symbol->accept(*this); |
|
3437 s4o.print(")__int_to_time("); |
|
3438 IN_param_value->accept(*this); |
|
3439 s4o.print(")"); |
|
3440 return NULL; |
|
3441 |
|
3442 } |
|
3443 |
|
3444 ERROR; |
|
3445 } |
|
3446 |
|
3447 }/*function_usint_to_time*/ |
|
3448 break; |
|
3449 |
|
3450 /**** |
|
3451 *USINT_TO_DATE |
|
3452 */ |
|
3453 case function_usint_to_date : |
|
3454 { |
|
3455 symbol_c *last_type_symbol = NULL; |
|
3456 |
|
3457 { |
|
3458 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3459 symbol_c *IN_param_value = &this->default_variable_name; |
|
3460 |
|
3461 symbol_c *IN_type_symbol = param_data_type; |
|
3462 last_type_symbol = param_data_type; |
|
3463 |
|
3464 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3465 { |
|
3466 |
|
3467 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
3468 s4o.print("("); |
|
3469 return_type_symbol->accept(*this); |
|
3470 s4o.print(")__int_to_time("); |
|
3471 IN_param_value->accept(*this); |
|
3472 s4o.print(")"); |
|
3473 return NULL; |
|
3474 |
|
3475 } |
|
3476 |
|
3477 ERROR; |
|
3478 } |
|
3479 |
|
3480 }/*function_usint_to_date*/ |
|
3481 break; |
|
3482 |
|
3483 /**** |
|
3484 *USINT_TO_TOD |
|
3485 */ |
|
3486 case function_usint_to_tod : |
|
3487 { |
|
3488 symbol_c *last_type_symbol = NULL; |
|
3489 |
|
3490 { |
|
3491 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3492 symbol_c *IN_param_value = &this->default_variable_name; |
|
3493 |
|
3494 symbol_c *IN_type_symbol = param_data_type; |
|
3495 last_type_symbol = param_data_type; |
|
3496 |
|
3497 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3498 { |
|
3499 |
|
3500 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
3501 s4o.print("("); |
|
3502 return_type_symbol->accept(*this); |
|
3503 s4o.print(")__int_to_time("); |
|
3504 IN_param_value->accept(*this); |
|
3505 s4o.print(")"); |
|
3506 return NULL; |
|
3507 |
|
3508 } |
|
3509 |
|
3510 ERROR; |
|
3511 } |
|
3512 |
|
3513 }/*function_usint_to_tod*/ |
|
3514 break; |
|
3515 |
|
3516 /**** |
|
3517 *USINT_TO_DT |
|
3518 */ |
|
3519 case function_usint_to_dt : |
|
3520 { |
|
3521 symbol_c *last_type_symbol = NULL; |
|
3522 |
|
3523 { |
|
3524 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3525 symbol_c *IN_param_value = &this->default_variable_name; |
|
3526 |
|
3527 symbol_c *IN_type_symbol = param_data_type; |
|
3528 last_type_symbol = param_data_type; |
|
3529 |
|
3530 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3531 { |
|
3532 |
|
3533 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
3534 s4o.print("("); |
|
3535 return_type_symbol->accept(*this); |
|
3536 s4o.print(")__int_to_time("); |
|
3537 IN_param_value->accept(*this); |
|
3538 s4o.print(")"); |
|
3539 return NULL; |
|
3540 |
|
3541 } |
|
3542 |
|
3543 ERROR; |
|
3544 } |
|
3545 |
|
3546 }/*function_usint_to_dt*/ |
|
3547 break; |
|
3548 |
|
3549 /**** |
|
3550 *USINT_TO_STRING |
|
3551 */ |
|
3552 case function_usint_to_string : |
|
3553 { |
|
3554 symbol_c *last_type_symbol = NULL; |
|
3555 |
|
3556 { |
|
3557 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3558 symbol_c *IN_param_value = &this->default_variable_name; |
|
3559 |
|
3560 symbol_c *IN_type_symbol = param_data_type; |
|
3561 last_type_symbol = param_data_type; |
|
3562 |
|
3563 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3564 { |
|
3565 |
|
3566 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
3567 s4o.print("("); |
|
3568 return_type_symbol->accept(*this); |
|
3569 s4o.print(")__uint_to_string("); |
|
3570 IN_param_value->accept(*this); |
|
3571 s4o.print(")"); |
|
3572 return NULL; |
|
3573 |
|
3574 } |
|
3575 |
|
3576 ERROR; |
|
3577 } |
|
3578 |
|
3579 }/*function_usint_to_string*/ |
|
3580 break; |
|
3581 |
|
3582 /**** |
|
3583 *USINT_TO_BYTE |
|
3584 */ |
|
3585 case function_usint_to_byte : |
|
3586 { |
|
3587 symbol_c *last_type_symbol = NULL; |
|
3588 |
|
3589 { |
|
3590 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3591 symbol_c *IN_param_value = &this->default_variable_name; |
|
3592 |
|
3593 symbol_c *IN_type_symbol = param_data_type; |
|
3594 last_type_symbol = param_data_type; |
|
3595 |
|
3596 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3597 { |
|
3598 |
|
3599 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
3600 s4o.print("("); |
|
3601 return_type_symbol->accept(*this); |
|
3602 s4o.print(")"); |
|
3603 IN_param_value->accept(*this); |
|
3604 return NULL; |
|
3605 |
|
3606 } |
|
3607 |
|
3608 ERROR; |
|
3609 } |
|
3610 |
|
3611 }/*function_usint_to_byte*/ |
|
3612 break; |
|
3613 |
|
3614 /**** |
|
3615 *USINT_TO_WORD |
|
3616 */ |
|
3617 case function_usint_to_word : |
|
3618 { |
|
3619 symbol_c *last_type_symbol = NULL; |
|
3620 |
|
3621 { |
|
3622 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3623 symbol_c *IN_param_value = &this->default_variable_name; |
|
3624 |
|
3625 symbol_c *IN_type_symbol = param_data_type; |
|
3626 last_type_symbol = param_data_type; |
|
3627 |
|
3628 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3629 { |
|
3630 |
|
3631 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
3632 s4o.print("("); |
|
3633 return_type_symbol->accept(*this); |
|
3634 s4o.print(")"); |
|
3635 IN_param_value->accept(*this); |
|
3636 return NULL; |
|
3637 |
|
3638 } |
|
3639 |
|
3640 ERROR; |
|
3641 } |
|
3642 |
|
3643 }/*function_usint_to_word*/ |
|
3644 break; |
|
3645 |
|
3646 /**** |
|
3647 *USINT_TO_DWORD |
|
3648 */ |
|
3649 case function_usint_to_dword : |
|
3650 { |
|
3651 symbol_c *last_type_symbol = NULL; |
|
3652 |
|
3653 { |
|
3654 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3655 symbol_c *IN_param_value = &this->default_variable_name; |
|
3656 |
|
3657 symbol_c *IN_type_symbol = param_data_type; |
|
3658 last_type_symbol = param_data_type; |
|
3659 |
|
3660 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3661 { |
|
3662 |
|
3663 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
3664 s4o.print("("); |
|
3665 return_type_symbol->accept(*this); |
|
3666 s4o.print(")"); |
|
3667 IN_param_value->accept(*this); |
|
3668 return NULL; |
|
3669 |
|
3670 } |
|
3671 |
|
3672 ERROR; |
|
3673 } |
|
3674 |
|
3675 }/*function_usint_to_dword*/ |
|
3676 break; |
|
3677 |
|
3678 /**** |
|
3679 *USINT_TO_LWORD |
|
3680 */ |
|
3681 case function_usint_to_lword : |
|
3682 { |
|
3683 symbol_c *last_type_symbol = NULL; |
|
3684 |
|
3685 { |
|
3686 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3687 symbol_c *IN_param_value = &this->default_variable_name; |
|
3688 |
|
3689 symbol_c *IN_type_symbol = param_data_type; |
|
3690 last_type_symbol = param_data_type; |
|
3691 |
|
3692 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
3693 { |
|
3694 |
|
3695 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
3696 s4o.print("("); |
|
3697 return_type_symbol->accept(*this); |
|
3698 s4o.print(")"); |
|
3699 IN_param_value->accept(*this); |
|
3700 return NULL; |
|
3701 |
|
3702 } |
|
3703 |
|
3704 ERROR; |
|
3705 } |
|
3706 |
|
3707 }/*function_usint_to_lword*/ |
|
3708 break; |
|
3709 |
|
3710 /**** |
|
3711 *UINT_TO_BOOL |
|
3712 */ |
|
3713 case function_uint_to_bool : |
|
3714 { |
|
3715 symbol_c *last_type_symbol = NULL; |
|
3716 |
|
3717 { |
|
3718 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3719 symbol_c *IN_param_value = &this->default_variable_name; |
|
3720 |
|
3721 symbol_c *IN_type_symbol = param_data_type; |
|
3722 last_type_symbol = param_data_type; |
|
3723 |
|
3724 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3725 { |
|
3726 |
|
3727 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
3728 s4o.print("("); |
|
3729 return_type_symbol->accept(*this); |
|
3730 s4o.print(")"); |
|
3731 IN_param_value->accept(*this); |
|
3732 return NULL; |
|
3733 |
|
3734 } |
|
3735 |
|
3736 ERROR; |
|
3737 } |
|
3738 |
|
3739 }/*function_uint_to_bool*/ |
|
3740 break; |
|
3741 |
|
3742 /**** |
|
3743 *UINT_TO_SINT |
|
3744 */ |
|
3745 case function_uint_to_sint : |
|
3746 { |
|
3747 symbol_c *last_type_symbol = NULL; |
|
3748 |
|
3749 { |
|
3750 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3751 symbol_c *IN_param_value = &this->default_variable_name; |
|
3752 |
|
3753 symbol_c *IN_type_symbol = param_data_type; |
|
3754 last_type_symbol = param_data_type; |
|
3755 |
|
3756 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3757 { |
|
3758 |
|
3759 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
3760 s4o.print("("); |
|
3761 return_type_symbol->accept(*this); |
|
3762 s4o.print(")"); |
|
3763 IN_param_value->accept(*this); |
|
3764 return NULL; |
|
3765 |
|
3766 } |
|
3767 |
|
3768 ERROR; |
|
3769 } |
|
3770 |
|
3771 }/*function_uint_to_sint*/ |
|
3772 break; |
|
3773 |
|
3774 /**** |
|
3775 *UINT_TO_INT |
|
3776 */ |
|
3777 case function_uint_to_int : |
|
3778 { |
|
3779 symbol_c *last_type_symbol = NULL; |
|
3780 |
|
3781 { |
|
3782 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3783 symbol_c *IN_param_value = &this->default_variable_name; |
|
3784 |
|
3785 symbol_c *IN_type_symbol = param_data_type; |
|
3786 last_type_symbol = param_data_type; |
|
3787 |
|
3788 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3789 { |
|
3790 |
|
3791 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
3792 s4o.print("("); |
|
3793 return_type_symbol->accept(*this); |
|
3794 s4o.print(")"); |
|
3795 IN_param_value->accept(*this); |
|
3796 return NULL; |
|
3797 |
|
3798 } |
|
3799 |
|
3800 ERROR; |
|
3801 } |
|
3802 |
|
3803 }/*function_uint_to_int*/ |
|
3804 break; |
|
3805 |
|
3806 /**** |
|
3807 *UINT_TO_DINT |
|
3808 */ |
|
3809 case function_uint_to_dint : |
|
3810 { |
|
3811 symbol_c *last_type_symbol = NULL; |
|
3812 |
|
3813 { |
|
3814 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3815 symbol_c *IN_param_value = &this->default_variable_name; |
|
3816 |
|
3817 symbol_c *IN_type_symbol = param_data_type; |
|
3818 last_type_symbol = param_data_type; |
|
3819 |
|
3820 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3821 { |
|
3822 |
|
3823 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
3824 s4o.print("("); |
|
3825 return_type_symbol->accept(*this); |
|
3826 s4o.print(")"); |
|
3827 IN_param_value->accept(*this); |
|
3828 return NULL; |
|
3829 |
|
3830 } |
|
3831 |
|
3832 ERROR; |
|
3833 } |
|
3834 |
|
3835 }/*function_uint_to_dint*/ |
|
3836 break; |
|
3837 |
|
3838 /**** |
|
3839 *UINT_TO_LINT |
|
3840 */ |
|
3841 case function_uint_to_lint : |
|
3842 { |
|
3843 symbol_c *last_type_symbol = NULL; |
|
3844 |
|
3845 { |
|
3846 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3847 symbol_c *IN_param_value = &this->default_variable_name; |
|
3848 |
|
3849 symbol_c *IN_type_symbol = param_data_type; |
|
3850 last_type_symbol = param_data_type; |
|
3851 |
|
3852 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3853 { |
|
3854 |
|
3855 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
3856 s4o.print("("); |
|
3857 return_type_symbol->accept(*this); |
|
3858 s4o.print(")"); |
|
3859 IN_param_value->accept(*this); |
|
3860 return NULL; |
|
3861 |
|
3862 } |
|
3863 |
|
3864 ERROR; |
|
3865 } |
|
3866 |
|
3867 }/*function_uint_to_lint*/ |
|
3868 break; |
|
3869 |
|
3870 /**** |
|
3871 *UINT_TO_USINT |
|
3872 */ |
|
3873 case function_uint_to_usint : |
|
3874 { |
|
3875 symbol_c *last_type_symbol = NULL; |
|
3876 |
|
3877 { |
|
3878 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3879 symbol_c *IN_param_value = &this->default_variable_name; |
|
3880 |
|
3881 symbol_c *IN_type_symbol = param_data_type; |
|
3882 last_type_symbol = param_data_type; |
|
3883 |
|
3884 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3885 { |
|
3886 |
|
3887 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
3888 s4o.print("("); |
|
3889 return_type_symbol->accept(*this); |
|
3890 s4o.print(")"); |
|
3891 IN_param_value->accept(*this); |
|
3892 return NULL; |
|
3893 |
|
3894 } |
|
3895 |
|
3896 ERROR; |
|
3897 } |
|
3898 |
|
3899 }/*function_uint_to_usint*/ |
|
3900 break; |
|
3901 |
|
3902 /**** |
|
3903 *UINT_TO_UDINT |
|
3904 */ |
|
3905 case function_uint_to_udint : |
|
3906 { |
|
3907 symbol_c *last_type_symbol = NULL; |
|
3908 |
|
3909 { |
|
3910 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3911 symbol_c *IN_param_value = &this->default_variable_name; |
|
3912 |
|
3913 symbol_c *IN_type_symbol = param_data_type; |
|
3914 last_type_symbol = param_data_type; |
|
3915 |
|
3916 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3917 { |
|
3918 |
|
3919 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
3920 s4o.print("("); |
|
3921 return_type_symbol->accept(*this); |
|
3922 s4o.print(")"); |
|
3923 IN_param_value->accept(*this); |
|
3924 return NULL; |
|
3925 |
|
3926 } |
|
3927 |
|
3928 ERROR; |
|
3929 } |
|
3930 |
|
3931 }/*function_uint_to_udint*/ |
|
3932 break; |
|
3933 |
|
3934 /**** |
|
3935 *UINT_TO_ULINT |
|
3936 */ |
|
3937 case function_uint_to_ulint : |
|
3938 { |
|
3939 symbol_c *last_type_symbol = NULL; |
|
3940 |
|
3941 { |
|
3942 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3943 symbol_c *IN_param_value = &this->default_variable_name; |
|
3944 |
|
3945 symbol_c *IN_type_symbol = param_data_type; |
|
3946 last_type_symbol = param_data_type; |
|
3947 |
|
3948 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3949 { |
|
3950 |
|
3951 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
3952 s4o.print("("); |
|
3953 return_type_symbol->accept(*this); |
|
3954 s4o.print(")"); |
|
3955 IN_param_value->accept(*this); |
|
3956 return NULL; |
|
3957 |
|
3958 } |
|
3959 |
|
3960 ERROR; |
|
3961 } |
|
3962 |
|
3963 }/*function_uint_to_ulint*/ |
|
3964 break; |
|
3965 |
|
3966 /**** |
|
3967 *UINT_TO_REAL |
|
3968 */ |
|
3969 case function_uint_to_real : |
|
3970 { |
|
3971 symbol_c *last_type_symbol = NULL; |
|
3972 |
|
3973 { |
|
3974 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
3975 symbol_c *IN_param_value = &this->default_variable_name; |
|
3976 |
|
3977 symbol_c *IN_type_symbol = param_data_type; |
|
3978 last_type_symbol = param_data_type; |
|
3979 |
|
3980 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
3981 { |
|
3982 |
|
3983 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
3984 s4o.print("("); |
|
3985 return_type_symbol->accept(*this); |
|
3986 s4o.print(")"); |
|
3987 IN_param_value->accept(*this); |
|
3988 return NULL; |
|
3989 |
|
3990 } |
|
3991 |
|
3992 ERROR; |
|
3993 } |
|
3994 |
|
3995 }/*function_uint_to_real*/ |
|
3996 break; |
|
3997 |
|
3998 /**** |
|
3999 *UINT_TO_LREAL |
|
4000 */ |
|
4001 case function_uint_to_lreal : |
|
4002 { |
|
4003 symbol_c *last_type_symbol = NULL; |
|
4004 |
|
4005 { |
|
4006 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4007 symbol_c *IN_param_value = &this->default_variable_name; |
|
4008 |
|
4009 symbol_c *IN_type_symbol = param_data_type; |
|
4010 last_type_symbol = param_data_type; |
|
4011 |
|
4012 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4013 { |
|
4014 |
|
4015 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
4016 s4o.print("("); |
|
4017 return_type_symbol->accept(*this); |
|
4018 s4o.print(")"); |
|
4019 IN_param_value->accept(*this); |
|
4020 return NULL; |
|
4021 |
|
4022 } |
|
4023 |
|
4024 ERROR; |
|
4025 } |
|
4026 |
|
4027 }/*function_uint_to_lreal*/ |
|
4028 break; |
|
4029 |
|
4030 /**** |
|
4031 *UINT_TO_TIME |
|
4032 */ |
|
4033 case function_uint_to_time : |
|
4034 { |
|
4035 symbol_c *last_type_symbol = NULL; |
|
4036 |
|
4037 { |
|
4038 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4039 symbol_c *IN_param_value = &this->default_variable_name; |
|
4040 |
|
4041 symbol_c *IN_type_symbol = param_data_type; |
|
4042 last_type_symbol = param_data_type; |
|
4043 |
|
4044 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4045 { |
|
4046 |
|
4047 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
4048 s4o.print("("); |
|
4049 return_type_symbol->accept(*this); |
|
4050 s4o.print(")__int_to_time("); |
|
4051 IN_param_value->accept(*this); |
|
4052 s4o.print(")"); |
|
4053 return NULL; |
|
4054 |
|
4055 } |
|
4056 |
|
4057 ERROR; |
|
4058 } |
|
4059 |
|
4060 }/*function_uint_to_time*/ |
|
4061 break; |
|
4062 |
|
4063 /**** |
|
4064 *UINT_TO_DATE |
|
4065 */ |
|
4066 case function_uint_to_date : |
|
4067 { |
|
4068 symbol_c *last_type_symbol = NULL; |
|
4069 |
|
4070 { |
|
4071 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4072 symbol_c *IN_param_value = &this->default_variable_name; |
|
4073 |
|
4074 symbol_c *IN_type_symbol = param_data_type; |
|
4075 last_type_symbol = param_data_type; |
|
4076 |
|
4077 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4078 { |
|
4079 |
|
4080 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
4081 s4o.print("("); |
|
4082 return_type_symbol->accept(*this); |
|
4083 s4o.print(")__int_to_time("); |
|
4084 IN_param_value->accept(*this); |
|
4085 s4o.print(")"); |
|
4086 return NULL; |
|
4087 |
|
4088 } |
|
4089 |
|
4090 ERROR; |
|
4091 } |
|
4092 |
|
4093 }/*function_uint_to_date*/ |
|
4094 break; |
|
4095 |
|
4096 /**** |
|
4097 *UINT_TO_TOD |
|
4098 */ |
|
4099 case function_uint_to_tod : |
|
4100 { |
|
4101 symbol_c *last_type_symbol = NULL; |
|
4102 |
|
4103 { |
|
4104 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4105 symbol_c *IN_param_value = &this->default_variable_name; |
|
4106 |
|
4107 symbol_c *IN_type_symbol = param_data_type; |
|
4108 last_type_symbol = param_data_type; |
|
4109 |
|
4110 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4111 { |
|
4112 |
|
4113 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
4114 s4o.print("("); |
|
4115 return_type_symbol->accept(*this); |
|
4116 s4o.print(")__int_to_time("); |
|
4117 IN_param_value->accept(*this); |
|
4118 s4o.print(")"); |
|
4119 return NULL; |
|
4120 |
|
4121 } |
|
4122 |
|
4123 ERROR; |
|
4124 } |
|
4125 |
|
4126 }/*function_uint_to_tod*/ |
|
4127 break; |
|
4128 |
|
4129 /**** |
|
4130 *UINT_TO_DT |
|
4131 */ |
|
4132 case function_uint_to_dt : |
|
4133 { |
|
4134 symbol_c *last_type_symbol = NULL; |
|
4135 |
|
4136 { |
|
4137 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4138 symbol_c *IN_param_value = &this->default_variable_name; |
|
4139 |
|
4140 symbol_c *IN_type_symbol = param_data_type; |
|
4141 last_type_symbol = param_data_type; |
|
4142 |
|
4143 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4144 { |
|
4145 |
|
4146 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
4147 s4o.print("("); |
|
4148 return_type_symbol->accept(*this); |
|
4149 s4o.print(")__int_to_time("); |
|
4150 IN_param_value->accept(*this); |
|
4151 s4o.print(")"); |
|
4152 return NULL; |
|
4153 |
|
4154 } |
|
4155 |
|
4156 ERROR; |
|
4157 } |
|
4158 |
|
4159 }/*function_uint_to_dt*/ |
|
4160 break; |
|
4161 |
|
4162 /**** |
|
4163 *UINT_TO_STRING |
|
4164 */ |
|
4165 case function_uint_to_string : |
|
4166 { |
|
4167 symbol_c *last_type_symbol = NULL; |
|
4168 |
|
4169 { |
|
4170 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4171 symbol_c *IN_param_value = &this->default_variable_name; |
|
4172 |
|
4173 symbol_c *IN_type_symbol = param_data_type; |
|
4174 last_type_symbol = param_data_type; |
|
4175 |
|
4176 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4177 { |
|
4178 |
|
4179 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
4180 s4o.print("("); |
|
4181 return_type_symbol->accept(*this); |
|
4182 s4o.print(")__uint_to_string("); |
|
4183 IN_param_value->accept(*this); |
|
4184 s4o.print(")"); |
|
4185 return NULL; |
|
4186 |
|
4187 } |
|
4188 |
|
4189 ERROR; |
|
4190 } |
|
4191 |
|
4192 }/*function_uint_to_string*/ |
|
4193 break; |
|
4194 |
|
4195 /**** |
|
4196 *UINT_TO_BYTE |
|
4197 */ |
|
4198 case function_uint_to_byte : |
|
4199 { |
|
4200 symbol_c *last_type_symbol = NULL; |
|
4201 |
|
4202 { |
|
4203 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4204 symbol_c *IN_param_value = &this->default_variable_name; |
|
4205 |
|
4206 symbol_c *IN_type_symbol = param_data_type; |
|
4207 last_type_symbol = param_data_type; |
|
4208 |
|
4209 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4210 { |
|
4211 |
|
4212 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
4213 s4o.print("("); |
|
4214 return_type_symbol->accept(*this); |
|
4215 s4o.print(")"); |
|
4216 IN_param_value->accept(*this); |
|
4217 return NULL; |
|
4218 |
|
4219 } |
|
4220 |
|
4221 ERROR; |
|
4222 } |
|
4223 |
|
4224 }/*function_uint_to_byte*/ |
|
4225 break; |
|
4226 |
|
4227 /**** |
|
4228 *UINT_TO_WORD |
|
4229 */ |
|
4230 case function_uint_to_word : |
|
4231 { |
|
4232 symbol_c *last_type_symbol = NULL; |
|
4233 |
|
4234 { |
|
4235 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4236 symbol_c *IN_param_value = &this->default_variable_name; |
|
4237 |
|
4238 symbol_c *IN_type_symbol = param_data_type; |
|
4239 last_type_symbol = param_data_type; |
|
4240 |
|
4241 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4242 { |
|
4243 |
|
4244 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
4245 s4o.print("("); |
|
4246 return_type_symbol->accept(*this); |
|
4247 s4o.print(")"); |
|
4248 IN_param_value->accept(*this); |
|
4249 return NULL; |
|
4250 |
|
4251 } |
|
4252 |
|
4253 ERROR; |
|
4254 } |
|
4255 |
|
4256 }/*function_uint_to_word*/ |
|
4257 break; |
|
4258 |
|
4259 /**** |
|
4260 *UINT_TO_DWORD |
|
4261 */ |
|
4262 case function_uint_to_dword : |
|
4263 { |
|
4264 symbol_c *last_type_symbol = NULL; |
|
4265 |
|
4266 { |
|
4267 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4268 symbol_c *IN_param_value = &this->default_variable_name; |
|
4269 |
|
4270 symbol_c *IN_type_symbol = param_data_type; |
|
4271 last_type_symbol = param_data_type; |
|
4272 |
|
4273 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4274 { |
|
4275 |
|
4276 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
4277 s4o.print("("); |
|
4278 return_type_symbol->accept(*this); |
|
4279 s4o.print(")"); |
|
4280 IN_param_value->accept(*this); |
|
4281 return NULL; |
|
4282 |
|
4283 } |
|
4284 |
|
4285 ERROR; |
|
4286 } |
|
4287 |
|
4288 }/*function_uint_to_dword*/ |
|
4289 break; |
|
4290 |
|
4291 /**** |
|
4292 *UINT_TO_LWORD |
|
4293 */ |
|
4294 case function_uint_to_lword : |
|
4295 { |
|
4296 symbol_c *last_type_symbol = NULL; |
|
4297 |
|
4298 { |
|
4299 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4300 symbol_c *IN_param_value = &this->default_variable_name; |
|
4301 |
|
4302 symbol_c *IN_type_symbol = param_data_type; |
|
4303 last_type_symbol = param_data_type; |
|
4304 |
|
4305 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
4306 { |
|
4307 |
|
4308 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
4309 s4o.print("("); |
|
4310 return_type_symbol->accept(*this); |
|
4311 s4o.print(")"); |
|
4312 IN_param_value->accept(*this); |
|
4313 return NULL; |
|
4314 |
|
4315 } |
|
4316 |
|
4317 ERROR; |
|
4318 } |
|
4319 |
|
4320 }/*function_uint_to_lword*/ |
|
4321 break; |
|
4322 |
|
4323 /**** |
|
4324 *UDINT_TO_BOOL |
|
4325 */ |
|
4326 case function_udint_to_bool : |
|
4327 { |
|
4328 symbol_c *last_type_symbol = NULL; |
|
4329 |
|
4330 { |
|
4331 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4332 symbol_c *IN_param_value = &this->default_variable_name; |
|
4333 |
|
4334 symbol_c *IN_type_symbol = param_data_type; |
|
4335 last_type_symbol = param_data_type; |
|
4336 |
|
4337 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4338 { |
|
4339 |
|
4340 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
4341 s4o.print("("); |
|
4342 return_type_symbol->accept(*this); |
|
4343 s4o.print(")"); |
|
4344 IN_param_value->accept(*this); |
|
4345 return NULL; |
|
4346 |
|
4347 } |
|
4348 |
|
4349 ERROR; |
|
4350 } |
|
4351 |
|
4352 }/*function_udint_to_bool*/ |
|
4353 break; |
|
4354 |
|
4355 /**** |
|
4356 *UDINT_TO_SINT |
|
4357 */ |
|
4358 case function_udint_to_sint : |
|
4359 { |
|
4360 symbol_c *last_type_symbol = NULL; |
|
4361 |
|
4362 { |
|
4363 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4364 symbol_c *IN_param_value = &this->default_variable_name; |
|
4365 |
|
4366 symbol_c *IN_type_symbol = param_data_type; |
|
4367 last_type_symbol = param_data_type; |
|
4368 |
|
4369 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4370 { |
|
4371 |
|
4372 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
4373 s4o.print("("); |
|
4374 return_type_symbol->accept(*this); |
|
4375 s4o.print(")"); |
|
4376 IN_param_value->accept(*this); |
|
4377 return NULL; |
|
4378 |
|
4379 } |
|
4380 |
|
4381 ERROR; |
|
4382 } |
|
4383 |
|
4384 }/*function_udint_to_sint*/ |
|
4385 break; |
|
4386 |
|
4387 /**** |
|
4388 *UDINT_TO_INT |
|
4389 */ |
|
4390 case function_udint_to_int : |
|
4391 { |
|
4392 symbol_c *last_type_symbol = NULL; |
|
4393 |
|
4394 { |
|
4395 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4396 symbol_c *IN_param_value = &this->default_variable_name; |
|
4397 |
|
4398 symbol_c *IN_type_symbol = param_data_type; |
|
4399 last_type_symbol = param_data_type; |
|
4400 |
|
4401 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4402 { |
|
4403 |
|
4404 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
4405 s4o.print("("); |
|
4406 return_type_symbol->accept(*this); |
|
4407 s4o.print(")"); |
|
4408 IN_param_value->accept(*this); |
|
4409 return NULL; |
|
4410 |
|
4411 } |
|
4412 |
|
4413 ERROR; |
|
4414 } |
|
4415 |
|
4416 }/*function_udint_to_int*/ |
|
4417 break; |
|
4418 |
|
4419 /**** |
|
4420 *UDINT_TO_DINT |
|
4421 */ |
|
4422 case function_udint_to_dint : |
|
4423 { |
|
4424 symbol_c *last_type_symbol = NULL; |
|
4425 |
|
4426 { |
|
4427 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4428 symbol_c *IN_param_value = &this->default_variable_name; |
|
4429 |
|
4430 symbol_c *IN_type_symbol = param_data_type; |
|
4431 last_type_symbol = param_data_type; |
|
4432 |
|
4433 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4434 { |
|
4435 |
|
4436 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
4437 s4o.print("("); |
|
4438 return_type_symbol->accept(*this); |
|
4439 s4o.print(")"); |
|
4440 IN_param_value->accept(*this); |
|
4441 return NULL; |
|
4442 |
|
4443 } |
|
4444 |
|
4445 ERROR; |
|
4446 } |
|
4447 |
|
4448 }/*function_udint_to_dint*/ |
|
4449 break; |
|
4450 |
|
4451 /**** |
|
4452 *UDINT_TO_LINT |
|
4453 */ |
|
4454 case function_udint_to_lint : |
|
4455 { |
|
4456 symbol_c *last_type_symbol = NULL; |
|
4457 |
|
4458 { |
|
4459 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4460 symbol_c *IN_param_value = &this->default_variable_name; |
|
4461 |
|
4462 symbol_c *IN_type_symbol = param_data_type; |
|
4463 last_type_symbol = param_data_type; |
|
4464 |
|
4465 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4466 { |
|
4467 |
|
4468 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
4469 s4o.print("("); |
|
4470 return_type_symbol->accept(*this); |
|
4471 s4o.print(")"); |
|
4472 IN_param_value->accept(*this); |
|
4473 return NULL; |
|
4474 |
|
4475 } |
|
4476 |
|
4477 ERROR; |
|
4478 } |
|
4479 |
|
4480 }/*function_udint_to_lint*/ |
|
4481 break; |
|
4482 |
|
4483 /**** |
|
4484 *UDINT_TO_USINT |
|
4485 */ |
|
4486 case function_udint_to_usint : |
|
4487 { |
|
4488 symbol_c *last_type_symbol = NULL; |
|
4489 |
|
4490 { |
|
4491 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4492 symbol_c *IN_param_value = &this->default_variable_name; |
|
4493 |
|
4494 symbol_c *IN_type_symbol = param_data_type; |
|
4495 last_type_symbol = param_data_type; |
|
4496 |
|
4497 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4498 { |
|
4499 |
|
4500 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
4501 s4o.print("("); |
|
4502 return_type_symbol->accept(*this); |
|
4503 s4o.print(")"); |
|
4504 IN_param_value->accept(*this); |
|
4505 return NULL; |
|
4506 |
|
4507 } |
|
4508 |
|
4509 ERROR; |
|
4510 } |
|
4511 |
|
4512 }/*function_udint_to_usint*/ |
|
4513 break; |
|
4514 |
|
4515 /**** |
|
4516 *UDINT_TO_UINT |
|
4517 */ |
|
4518 case function_udint_to_uint : |
|
4519 { |
|
4520 symbol_c *last_type_symbol = NULL; |
|
4521 |
|
4522 { |
|
4523 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4524 symbol_c *IN_param_value = &this->default_variable_name; |
|
4525 |
|
4526 symbol_c *IN_type_symbol = param_data_type; |
|
4527 last_type_symbol = param_data_type; |
|
4528 |
|
4529 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4530 { |
|
4531 |
|
4532 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
4533 s4o.print("("); |
|
4534 return_type_symbol->accept(*this); |
|
4535 s4o.print(")"); |
|
4536 IN_param_value->accept(*this); |
|
4537 return NULL; |
|
4538 |
|
4539 } |
|
4540 |
|
4541 ERROR; |
|
4542 } |
|
4543 |
|
4544 }/*function_udint_to_uint*/ |
|
4545 break; |
|
4546 |
|
4547 /**** |
|
4548 *UDINT_TO_ULINT |
|
4549 */ |
|
4550 case function_udint_to_ulint : |
|
4551 { |
|
4552 symbol_c *last_type_symbol = NULL; |
|
4553 |
|
4554 { |
|
4555 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4556 symbol_c *IN_param_value = &this->default_variable_name; |
|
4557 |
|
4558 symbol_c *IN_type_symbol = param_data_type; |
|
4559 last_type_symbol = param_data_type; |
|
4560 |
|
4561 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4562 { |
|
4563 |
|
4564 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
4565 s4o.print("("); |
|
4566 return_type_symbol->accept(*this); |
|
4567 s4o.print(")"); |
|
4568 IN_param_value->accept(*this); |
|
4569 return NULL; |
|
4570 |
|
4571 } |
|
4572 |
|
4573 ERROR; |
|
4574 } |
|
4575 |
|
4576 }/*function_udint_to_ulint*/ |
|
4577 break; |
|
4578 |
|
4579 /**** |
|
4580 *UDINT_TO_REAL |
|
4581 */ |
|
4582 case function_udint_to_real : |
|
4583 { |
|
4584 symbol_c *last_type_symbol = NULL; |
|
4585 |
|
4586 { |
|
4587 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4588 symbol_c *IN_param_value = &this->default_variable_name; |
|
4589 |
|
4590 symbol_c *IN_type_symbol = param_data_type; |
|
4591 last_type_symbol = param_data_type; |
|
4592 |
|
4593 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4594 { |
|
4595 |
|
4596 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
4597 s4o.print("("); |
|
4598 return_type_symbol->accept(*this); |
|
4599 s4o.print(")"); |
|
4600 IN_param_value->accept(*this); |
|
4601 return NULL; |
|
4602 |
|
4603 } |
|
4604 |
|
4605 ERROR; |
|
4606 } |
|
4607 |
|
4608 }/*function_udint_to_real*/ |
|
4609 break; |
|
4610 |
|
4611 /**** |
|
4612 *UDINT_TO_LREAL |
|
4613 */ |
|
4614 case function_udint_to_lreal : |
|
4615 { |
|
4616 symbol_c *last_type_symbol = NULL; |
|
4617 |
|
4618 { |
|
4619 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4620 symbol_c *IN_param_value = &this->default_variable_name; |
|
4621 |
|
4622 symbol_c *IN_type_symbol = param_data_type; |
|
4623 last_type_symbol = param_data_type; |
|
4624 |
|
4625 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4626 { |
|
4627 |
|
4628 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
4629 s4o.print("("); |
|
4630 return_type_symbol->accept(*this); |
|
4631 s4o.print(")"); |
|
4632 IN_param_value->accept(*this); |
|
4633 return NULL; |
|
4634 |
|
4635 } |
|
4636 |
|
4637 ERROR; |
|
4638 } |
|
4639 |
|
4640 }/*function_udint_to_lreal*/ |
|
4641 break; |
|
4642 |
|
4643 /**** |
|
4644 *UDINT_TO_TIME |
|
4645 */ |
|
4646 case function_udint_to_time : |
|
4647 { |
|
4648 symbol_c *last_type_symbol = NULL; |
|
4649 |
|
4650 { |
|
4651 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4652 symbol_c *IN_param_value = &this->default_variable_name; |
|
4653 |
|
4654 symbol_c *IN_type_symbol = param_data_type; |
|
4655 last_type_symbol = param_data_type; |
|
4656 |
|
4657 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4658 { |
|
4659 |
|
4660 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
4661 s4o.print("("); |
|
4662 return_type_symbol->accept(*this); |
|
4663 s4o.print(")__int_to_time("); |
|
4664 IN_param_value->accept(*this); |
|
4665 s4o.print(")"); |
|
4666 return NULL; |
|
4667 |
|
4668 } |
|
4669 |
|
4670 ERROR; |
|
4671 } |
|
4672 |
|
4673 }/*function_udint_to_time*/ |
|
4674 break; |
|
4675 |
|
4676 /**** |
|
4677 *UDINT_TO_DATE |
|
4678 */ |
|
4679 case function_udint_to_date : |
|
4680 { |
|
4681 symbol_c *last_type_symbol = NULL; |
|
4682 |
|
4683 { |
|
4684 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4685 symbol_c *IN_param_value = &this->default_variable_name; |
|
4686 |
|
4687 symbol_c *IN_type_symbol = param_data_type; |
|
4688 last_type_symbol = param_data_type; |
|
4689 |
|
4690 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4691 { |
|
4692 |
|
4693 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
4694 s4o.print("("); |
|
4695 return_type_symbol->accept(*this); |
|
4696 s4o.print(")__int_to_time("); |
|
4697 IN_param_value->accept(*this); |
|
4698 s4o.print(")"); |
|
4699 return NULL; |
|
4700 |
|
4701 } |
|
4702 |
|
4703 ERROR; |
|
4704 } |
|
4705 |
|
4706 }/*function_udint_to_date*/ |
|
4707 break; |
|
4708 |
|
4709 /**** |
|
4710 *UDINT_TO_TOD |
|
4711 */ |
|
4712 case function_udint_to_tod : |
|
4713 { |
|
4714 symbol_c *last_type_symbol = NULL; |
|
4715 |
|
4716 { |
|
4717 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4718 symbol_c *IN_param_value = &this->default_variable_name; |
|
4719 |
|
4720 symbol_c *IN_type_symbol = param_data_type; |
|
4721 last_type_symbol = param_data_type; |
|
4722 |
|
4723 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4724 { |
|
4725 |
|
4726 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
4727 s4o.print("("); |
|
4728 return_type_symbol->accept(*this); |
|
4729 s4o.print(")__int_to_time("); |
|
4730 IN_param_value->accept(*this); |
|
4731 s4o.print(")"); |
|
4732 return NULL; |
|
4733 |
|
4734 } |
|
4735 |
|
4736 ERROR; |
|
4737 } |
|
4738 |
|
4739 }/*function_udint_to_tod*/ |
|
4740 break; |
|
4741 |
|
4742 /**** |
|
4743 *UDINT_TO_DT |
|
4744 */ |
|
4745 case function_udint_to_dt : |
|
4746 { |
|
4747 symbol_c *last_type_symbol = NULL; |
|
4748 |
|
4749 { |
|
4750 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4751 symbol_c *IN_param_value = &this->default_variable_name; |
|
4752 |
|
4753 symbol_c *IN_type_symbol = param_data_type; |
|
4754 last_type_symbol = param_data_type; |
|
4755 |
|
4756 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4757 { |
|
4758 |
|
4759 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
4760 s4o.print("("); |
|
4761 return_type_symbol->accept(*this); |
|
4762 s4o.print(")__int_to_time("); |
|
4763 IN_param_value->accept(*this); |
|
4764 s4o.print(")"); |
|
4765 return NULL; |
|
4766 |
|
4767 } |
|
4768 |
|
4769 ERROR; |
|
4770 } |
|
4771 |
|
4772 }/*function_udint_to_dt*/ |
|
4773 break; |
|
4774 |
|
4775 /**** |
|
4776 *UDINT_TO_STRING |
|
4777 */ |
|
4778 case function_udint_to_string : |
|
4779 { |
|
4780 symbol_c *last_type_symbol = NULL; |
|
4781 |
|
4782 { |
|
4783 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4784 symbol_c *IN_param_value = &this->default_variable_name; |
|
4785 |
|
4786 symbol_c *IN_type_symbol = param_data_type; |
|
4787 last_type_symbol = param_data_type; |
|
4788 |
|
4789 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4790 { |
|
4791 |
|
4792 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
4793 s4o.print("("); |
|
4794 return_type_symbol->accept(*this); |
|
4795 s4o.print(")__uint_to_string("); |
|
4796 IN_param_value->accept(*this); |
|
4797 s4o.print(")"); |
|
4798 return NULL; |
|
4799 |
|
4800 } |
|
4801 |
|
4802 ERROR; |
|
4803 } |
|
4804 |
|
4805 }/*function_udint_to_string*/ |
|
4806 break; |
|
4807 |
|
4808 /**** |
|
4809 *UDINT_TO_BYTE |
|
4810 */ |
|
4811 case function_udint_to_byte : |
|
4812 { |
|
4813 symbol_c *last_type_symbol = NULL; |
|
4814 |
|
4815 { |
|
4816 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4817 symbol_c *IN_param_value = &this->default_variable_name; |
|
4818 |
|
4819 symbol_c *IN_type_symbol = param_data_type; |
|
4820 last_type_symbol = param_data_type; |
|
4821 |
|
4822 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4823 { |
|
4824 |
|
4825 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
4826 s4o.print("("); |
|
4827 return_type_symbol->accept(*this); |
|
4828 s4o.print(")"); |
|
4829 IN_param_value->accept(*this); |
|
4830 return NULL; |
|
4831 |
|
4832 } |
|
4833 |
|
4834 ERROR; |
|
4835 } |
|
4836 |
|
4837 }/*function_udint_to_byte*/ |
|
4838 break; |
|
4839 |
|
4840 /**** |
|
4841 *UDINT_TO_WORD |
|
4842 */ |
|
4843 case function_udint_to_word : |
|
4844 { |
|
4845 symbol_c *last_type_symbol = NULL; |
|
4846 |
|
4847 { |
|
4848 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4849 symbol_c *IN_param_value = &this->default_variable_name; |
|
4850 |
|
4851 symbol_c *IN_type_symbol = param_data_type; |
|
4852 last_type_symbol = param_data_type; |
|
4853 |
|
4854 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4855 { |
|
4856 |
|
4857 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
4858 s4o.print("("); |
|
4859 return_type_symbol->accept(*this); |
|
4860 s4o.print(")"); |
|
4861 IN_param_value->accept(*this); |
|
4862 return NULL; |
|
4863 |
|
4864 } |
|
4865 |
|
4866 ERROR; |
|
4867 } |
|
4868 |
|
4869 }/*function_udint_to_word*/ |
|
4870 break; |
|
4871 |
|
4872 /**** |
|
4873 *UDINT_TO_DWORD |
|
4874 */ |
|
4875 case function_udint_to_dword : |
|
4876 { |
|
4877 symbol_c *last_type_symbol = NULL; |
|
4878 |
|
4879 { |
|
4880 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4881 symbol_c *IN_param_value = &this->default_variable_name; |
|
4882 |
|
4883 symbol_c *IN_type_symbol = param_data_type; |
|
4884 last_type_symbol = param_data_type; |
|
4885 |
|
4886 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4887 { |
|
4888 |
|
4889 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
4890 s4o.print("("); |
|
4891 return_type_symbol->accept(*this); |
|
4892 s4o.print(")"); |
|
4893 IN_param_value->accept(*this); |
|
4894 return NULL; |
|
4895 |
|
4896 } |
|
4897 |
|
4898 ERROR; |
|
4899 } |
|
4900 |
|
4901 }/*function_udint_to_dword*/ |
|
4902 break; |
|
4903 |
|
4904 /**** |
|
4905 *UDINT_TO_LWORD |
|
4906 */ |
|
4907 case function_udint_to_lword : |
|
4908 { |
|
4909 symbol_c *last_type_symbol = NULL; |
|
4910 |
|
4911 { |
|
4912 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4913 symbol_c *IN_param_value = &this->default_variable_name; |
|
4914 |
|
4915 symbol_c *IN_type_symbol = param_data_type; |
|
4916 last_type_symbol = param_data_type; |
|
4917 |
|
4918 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
4919 { |
|
4920 |
|
4921 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
4922 s4o.print("("); |
|
4923 return_type_symbol->accept(*this); |
|
4924 s4o.print(")"); |
|
4925 IN_param_value->accept(*this); |
|
4926 return NULL; |
|
4927 |
|
4928 } |
|
4929 |
|
4930 ERROR; |
|
4931 } |
|
4932 |
|
4933 }/*function_udint_to_lword*/ |
|
4934 break; |
|
4935 |
|
4936 /**** |
|
4937 *ULINT_TO_BOOL |
|
4938 */ |
|
4939 case function_ulint_to_bool : |
|
4940 { |
|
4941 symbol_c *last_type_symbol = NULL; |
|
4942 |
|
4943 { |
|
4944 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4945 symbol_c *IN_param_value = &this->default_variable_name; |
|
4946 |
|
4947 symbol_c *IN_type_symbol = param_data_type; |
|
4948 last_type_symbol = param_data_type; |
|
4949 |
|
4950 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
4951 { |
|
4952 |
|
4953 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
4954 s4o.print("("); |
|
4955 return_type_symbol->accept(*this); |
|
4956 s4o.print(")"); |
|
4957 IN_param_value->accept(*this); |
|
4958 return NULL; |
|
4959 |
|
4960 } |
|
4961 |
|
4962 ERROR; |
|
4963 } |
|
4964 |
|
4965 }/*function_ulint_to_bool*/ |
|
4966 break; |
|
4967 |
|
4968 /**** |
|
4969 *ULINT_TO_SINT |
|
4970 */ |
|
4971 case function_ulint_to_sint : |
|
4972 { |
|
4973 symbol_c *last_type_symbol = NULL; |
|
4974 |
|
4975 { |
|
4976 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
4977 symbol_c *IN_param_value = &this->default_variable_name; |
|
4978 |
|
4979 symbol_c *IN_type_symbol = param_data_type; |
|
4980 last_type_symbol = param_data_type; |
|
4981 |
|
4982 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
4983 { |
|
4984 |
|
4985 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
4986 s4o.print("("); |
|
4987 return_type_symbol->accept(*this); |
|
4988 s4o.print(")"); |
|
4989 IN_param_value->accept(*this); |
|
4990 return NULL; |
|
4991 |
|
4992 } |
|
4993 |
|
4994 ERROR; |
|
4995 } |
|
4996 |
|
4997 }/*function_ulint_to_sint*/ |
|
4998 break; |
|
4999 |
|
5000 /**** |
|
5001 *ULINT_TO_INT |
|
5002 */ |
|
5003 case function_ulint_to_int : |
|
5004 { |
|
5005 symbol_c *last_type_symbol = NULL; |
|
5006 |
|
5007 { |
|
5008 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5009 symbol_c *IN_param_value = &this->default_variable_name; |
|
5010 |
|
5011 symbol_c *IN_type_symbol = param_data_type; |
|
5012 last_type_symbol = param_data_type; |
|
5013 |
|
5014 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5015 { |
|
5016 |
|
5017 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
5018 s4o.print("("); |
|
5019 return_type_symbol->accept(*this); |
|
5020 s4o.print(")"); |
|
5021 IN_param_value->accept(*this); |
|
5022 return NULL; |
|
5023 |
|
5024 } |
|
5025 |
|
5026 ERROR; |
|
5027 } |
|
5028 |
|
5029 }/*function_ulint_to_int*/ |
|
5030 break; |
|
5031 |
|
5032 /**** |
|
5033 *ULINT_TO_DINT |
|
5034 */ |
|
5035 case function_ulint_to_dint : |
|
5036 { |
|
5037 symbol_c *last_type_symbol = NULL; |
|
5038 |
|
5039 { |
|
5040 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5041 symbol_c *IN_param_value = &this->default_variable_name; |
|
5042 |
|
5043 symbol_c *IN_type_symbol = param_data_type; |
|
5044 last_type_symbol = param_data_type; |
|
5045 |
|
5046 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5047 { |
|
5048 |
|
5049 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
5050 s4o.print("("); |
|
5051 return_type_symbol->accept(*this); |
|
5052 s4o.print(")"); |
|
5053 IN_param_value->accept(*this); |
|
5054 return NULL; |
|
5055 |
|
5056 } |
|
5057 |
|
5058 ERROR; |
|
5059 } |
|
5060 |
|
5061 }/*function_ulint_to_dint*/ |
|
5062 break; |
|
5063 |
|
5064 /**** |
|
5065 *ULINT_TO_LINT |
|
5066 */ |
|
5067 case function_ulint_to_lint : |
|
5068 { |
|
5069 symbol_c *last_type_symbol = NULL; |
|
5070 |
|
5071 { |
|
5072 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5073 symbol_c *IN_param_value = &this->default_variable_name; |
|
5074 |
|
5075 symbol_c *IN_type_symbol = param_data_type; |
|
5076 last_type_symbol = param_data_type; |
|
5077 |
|
5078 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5079 { |
|
5080 |
|
5081 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
5082 s4o.print("("); |
|
5083 return_type_symbol->accept(*this); |
|
5084 s4o.print(")"); |
|
5085 IN_param_value->accept(*this); |
|
5086 return NULL; |
|
5087 |
|
5088 } |
|
5089 |
|
5090 ERROR; |
|
5091 } |
|
5092 |
|
5093 }/*function_ulint_to_lint*/ |
|
5094 break; |
|
5095 |
|
5096 /**** |
|
5097 *ULINT_TO_USINT |
|
5098 */ |
|
5099 case function_ulint_to_usint : |
|
5100 { |
|
5101 symbol_c *last_type_symbol = NULL; |
|
5102 |
|
5103 { |
|
5104 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5105 symbol_c *IN_param_value = &this->default_variable_name; |
|
5106 |
|
5107 symbol_c *IN_type_symbol = param_data_type; |
|
5108 last_type_symbol = param_data_type; |
|
5109 |
|
5110 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5111 { |
|
5112 |
|
5113 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
5114 s4o.print("("); |
|
5115 return_type_symbol->accept(*this); |
|
5116 s4o.print(")"); |
|
5117 IN_param_value->accept(*this); |
|
5118 return NULL; |
|
5119 |
|
5120 } |
|
5121 |
|
5122 ERROR; |
|
5123 } |
|
5124 |
|
5125 }/*function_ulint_to_usint*/ |
|
5126 break; |
|
5127 |
|
5128 /**** |
|
5129 *ULINT_TO_UINT |
|
5130 */ |
|
5131 case function_ulint_to_uint : |
|
5132 { |
|
5133 symbol_c *last_type_symbol = NULL; |
|
5134 |
|
5135 { |
|
5136 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5137 symbol_c *IN_param_value = &this->default_variable_name; |
|
5138 |
|
5139 symbol_c *IN_type_symbol = param_data_type; |
|
5140 last_type_symbol = param_data_type; |
|
5141 |
|
5142 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5143 { |
|
5144 |
|
5145 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
5146 s4o.print("("); |
|
5147 return_type_symbol->accept(*this); |
|
5148 s4o.print(")"); |
|
5149 IN_param_value->accept(*this); |
|
5150 return NULL; |
|
5151 |
|
5152 } |
|
5153 |
|
5154 ERROR; |
|
5155 } |
|
5156 |
|
5157 }/*function_ulint_to_uint*/ |
|
5158 break; |
|
5159 |
|
5160 /**** |
|
5161 *ULINT_TO_UDINT |
|
5162 */ |
|
5163 case function_ulint_to_udint : |
|
5164 { |
|
5165 symbol_c *last_type_symbol = NULL; |
|
5166 |
|
5167 { |
|
5168 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5169 symbol_c *IN_param_value = &this->default_variable_name; |
|
5170 |
|
5171 symbol_c *IN_type_symbol = param_data_type; |
|
5172 last_type_symbol = param_data_type; |
|
5173 |
|
5174 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5175 { |
|
5176 |
|
5177 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
5178 s4o.print("("); |
|
5179 return_type_symbol->accept(*this); |
|
5180 s4o.print(")"); |
|
5181 IN_param_value->accept(*this); |
|
5182 return NULL; |
|
5183 |
|
5184 } |
|
5185 |
|
5186 ERROR; |
|
5187 } |
|
5188 |
|
5189 }/*function_ulint_to_udint*/ |
|
5190 break; |
|
5191 |
|
5192 /**** |
|
5193 *ULINT_TO_REAL |
|
5194 */ |
|
5195 case function_ulint_to_real : |
|
5196 { |
|
5197 symbol_c *last_type_symbol = NULL; |
|
5198 |
|
5199 { |
|
5200 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5201 symbol_c *IN_param_value = &this->default_variable_name; |
|
5202 |
|
5203 symbol_c *IN_type_symbol = param_data_type; |
|
5204 last_type_symbol = param_data_type; |
|
5205 |
|
5206 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5207 { |
|
5208 |
|
5209 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
5210 s4o.print("("); |
|
5211 return_type_symbol->accept(*this); |
|
5212 s4o.print(")"); |
|
5213 IN_param_value->accept(*this); |
|
5214 return NULL; |
|
5215 |
|
5216 } |
|
5217 |
|
5218 ERROR; |
|
5219 } |
|
5220 |
|
5221 }/*function_ulint_to_real*/ |
|
5222 break; |
|
5223 |
|
5224 /**** |
|
5225 *ULINT_TO_LREAL |
|
5226 */ |
|
5227 case function_ulint_to_lreal : |
|
5228 { |
|
5229 symbol_c *last_type_symbol = NULL; |
|
5230 |
|
5231 { |
|
5232 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5233 symbol_c *IN_param_value = &this->default_variable_name; |
|
5234 |
|
5235 symbol_c *IN_type_symbol = param_data_type; |
|
5236 last_type_symbol = param_data_type; |
|
5237 |
|
5238 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5239 { |
|
5240 |
|
5241 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
5242 s4o.print("("); |
|
5243 return_type_symbol->accept(*this); |
|
5244 s4o.print(")"); |
|
5245 IN_param_value->accept(*this); |
|
5246 return NULL; |
|
5247 |
|
5248 } |
|
5249 |
|
5250 ERROR; |
|
5251 } |
|
5252 |
|
5253 }/*function_ulint_to_lreal*/ |
|
5254 break; |
|
5255 |
|
5256 /**** |
|
5257 *ULINT_TO_TIME |
|
5258 */ |
|
5259 case function_ulint_to_time : |
|
5260 { |
|
5261 symbol_c *last_type_symbol = NULL; |
|
5262 |
|
5263 { |
|
5264 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5265 symbol_c *IN_param_value = &this->default_variable_name; |
|
5266 |
|
5267 symbol_c *IN_type_symbol = param_data_type; |
|
5268 last_type_symbol = param_data_type; |
|
5269 |
|
5270 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5271 { |
|
5272 |
|
5273 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
5274 s4o.print("("); |
|
5275 return_type_symbol->accept(*this); |
|
5276 s4o.print(")__int_to_time("); |
|
5277 IN_param_value->accept(*this); |
|
5278 s4o.print(")"); |
|
5279 return NULL; |
|
5280 |
|
5281 } |
|
5282 |
|
5283 ERROR; |
|
5284 } |
|
5285 |
|
5286 }/*function_ulint_to_time*/ |
|
5287 break; |
|
5288 |
|
5289 /**** |
|
5290 *ULINT_TO_DATE |
|
5291 */ |
|
5292 case function_ulint_to_date : |
|
5293 { |
|
5294 symbol_c *last_type_symbol = NULL; |
|
5295 |
|
5296 { |
|
5297 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5298 symbol_c *IN_param_value = &this->default_variable_name; |
|
5299 |
|
5300 symbol_c *IN_type_symbol = param_data_type; |
|
5301 last_type_symbol = param_data_type; |
|
5302 |
|
5303 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5304 { |
|
5305 |
|
5306 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
5307 s4o.print("("); |
|
5308 return_type_symbol->accept(*this); |
|
5309 s4o.print(")__int_to_time("); |
|
5310 IN_param_value->accept(*this); |
|
5311 s4o.print(")"); |
|
5312 return NULL; |
|
5313 |
|
5314 } |
|
5315 |
|
5316 ERROR; |
|
5317 } |
|
5318 |
|
5319 }/*function_ulint_to_date*/ |
|
5320 break; |
|
5321 |
|
5322 /**** |
|
5323 *ULINT_TO_TOD |
|
5324 */ |
|
5325 case function_ulint_to_tod : |
|
5326 { |
|
5327 symbol_c *last_type_symbol = NULL; |
|
5328 |
|
5329 { |
|
5330 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5331 symbol_c *IN_param_value = &this->default_variable_name; |
|
5332 |
|
5333 symbol_c *IN_type_symbol = param_data_type; |
|
5334 last_type_symbol = param_data_type; |
|
5335 |
|
5336 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5337 { |
|
5338 |
|
5339 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
5340 s4o.print("("); |
|
5341 return_type_symbol->accept(*this); |
|
5342 s4o.print(")__int_to_time("); |
|
5343 IN_param_value->accept(*this); |
|
5344 s4o.print(")"); |
|
5345 return NULL; |
|
5346 |
|
5347 } |
|
5348 |
|
5349 ERROR; |
|
5350 } |
|
5351 |
|
5352 }/*function_ulint_to_tod*/ |
|
5353 break; |
|
5354 |
|
5355 /**** |
|
5356 *ULINT_TO_DT |
|
5357 */ |
|
5358 case function_ulint_to_dt : |
|
5359 { |
|
5360 symbol_c *last_type_symbol = NULL; |
|
5361 |
|
5362 { |
|
5363 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5364 symbol_c *IN_param_value = &this->default_variable_name; |
|
5365 |
|
5366 symbol_c *IN_type_symbol = param_data_type; |
|
5367 last_type_symbol = param_data_type; |
|
5368 |
|
5369 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5370 { |
|
5371 |
|
5372 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
5373 s4o.print("("); |
|
5374 return_type_symbol->accept(*this); |
|
5375 s4o.print(")__int_to_time("); |
|
5376 IN_param_value->accept(*this); |
|
5377 s4o.print(")"); |
|
5378 return NULL; |
|
5379 |
|
5380 } |
|
5381 |
|
5382 ERROR; |
|
5383 } |
|
5384 |
|
5385 }/*function_ulint_to_dt*/ |
|
5386 break; |
|
5387 |
|
5388 /**** |
|
5389 *ULINT_TO_STRING |
|
5390 */ |
|
5391 case function_ulint_to_string : |
|
5392 { |
|
5393 symbol_c *last_type_symbol = NULL; |
|
5394 |
|
5395 { |
|
5396 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5397 symbol_c *IN_param_value = &this->default_variable_name; |
|
5398 |
|
5399 symbol_c *IN_type_symbol = param_data_type; |
|
5400 last_type_symbol = param_data_type; |
|
5401 |
|
5402 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5403 { |
|
5404 |
|
5405 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
5406 s4o.print("("); |
|
5407 return_type_symbol->accept(*this); |
|
5408 s4o.print(")__uint_to_string("); |
|
5409 IN_param_value->accept(*this); |
|
5410 s4o.print(")"); |
|
5411 return NULL; |
|
5412 |
|
5413 } |
|
5414 |
|
5415 ERROR; |
|
5416 } |
|
5417 |
|
5418 }/*function_ulint_to_string*/ |
|
5419 break; |
|
5420 |
|
5421 /**** |
|
5422 *ULINT_TO_BYTE |
|
5423 */ |
|
5424 case function_ulint_to_byte : |
|
5425 { |
|
5426 symbol_c *last_type_symbol = NULL; |
|
5427 |
|
5428 { |
|
5429 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5430 symbol_c *IN_param_value = &this->default_variable_name; |
|
5431 |
|
5432 symbol_c *IN_type_symbol = param_data_type; |
|
5433 last_type_symbol = param_data_type; |
|
5434 |
|
5435 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5436 { |
|
5437 |
|
5438 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
5439 s4o.print("("); |
|
5440 return_type_symbol->accept(*this); |
|
5441 s4o.print(")"); |
|
5442 IN_param_value->accept(*this); |
|
5443 return NULL; |
|
5444 |
|
5445 } |
|
5446 |
|
5447 ERROR; |
|
5448 } |
|
5449 |
|
5450 }/*function_ulint_to_byte*/ |
|
5451 break; |
|
5452 |
|
5453 /**** |
|
5454 *ULINT_TO_WORD |
|
5455 */ |
|
5456 case function_ulint_to_word : |
|
5457 { |
|
5458 symbol_c *last_type_symbol = NULL; |
|
5459 |
|
5460 { |
|
5461 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5462 symbol_c *IN_param_value = &this->default_variable_name; |
|
5463 |
|
5464 symbol_c *IN_type_symbol = param_data_type; |
|
5465 last_type_symbol = param_data_type; |
|
5466 |
|
5467 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5468 { |
|
5469 |
|
5470 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
5471 s4o.print("("); |
|
5472 return_type_symbol->accept(*this); |
|
5473 s4o.print(")"); |
|
5474 IN_param_value->accept(*this); |
|
5475 return NULL; |
|
5476 |
|
5477 } |
|
5478 |
|
5479 ERROR; |
|
5480 } |
|
5481 |
|
5482 }/*function_ulint_to_word*/ |
|
5483 break; |
|
5484 |
|
5485 /**** |
|
5486 *ULINT_TO_DWORD |
|
5487 */ |
|
5488 case function_ulint_to_dword : |
|
5489 { |
|
5490 symbol_c *last_type_symbol = NULL; |
|
5491 |
|
5492 { |
|
5493 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5494 symbol_c *IN_param_value = &this->default_variable_name; |
|
5495 |
|
5496 symbol_c *IN_type_symbol = param_data_type; |
|
5497 last_type_symbol = param_data_type; |
|
5498 |
|
5499 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5500 { |
|
5501 |
|
5502 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
5503 s4o.print("("); |
|
5504 return_type_symbol->accept(*this); |
|
5505 s4o.print(")"); |
|
5506 IN_param_value->accept(*this); |
|
5507 return NULL; |
|
5508 |
|
5509 } |
|
5510 |
|
5511 ERROR; |
|
5512 } |
|
5513 |
|
5514 }/*function_ulint_to_dword*/ |
|
5515 break; |
|
5516 |
|
5517 /**** |
|
5518 *ULINT_TO_LWORD |
|
5519 */ |
|
5520 case function_ulint_to_lword : |
|
5521 { |
|
5522 symbol_c *last_type_symbol = NULL; |
|
5523 |
|
5524 { |
|
5525 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5526 symbol_c *IN_param_value = &this->default_variable_name; |
|
5527 |
|
5528 symbol_c *IN_type_symbol = param_data_type; |
|
5529 last_type_symbol = param_data_type; |
|
5530 |
|
5531 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
5532 { |
|
5533 |
|
5534 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
5535 s4o.print("("); |
|
5536 return_type_symbol->accept(*this); |
|
5537 s4o.print(")"); |
|
5538 IN_param_value->accept(*this); |
|
5539 return NULL; |
|
5540 |
|
5541 } |
|
5542 |
|
5543 ERROR; |
|
5544 } |
|
5545 |
|
5546 }/*function_ulint_to_lword*/ |
|
5547 break; |
|
5548 |
|
5549 /**** |
|
5550 *REAL_TO_BOOL |
|
5551 */ |
|
5552 case function_real_to_bool : |
|
5553 { |
|
5554 symbol_c *last_type_symbol = NULL; |
|
5555 |
|
5556 { |
|
5557 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5558 symbol_c *IN_param_value = &this->default_variable_name; |
|
5559 |
|
5560 symbol_c *IN_type_symbol = param_data_type; |
|
5561 last_type_symbol = param_data_type; |
|
5562 |
|
5563 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5564 { |
|
5565 |
|
5566 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
5567 s4o.print("("); |
|
5568 return_type_symbol->accept(*this); |
|
5569 s4o.print(")"); |
|
5570 IN_param_value->accept(*this); |
|
5571 return NULL; |
|
5572 |
|
5573 } |
|
5574 |
|
5575 ERROR; |
|
5576 } |
|
5577 |
|
5578 }/*function_real_to_bool*/ |
|
5579 break; |
|
5580 |
|
5581 /**** |
|
5582 *REAL_TO_SINT |
|
5583 */ |
|
5584 case function_real_to_sint : |
|
5585 { |
|
5586 symbol_c *last_type_symbol = NULL; |
|
5587 |
|
5588 { |
|
5589 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5590 symbol_c *IN_param_value = &this->default_variable_name; |
|
5591 |
|
5592 symbol_c *IN_type_symbol = param_data_type; |
|
5593 last_type_symbol = param_data_type; |
|
5594 |
|
5595 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5596 { |
|
5597 |
|
5598 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
5599 s4o.print("("); |
|
5600 return_type_symbol->accept(*this); |
|
5601 s4o.print(")"); |
|
5602 IN_param_value->accept(*this); |
|
5603 return NULL; |
|
5604 |
|
5605 } |
|
5606 |
|
5607 ERROR; |
|
5608 } |
|
5609 |
|
5610 }/*function_real_to_sint*/ |
|
5611 break; |
|
5612 |
|
5613 /**** |
|
5614 *REAL_TO_INT |
|
5615 */ |
|
5616 case function_real_to_int : |
|
5617 { |
|
5618 symbol_c *last_type_symbol = NULL; |
|
5619 |
|
5620 { |
|
5621 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5622 symbol_c *IN_param_value = &this->default_variable_name; |
|
5623 |
|
5624 symbol_c *IN_type_symbol = param_data_type; |
|
5625 last_type_symbol = param_data_type; |
|
5626 |
|
5627 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5628 { |
|
5629 |
|
5630 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
5631 s4o.print("("); |
|
5632 return_type_symbol->accept(*this); |
|
5633 s4o.print(")"); |
|
5634 IN_param_value->accept(*this); |
|
5635 return NULL; |
|
5636 |
|
5637 } |
|
5638 |
|
5639 ERROR; |
|
5640 } |
|
5641 |
|
5642 }/*function_real_to_int*/ |
|
5643 break; |
|
5644 |
|
5645 /**** |
|
5646 *REAL_TO_DINT |
|
5647 */ |
|
5648 case function_real_to_dint : |
|
5649 { |
|
5650 symbol_c *last_type_symbol = NULL; |
|
5651 |
|
5652 { |
|
5653 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5654 symbol_c *IN_param_value = &this->default_variable_name; |
|
5655 |
|
5656 symbol_c *IN_type_symbol = param_data_type; |
|
5657 last_type_symbol = param_data_type; |
|
5658 |
|
5659 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5660 { |
|
5661 |
|
5662 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
5663 s4o.print("("); |
|
5664 return_type_symbol->accept(*this); |
|
5665 s4o.print(")"); |
|
5666 IN_param_value->accept(*this); |
|
5667 return NULL; |
|
5668 |
|
5669 } |
|
5670 |
|
5671 ERROR; |
|
5672 } |
|
5673 |
|
5674 }/*function_real_to_dint*/ |
|
5675 break; |
|
5676 |
|
5677 /**** |
|
5678 *REAL_TO_LINT |
|
5679 */ |
|
5680 case function_real_to_lint : |
|
5681 { |
|
5682 symbol_c *last_type_symbol = NULL; |
|
5683 |
|
5684 { |
|
5685 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5686 symbol_c *IN_param_value = &this->default_variable_name; |
|
5687 |
|
5688 symbol_c *IN_type_symbol = param_data_type; |
|
5689 last_type_symbol = param_data_type; |
|
5690 |
|
5691 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5692 { |
|
5693 |
|
5694 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
5695 s4o.print("("); |
|
5696 return_type_symbol->accept(*this); |
|
5697 s4o.print(")"); |
|
5698 IN_param_value->accept(*this); |
|
5699 return NULL; |
|
5700 |
|
5701 } |
|
5702 |
|
5703 ERROR; |
|
5704 } |
|
5705 |
|
5706 }/*function_real_to_lint*/ |
|
5707 break; |
|
5708 |
|
5709 /**** |
|
5710 *REAL_TO_USINT |
|
5711 */ |
|
5712 case function_real_to_usint : |
|
5713 { |
|
5714 symbol_c *last_type_symbol = NULL; |
|
5715 |
|
5716 { |
|
5717 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5718 symbol_c *IN_param_value = &this->default_variable_name; |
|
5719 |
|
5720 symbol_c *IN_type_symbol = param_data_type; |
|
5721 last_type_symbol = param_data_type; |
|
5722 |
|
5723 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5724 { |
|
5725 |
|
5726 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
5727 s4o.print("("); |
|
5728 return_type_symbol->accept(*this); |
|
5729 s4o.print(")"); |
|
5730 IN_param_value->accept(*this); |
|
5731 return NULL; |
|
5732 |
|
5733 } |
|
5734 |
|
5735 ERROR; |
|
5736 } |
|
5737 |
|
5738 }/*function_real_to_usint*/ |
|
5739 break; |
|
5740 |
|
5741 /**** |
|
5742 *REAL_TO_UINT |
|
5743 */ |
|
5744 case function_real_to_uint : |
|
5745 { |
|
5746 symbol_c *last_type_symbol = NULL; |
|
5747 |
|
5748 { |
|
5749 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5750 symbol_c *IN_param_value = &this->default_variable_name; |
|
5751 |
|
5752 symbol_c *IN_type_symbol = param_data_type; |
|
5753 last_type_symbol = param_data_type; |
|
5754 |
|
5755 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5756 { |
|
5757 |
|
5758 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
5759 s4o.print("("); |
|
5760 return_type_symbol->accept(*this); |
|
5761 s4o.print(")"); |
|
5762 IN_param_value->accept(*this); |
|
5763 return NULL; |
|
5764 |
|
5765 } |
|
5766 |
|
5767 ERROR; |
|
5768 } |
|
5769 |
|
5770 }/*function_real_to_uint*/ |
|
5771 break; |
|
5772 |
|
5773 /**** |
|
5774 *REAL_TO_UDINT |
|
5775 */ |
|
5776 case function_real_to_udint : |
|
5777 { |
|
5778 symbol_c *last_type_symbol = NULL; |
|
5779 |
|
5780 { |
|
5781 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5782 symbol_c *IN_param_value = &this->default_variable_name; |
|
5783 |
|
5784 symbol_c *IN_type_symbol = param_data_type; |
|
5785 last_type_symbol = param_data_type; |
|
5786 |
|
5787 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5788 { |
|
5789 |
|
5790 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
5791 s4o.print("("); |
|
5792 return_type_symbol->accept(*this); |
|
5793 s4o.print(")"); |
|
5794 IN_param_value->accept(*this); |
|
5795 return NULL; |
|
5796 |
|
5797 } |
|
5798 |
|
5799 ERROR; |
|
5800 } |
|
5801 |
|
5802 }/*function_real_to_udint*/ |
|
5803 break; |
|
5804 |
|
5805 /**** |
|
5806 *REAL_TO_ULINT |
|
5807 */ |
|
5808 case function_real_to_ulint : |
|
5809 { |
|
5810 symbol_c *last_type_symbol = NULL; |
|
5811 |
|
5812 { |
|
5813 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5814 symbol_c *IN_param_value = &this->default_variable_name; |
|
5815 |
|
5816 symbol_c *IN_type_symbol = param_data_type; |
|
5817 last_type_symbol = param_data_type; |
|
5818 |
|
5819 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5820 { |
|
5821 |
|
5822 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
5823 s4o.print("("); |
|
5824 return_type_symbol->accept(*this); |
|
5825 s4o.print(")"); |
|
5826 IN_param_value->accept(*this); |
|
5827 return NULL; |
|
5828 |
|
5829 } |
|
5830 |
|
5831 ERROR; |
|
5832 } |
|
5833 |
|
5834 }/*function_real_to_ulint*/ |
|
5835 break; |
|
5836 |
|
5837 /**** |
|
5838 *REAL_TO_LREAL |
|
5839 */ |
|
5840 case function_real_to_lreal : |
|
5841 { |
|
5842 symbol_c *last_type_symbol = NULL; |
|
5843 |
|
5844 { |
|
5845 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5846 symbol_c *IN_param_value = &this->default_variable_name; |
|
5847 |
|
5848 symbol_c *IN_type_symbol = param_data_type; |
|
5849 last_type_symbol = param_data_type; |
|
5850 |
|
5851 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5852 { |
|
5853 |
|
5854 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
5855 s4o.print("("); |
|
5856 return_type_symbol->accept(*this); |
|
5857 s4o.print(")"); |
|
5858 IN_param_value->accept(*this); |
|
5859 return NULL; |
|
5860 |
|
5861 } |
|
5862 |
|
5863 ERROR; |
|
5864 } |
|
5865 |
|
5866 }/*function_real_to_lreal*/ |
|
5867 break; |
|
5868 |
|
5869 /**** |
|
5870 *REAL_TO_TIME |
|
5871 */ |
|
5872 case function_real_to_time : |
|
5873 { |
|
5874 symbol_c *last_type_symbol = NULL; |
|
5875 |
|
5876 { |
|
5877 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5878 symbol_c *IN_param_value = &this->default_variable_name; |
|
5879 |
|
5880 symbol_c *IN_type_symbol = param_data_type; |
|
5881 last_type_symbol = param_data_type; |
|
5882 |
|
5883 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5884 { |
|
5885 |
|
5886 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
5887 s4o.print("("); |
|
5888 return_type_symbol->accept(*this); |
|
5889 s4o.print(")__real_to_time("); |
|
5890 IN_param_value->accept(*this); |
|
5891 s4o.print(")"); |
|
5892 return NULL; |
|
5893 |
|
5894 } |
|
5895 |
|
5896 ERROR; |
|
5897 } |
|
5898 |
|
5899 }/*function_real_to_time*/ |
|
5900 break; |
|
5901 |
|
5902 /**** |
|
5903 *REAL_TO_DATE |
|
5904 */ |
|
5905 case function_real_to_date : |
|
5906 { |
|
5907 symbol_c *last_type_symbol = NULL; |
|
5908 |
|
5909 { |
|
5910 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5911 symbol_c *IN_param_value = &this->default_variable_name; |
|
5912 |
|
5913 symbol_c *IN_type_symbol = param_data_type; |
|
5914 last_type_symbol = param_data_type; |
|
5915 |
|
5916 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5917 { |
|
5918 |
|
5919 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
5920 s4o.print("("); |
|
5921 return_type_symbol->accept(*this); |
|
5922 s4o.print(")__real_to_time("); |
|
5923 IN_param_value->accept(*this); |
|
5924 s4o.print(")"); |
|
5925 return NULL; |
|
5926 |
|
5927 } |
|
5928 |
|
5929 ERROR; |
|
5930 } |
|
5931 |
|
5932 }/*function_real_to_date*/ |
|
5933 break; |
|
5934 |
|
5935 /**** |
|
5936 *REAL_TO_TOD |
|
5937 */ |
|
5938 case function_real_to_tod : |
|
5939 { |
|
5940 symbol_c *last_type_symbol = NULL; |
|
5941 |
|
5942 { |
|
5943 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5944 symbol_c *IN_param_value = &this->default_variable_name; |
|
5945 |
|
5946 symbol_c *IN_type_symbol = param_data_type; |
|
5947 last_type_symbol = param_data_type; |
|
5948 |
|
5949 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5950 { |
|
5951 |
|
5952 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
5953 s4o.print("("); |
|
5954 return_type_symbol->accept(*this); |
|
5955 s4o.print(")__real_to_time("); |
|
5956 IN_param_value->accept(*this); |
|
5957 s4o.print(")"); |
|
5958 return NULL; |
|
5959 |
|
5960 } |
|
5961 |
|
5962 ERROR; |
|
5963 } |
|
5964 |
|
5965 }/*function_real_to_tod*/ |
|
5966 break; |
|
5967 |
|
5968 /**** |
|
5969 *REAL_TO_DT |
|
5970 */ |
|
5971 case function_real_to_dt : |
|
5972 { |
|
5973 symbol_c *last_type_symbol = NULL; |
|
5974 |
|
5975 { |
|
5976 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
5977 symbol_c *IN_param_value = &this->default_variable_name; |
|
5978 |
|
5979 symbol_c *IN_type_symbol = param_data_type; |
|
5980 last_type_symbol = param_data_type; |
|
5981 |
|
5982 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
5983 { |
|
5984 |
|
5985 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
5986 s4o.print("("); |
|
5987 return_type_symbol->accept(*this); |
|
5988 s4o.print(")__real_to_time("); |
|
5989 IN_param_value->accept(*this); |
|
5990 s4o.print(")"); |
|
5991 return NULL; |
|
5992 |
|
5993 } |
|
5994 |
|
5995 ERROR; |
|
5996 } |
|
5997 |
|
5998 }/*function_real_to_dt*/ |
|
5999 break; |
|
6000 |
|
6001 /**** |
|
6002 *REAL_TO_STRING |
|
6003 */ |
|
6004 case function_real_to_string : |
|
6005 { |
|
6006 symbol_c *last_type_symbol = NULL; |
|
6007 |
|
6008 { |
|
6009 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6010 symbol_c *IN_param_value = &this->default_variable_name; |
|
6011 |
|
6012 symbol_c *IN_type_symbol = param_data_type; |
|
6013 last_type_symbol = param_data_type; |
|
6014 |
|
6015 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
6016 { |
|
6017 |
|
6018 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
6019 s4o.print("("); |
|
6020 return_type_symbol->accept(*this); |
|
6021 s4o.print(")__real_to_string("); |
|
6022 IN_param_value->accept(*this); |
|
6023 s4o.print(")"); |
|
6024 return NULL; |
|
6025 |
|
6026 } |
|
6027 |
|
6028 ERROR; |
|
6029 } |
|
6030 |
|
6031 }/*function_real_to_string*/ |
|
6032 break; |
|
6033 |
|
6034 /**** |
|
6035 *REAL_TO_BYTE |
|
6036 */ |
|
6037 case function_real_to_byte : |
|
6038 { |
|
6039 symbol_c *last_type_symbol = NULL; |
|
6040 |
|
6041 { |
|
6042 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6043 symbol_c *IN_param_value = &this->default_variable_name; |
|
6044 |
|
6045 symbol_c *IN_type_symbol = param_data_type; |
|
6046 last_type_symbol = param_data_type; |
|
6047 |
|
6048 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
6049 { |
|
6050 |
|
6051 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
6052 s4o.print("("); |
|
6053 return_type_symbol->accept(*this); |
|
6054 s4o.print(")"); |
|
6055 IN_param_value->accept(*this); |
|
6056 return NULL; |
|
6057 |
|
6058 } |
|
6059 |
|
6060 ERROR; |
|
6061 } |
|
6062 |
|
6063 }/*function_real_to_byte*/ |
|
6064 break; |
|
6065 |
|
6066 /**** |
|
6067 *REAL_TO_WORD |
|
6068 */ |
|
6069 case function_real_to_word : |
|
6070 { |
|
6071 symbol_c *last_type_symbol = NULL; |
|
6072 |
|
6073 { |
|
6074 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6075 symbol_c *IN_param_value = &this->default_variable_name; |
|
6076 |
|
6077 symbol_c *IN_type_symbol = param_data_type; |
|
6078 last_type_symbol = param_data_type; |
|
6079 |
|
6080 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
6081 { |
|
6082 |
|
6083 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
6084 s4o.print("("); |
|
6085 return_type_symbol->accept(*this); |
|
6086 s4o.print(")"); |
|
6087 IN_param_value->accept(*this); |
|
6088 return NULL; |
|
6089 |
|
6090 } |
|
6091 |
|
6092 ERROR; |
|
6093 } |
|
6094 |
|
6095 }/*function_real_to_word*/ |
|
6096 break; |
|
6097 |
|
6098 /**** |
|
6099 *REAL_TO_DWORD |
|
6100 */ |
|
6101 case function_real_to_dword : |
|
6102 { |
|
6103 symbol_c *last_type_symbol = NULL; |
|
6104 |
|
6105 { |
|
6106 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6107 symbol_c *IN_param_value = &this->default_variable_name; |
|
6108 |
|
6109 symbol_c *IN_type_symbol = param_data_type; |
|
6110 last_type_symbol = param_data_type; |
|
6111 |
|
6112 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
6113 { |
|
6114 |
|
6115 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
6116 s4o.print("("); |
|
6117 return_type_symbol->accept(*this); |
|
6118 s4o.print(")"); |
|
6119 IN_param_value->accept(*this); |
|
6120 return NULL; |
|
6121 |
|
6122 } |
|
6123 |
|
6124 ERROR; |
|
6125 } |
|
6126 |
|
6127 }/*function_real_to_dword*/ |
|
6128 break; |
|
6129 |
|
6130 /**** |
|
6131 *REAL_TO_LWORD |
|
6132 */ |
|
6133 case function_real_to_lword : |
|
6134 { |
|
6135 symbol_c *last_type_symbol = NULL; |
|
6136 |
|
6137 { |
|
6138 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6139 symbol_c *IN_param_value = &this->default_variable_name; |
|
6140 |
|
6141 symbol_c *IN_type_symbol = param_data_type; |
|
6142 last_type_symbol = param_data_type; |
|
6143 |
|
6144 if(search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
6145 { |
|
6146 |
|
6147 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
6148 s4o.print("("); |
|
6149 return_type_symbol->accept(*this); |
|
6150 s4o.print(")"); |
|
6151 IN_param_value->accept(*this); |
|
6152 return NULL; |
|
6153 |
|
6154 } |
|
6155 |
|
6156 ERROR; |
|
6157 } |
|
6158 |
|
6159 }/*function_real_to_lword*/ |
|
6160 break; |
|
6161 |
|
6162 /**** |
|
6163 *LREAL_TO_BOOL |
|
6164 */ |
|
6165 case function_lreal_to_bool : |
|
6166 { |
|
6167 symbol_c *last_type_symbol = NULL; |
|
6168 |
|
6169 { |
|
6170 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6171 symbol_c *IN_param_value = &this->default_variable_name; |
|
6172 |
|
6173 symbol_c *IN_type_symbol = param_data_type; |
|
6174 last_type_symbol = param_data_type; |
|
6175 |
|
6176 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6177 { |
|
6178 |
|
6179 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
6180 s4o.print("("); |
|
6181 return_type_symbol->accept(*this); |
|
6182 s4o.print(")"); |
|
6183 IN_param_value->accept(*this); |
|
6184 return NULL; |
|
6185 |
|
6186 } |
|
6187 |
|
6188 ERROR; |
|
6189 } |
|
6190 |
|
6191 }/*function_lreal_to_bool*/ |
|
6192 break; |
|
6193 |
|
6194 /**** |
|
6195 *LREAL_TO_SINT |
|
6196 */ |
|
6197 case function_lreal_to_sint : |
|
6198 { |
|
6199 symbol_c *last_type_symbol = NULL; |
|
6200 |
|
6201 { |
|
6202 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6203 symbol_c *IN_param_value = &this->default_variable_name; |
|
6204 |
|
6205 symbol_c *IN_type_symbol = param_data_type; |
|
6206 last_type_symbol = param_data_type; |
|
6207 |
|
6208 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6209 { |
|
6210 |
|
6211 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
6212 s4o.print("("); |
|
6213 return_type_symbol->accept(*this); |
|
6214 s4o.print(")"); |
|
6215 IN_param_value->accept(*this); |
|
6216 return NULL; |
|
6217 |
|
6218 } |
|
6219 |
|
6220 ERROR; |
|
6221 } |
|
6222 |
|
6223 }/*function_lreal_to_sint*/ |
|
6224 break; |
|
6225 |
|
6226 /**** |
|
6227 *LREAL_TO_INT |
|
6228 */ |
|
6229 case function_lreal_to_int : |
|
6230 { |
|
6231 symbol_c *last_type_symbol = NULL; |
|
6232 |
|
6233 { |
|
6234 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6235 symbol_c *IN_param_value = &this->default_variable_name; |
|
6236 |
|
6237 symbol_c *IN_type_symbol = param_data_type; |
|
6238 last_type_symbol = param_data_type; |
|
6239 |
|
6240 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6241 { |
|
6242 |
|
6243 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
6244 s4o.print("("); |
|
6245 return_type_symbol->accept(*this); |
|
6246 s4o.print(")"); |
|
6247 IN_param_value->accept(*this); |
|
6248 return NULL; |
|
6249 |
|
6250 } |
|
6251 |
|
6252 ERROR; |
|
6253 } |
|
6254 |
|
6255 }/*function_lreal_to_int*/ |
|
6256 break; |
|
6257 |
|
6258 /**** |
|
6259 *LREAL_TO_DINT |
|
6260 */ |
|
6261 case function_lreal_to_dint : |
|
6262 { |
|
6263 symbol_c *last_type_symbol = NULL; |
|
6264 |
|
6265 { |
|
6266 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6267 symbol_c *IN_param_value = &this->default_variable_name; |
|
6268 |
|
6269 symbol_c *IN_type_symbol = param_data_type; |
|
6270 last_type_symbol = param_data_type; |
|
6271 |
|
6272 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6273 { |
|
6274 |
|
6275 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
6276 s4o.print("("); |
|
6277 return_type_symbol->accept(*this); |
|
6278 s4o.print(")"); |
|
6279 IN_param_value->accept(*this); |
|
6280 return NULL; |
|
6281 |
|
6282 } |
|
6283 |
|
6284 ERROR; |
|
6285 } |
|
6286 |
|
6287 }/*function_lreal_to_dint*/ |
|
6288 break; |
|
6289 |
|
6290 /**** |
|
6291 *LREAL_TO_LINT |
|
6292 */ |
|
6293 case function_lreal_to_lint : |
|
6294 { |
|
6295 symbol_c *last_type_symbol = NULL; |
|
6296 |
|
6297 { |
|
6298 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6299 symbol_c *IN_param_value = &this->default_variable_name; |
|
6300 |
|
6301 symbol_c *IN_type_symbol = param_data_type; |
|
6302 last_type_symbol = param_data_type; |
|
6303 |
|
6304 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6305 { |
|
6306 |
|
6307 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
6308 s4o.print("("); |
|
6309 return_type_symbol->accept(*this); |
|
6310 s4o.print(")"); |
|
6311 IN_param_value->accept(*this); |
|
6312 return NULL; |
|
6313 |
|
6314 } |
|
6315 |
|
6316 ERROR; |
|
6317 } |
|
6318 |
|
6319 }/*function_lreal_to_lint*/ |
|
6320 break; |
|
6321 |
|
6322 /**** |
|
6323 *LREAL_TO_USINT |
|
6324 */ |
|
6325 case function_lreal_to_usint : |
|
6326 { |
|
6327 symbol_c *last_type_symbol = NULL; |
|
6328 |
|
6329 { |
|
6330 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6331 symbol_c *IN_param_value = &this->default_variable_name; |
|
6332 |
|
6333 symbol_c *IN_type_symbol = param_data_type; |
|
6334 last_type_symbol = param_data_type; |
|
6335 |
|
6336 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6337 { |
|
6338 |
|
6339 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
6340 s4o.print("("); |
|
6341 return_type_symbol->accept(*this); |
|
6342 s4o.print(")"); |
|
6343 IN_param_value->accept(*this); |
|
6344 return NULL; |
|
6345 |
|
6346 } |
|
6347 |
|
6348 ERROR; |
|
6349 } |
|
6350 |
|
6351 }/*function_lreal_to_usint*/ |
|
6352 break; |
|
6353 |
|
6354 /**** |
|
6355 *LREAL_TO_UINT |
|
6356 */ |
|
6357 case function_lreal_to_uint : |
|
6358 { |
|
6359 symbol_c *last_type_symbol = NULL; |
|
6360 |
|
6361 { |
|
6362 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6363 symbol_c *IN_param_value = &this->default_variable_name; |
|
6364 |
|
6365 symbol_c *IN_type_symbol = param_data_type; |
|
6366 last_type_symbol = param_data_type; |
|
6367 |
|
6368 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6369 { |
|
6370 |
|
6371 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
6372 s4o.print("("); |
|
6373 return_type_symbol->accept(*this); |
|
6374 s4o.print(")"); |
|
6375 IN_param_value->accept(*this); |
|
6376 return NULL; |
|
6377 |
|
6378 } |
|
6379 |
|
6380 ERROR; |
|
6381 } |
|
6382 |
|
6383 }/*function_lreal_to_uint*/ |
|
6384 break; |
|
6385 |
|
6386 /**** |
|
6387 *LREAL_TO_UDINT |
|
6388 */ |
|
6389 case function_lreal_to_udint : |
|
6390 { |
|
6391 symbol_c *last_type_symbol = NULL; |
|
6392 |
|
6393 { |
|
6394 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6395 symbol_c *IN_param_value = &this->default_variable_name; |
|
6396 |
|
6397 symbol_c *IN_type_symbol = param_data_type; |
|
6398 last_type_symbol = param_data_type; |
|
6399 |
|
6400 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6401 { |
|
6402 |
|
6403 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
6404 s4o.print("("); |
|
6405 return_type_symbol->accept(*this); |
|
6406 s4o.print(")"); |
|
6407 IN_param_value->accept(*this); |
|
6408 return NULL; |
|
6409 |
|
6410 } |
|
6411 |
|
6412 ERROR; |
|
6413 } |
|
6414 |
|
6415 }/*function_lreal_to_udint*/ |
|
6416 break; |
|
6417 |
|
6418 /**** |
|
6419 *LREAL_TO_ULINT |
|
6420 */ |
|
6421 case function_lreal_to_ulint : |
|
6422 { |
|
6423 symbol_c *last_type_symbol = NULL; |
|
6424 |
|
6425 { |
|
6426 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6427 symbol_c *IN_param_value = &this->default_variable_name; |
|
6428 |
|
6429 symbol_c *IN_type_symbol = param_data_type; |
|
6430 last_type_symbol = param_data_type; |
|
6431 |
|
6432 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6433 { |
|
6434 |
|
6435 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
6436 s4o.print("("); |
|
6437 return_type_symbol->accept(*this); |
|
6438 s4o.print(")"); |
|
6439 IN_param_value->accept(*this); |
|
6440 return NULL; |
|
6441 |
|
6442 } |
|
6443 |
|
6444 ERROR; |
|
6445 } |
|
6446 |
|
6447 }/*function_lreal_to_ulint*/ |
|
6448 break; |
|
6449 |
|
6450 /**** |
|
6451 *LREAL_TO_REAL |
|
6452 */ |
|
6453 case function_lreal_to_real : |
|
6454 { |
|
6455 symbol_c *last_type_symbol = NULL; |
|
6456 |
|
6457 { |
|
6458 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6459 symbol_c *IN_param_value = &this->default_variable_name; |
|
6460 |
|
6461 symbol_c *IN_type_symbol = param_data_type; |
|
6462 last_type_symbol = param_data_type; |
|
6463 |
|
6464 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6465 { |
|
6466 |
|
6467 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
6468 s4o.print("("); |
|
6469 return_type_symbol->accept(*this); |
|
6470 s4o.print(")"); |
|
6471 IN_param_value->accept(*this); |
|
6472 return NULL; |
|
6473 |
|
6474 } |
|
6475 |
|
6476 ERROR; |
|
6477 } |
|
6478 |
|
6479 }/*function_lreal_to_real*/ |
|
6480 break; |
|
6481 |
|
6482 /**** |
|
6483 *LREAL_TO_TIME |
|
6484 */ |
|
6485 case function_lreal_to_time : |
|
6486 { |
|
6487 symbol_c *last_type_symbol = NULL; |
|
6488 |
|
6489 { |
|
6490 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6491 symbol_c *IN_param_value = &this->default_variable_name; |
|
6492 |
|
6493 symbol_c *IN_type_symbol = param_data_type; |
|
6494 last_type_symbol = param_data_type; |
|
6495 |
|
6496 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6497 { |
|
6498 |
|
6499 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
6500 s4o.print("("); |
|
6501 return_type_symbol->accept(*this); |
|
6502 s4o.print(")__real_to_time("); |
|
6503 IN_param_value->accept(*this); |
|
6504 s4o.print(")"); |
|
6505 return NULL; |
|
6506 |
|
6507 } |
|
6508 |
|
6509 ERROR; |
|
6510 } |
|
6511 |
|
6512 }/*function_lreal_to_time*/ |
|
6513 break; |
|
6514 |
|
6515 /**** |
|
6516 *LREAL_TO_DATE |
|
6517 */ |
|
6518 case function_lreal_to_date : |
|
6519 { |
|
6520 symbol_c *last_type_symbol = NULL; |
|
6521 |
|
6522 { |
|
6523 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6524 symbol_c *IN_param_value = &this->default_variable_name; |
|
6525 |
|
6526 symbol_c *IN_type_symbol = param_data_type; |
|
6527 last_type_symbol = param_data_type; |
|
6528 |
|
6529 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6530 { |
|
6531 |
|
6532 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
6533 s4o.print("("); |
|
6534 return_type_symbol->accept(*this); |
|
6535 s4o.print(")__real_to_time("); |
|
6536 IN_param_value->accept(*this); |
|
6537 s4o.print(")"); |
|
6538 return NULL; |
|
6539 |
|
6540 } |
|
6541 |
|
6542 ERROR; |
|
6543 } |
|
6544 |
|
6545 }/*function_lreal_to_date*/ |
|
6546 break; |
|
6547 |
|
6548 /**** |
|
6549 *LREAL_TO_TOD |
|
6550 */ |
|
6551 case function_lreal_to_tod : |
|
6552 { |
|
6553 symbol_c *last_type_symbol = NULL; |
|
6554 |
|
6555 { |
|
6556 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6557 symbol_c *IN_param_value = &this->default_variable_name; |
|
6558 |
|
6559 symbol_c *IN_type_symbol = param_data_type; |
|
6560 last_type_symbol = param_data_type; |
|
6561 |
|
6562 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6563 { |
|
6564 |
|
6565 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
6566 s4o.print("("); |
|
6567 return_type_symbol->accept(*this); |
|
6568 s4o.print(")__real_to_time("); |
|
6569 IN_param_value->accept(*this); |
|
6570 s4o.print(")"); |
|
6571 return NULL; |
|
6572 |
|
6573 } |
|
6574 |
|
6575 ERROR; |
|
6576 } |
|
6577 |
|
6578 }/*function_lreal_to_tod*/ |
|
6579 break; |
|
6580 |
|
6581 /**** |
|
6582 *LREAL_TO_DT |
|
6583 */ |
|
6584 case function_lreal_to_dt : |
|
6585 { |
|
6586 symbol_c *last_type_symbol = NULL; |
|
6587 |
|
6588 { |
|
6589 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6590 symbol_c *IN_param_value = &this->default_variable_name; |
|
6591 |
|
6592 symbol_c *IN_type_symbol = param_data_type; |
|
6593 last_type_symbol = param_data_type; |
|
6594 |
|
6595 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6596 { |
|
6597 |
|
6598 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
6599 s4o.print("("); |
|
6600 return_type_symbol->accept(*this); |
|
6601 s4o.print(")__real_to_time("); |
|
6602 IN_param_value->accept(*this); |
|
6603 s4o.print(")"); |
|
6604 return NULL; |
|
6605 |
|
6606 } |
|
6607 |
|
6608 ERROR; |
|
6609 } |
|
6610 |
|
6611 }/*function_lreal_to_dt*/ |
|
6612 break; |
|
6613 |
|
6614 /**** |
|
6615 *LREAL_TO_STRING |
|
6616 */ |
|
6617 case function_lreal_to_string : |
|
6618 { |
|
6619 symbol_c *last_type_symbol = NULL; |
|
6620 |
|
6621 { |
|
6622 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6623 symbol_c *IN_param_value = &this->default_variable_name; |
|
6624 |
|
6625 symbol_c *IN_type_symbol = param_data_type; |
|
6626 last_type_symbol = param_data_type; |
|
6627 |
|
6628 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6629 { |
|
6630 |
|
6631 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
6632 s4o.print("("); |
|
6633 return_type_symbol->accept(*this); |
|
6634 s4o.print(")__real_to_string("); |
|
6635 IN_param_value->accept(*this); |
|
6636 s4o.print(")"); |
|
6637 return NULL; |
|
6638 |
|
6639 } |
|
6640 |
|
6641 ERROR; |
|
6642 } |
|
6643 |
|
6644 }/*function_lreal_to_string*/ |
|
6645 break; |
|
6646 |
|
6647 /**** |
|
6648 *LREAL_TO_BYTE |
|
6649 */ |
|
6650 case function_lreal_to_byte : |
|
6651 { |
|
6652 symbol_c *last_type_symbol = NULL; |
|
6653 |
|
6654 { |
|
6655 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6656 symbol_c *IN_param_value = &this->default_variable_name; |
|
6657 |
|
6658 symbol_c *IN_type_symbol = param_data_type; |
|
6659 last_type_symbol = param_data_type; |
|
6660 |
|
6661 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6662 { |
|
6663 |
|
6664 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
6665 s4o.print("("); |
|
6666 return_type_symbol->accept(*this); |
|
6667 s4o.print(")"); |
|
6668 IN_param_value->accept(*this); |
|
6669 return NULL; |
|
6670 |
|
6671 } |
|
6672 |
|
6673 ERROR; |
|
6674 } |
|
6675 |
|
6676 }/*function_lreal_to_byte*/ |
|
6677 break; |
|
6678 |
|
6679 /**** |
|
6680 *LREAL_TO_WORD |
|
6681 */ |
|
6682 case function_lreal_to_word : |
|
6683 { |
|
6684 symbol_c *last_type_symbol = NULL; |
|
6685 |
|
6686 { |
|
6687 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6688 symbol_c *IN_param_value = &this->default_variable_name; |
|
6689 |
|
6690 symbol_c *IN_type_symbol = param_data_type; |
|
6691 last_type_symbol = param_data_type; |
|
6692 |
|
6693 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6694 { |
|
6695 |
|
6696 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
6697 s4o.print("("); |
|
6698 return_type_symbol->accept(*this); |
|
6699 s4o.print(")"); |
|
6700 IN_param_value->accept(*this); |
|
6701 return NULL; |
|
6702 |
|
6703 } |
|
6704 |
|
6705 ERROR; |
|
6706 } |
|
6707 |
|
6708 }/*function_lreal_to_word*/ |
|
6709 break; |
|
6710 |
|
6711 /**** |
|
6712 *LREAL_TO_DWORD |
|
6713 */ |
|
6714 case function_lreal_to_dword : |
|
6715 { |
|
6716 symbol_c *last_type_symbol = NULL; |
|
6717 |
|
6718 { |
|
6719 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6720 symbol_c *IN_param_value = &this->default_variable_name; |
|
6721 |
|
6722 symbol_c *IN_type_symbol = param_data_type; |
|
6723 last_type_symbol = param_data_type; |
|
6724 |
|
6725 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6726 { |
|
6727 |
|
6728 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
6729 s4o.print("("); |
|
6730 return_type_symbol->accept(*this); |
|
6731 s4o.print(")"); |
|
6732 IN_param_value->accept(*this); |
|
6733 return NULL; |
|
6734 |
|
6735 } |
|
6736 |
|
6737 ERROR; |
|
6738 } |
|
6739 |
|
6740 }/*function_lreal_to_dword*/ |
|
6741 break; |
|
6742 |
|
6743 /**** |
|
6744 *LREAL_TO_LWORD |
|
6745 */ |
|
6746 case function_lreal_to_lword : |
|
6747 { |
|
6748 symbol_c *last_type_symbol = NULL; |
|
6749 |
|
6750 { |
|
6751 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6752 symbol_c *IN_param_value = &this->default_variable_name; |
|
6753 |
|
6754 symbol_c *IN_type_symbol = param_data_type; |
|
6755 last_type_symbol = param_data_type; |
|
6756 |
|
6757 if(search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) |
|
6758 { |
|
6759 |
|
6760 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
6761 s4o.print("("); |
|
6762 return_type_symbol->accept(*this); |
|
6763 s4o.print(")"); |
|
6764 IN_param_value->accept(*this); |
|
6765 return NULL; |
|
6766 |
|
6767 } |
|
6768 |
|
6769 ERROR; |
|
6770 } |
|
6771 |
|
6772 }/*function_lreal_to_lword*/ |
|
6773 break; |
|
6774 |
|
6775 /**** |
|
6776 *TIME_TO_SINT |
|
6777 */ |
|
6778 case function_time_to_sint : |
|
6779 { |
|
6780 symbol_c *last_type_symbol = NULL; |
|
6781 |
|
6782 { |
|
6783 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6784 symbol_c *IN_param_value = &this->default_variable_name; |
|
6785 |
|
6786 symbol_c *IN_type_symbol = param_data_type; |
|
6787 last_type_symbol = param_data_type; |
|
6788 |
|
6789 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6790 { |
|
6791 |
|
6792 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
6793 s4o.print("("); |
|
6794 return_type_symbol->accept(*this); |
|
6795 s4o.print(")__time_to_int("); |
|
6796 IN_param_value->accept(*this); |
|
6797 s4o.print(")"); |
|
6798 return NULL; |
|
6799 |
|
6800 } |
|
6801 |
|
6802 ERROR; |
|
6803 } |
|
6804 |
|
6805 }/*function_time_to_sint*/ |
|
6806 break; |
|
6807 |
|
6808 /**** |
|
6809 *TIME_TO_INT |
|
6810 */ |
|
6811 case function_time_to_int : |
|
6812 { |
|
6813 symbol_c *last_type_symbol = NULL; |
|
6814 |
|
6815 { |
|
6816 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6817 symbol_c *IN_param_value = &this->default_variable_name; |
|
6818 |
|
6819 symbol_c *IN_type_symbol = param_data_type; |
|
6820 last_type_symbol = param_data_type; |
|
6821 |
|
6822 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6823 { |
|
6824 |
|
6825 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
6826 s4o.print("("); |
|
6827 return_type_symbol->accept(*this); |
|
6828 s4o.print(")__time_to_int("); |
|
6829 IN_param_value->accept(*this); |
|
6830 s4o.print(")"); |
|
6831 return NULL; |
|
6832 |
|
6833 } |
|
6834 |
|
6835 ERROR; |
|
6836 } |
|
6837 |
|
6838 }/*function_time_to_int*/ |
|
6839 break; |
|
6840 |
|
6841 /**** |
|
6842 *TIME_TO_DINT |
|
6843 */ |
|
6844 case function_time_to_dint : |
|
6845 { |
|
6846 symbol_c *last_type_symbol = NULL; |
|
6847 |
|
6848 { |
|
6849 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6850 symbol_c *IN_param_value = &this->default_variable_name; |
|
6851 |
|
6852 symbol_c *IN_type_symbol = param_data_type; |
|
6853 last_type_symbol = param_data_type; |
|
6854 |
|
6855 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6856 { |
|
6857 |
|
6858 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
6859 s4o.print("("); |
|
6860 return_type_symbol->accept(*this); |
|
6861 s4o.print(")__time_to_int("); |
|
6862 IN_param_value->accept(*this); |
|
6863 s4o.print(")"); |
|
6864 return NULL; |
|
6865 |
|
6866 } |
|
6867 |
|
6868 ERROR; |
|
6869 } |
|
6870 |
|
6871 }/*function_time_to_dint*/ |
|
6872 break; |
|
6873 |
|
6874 /**** |
|
6875 *TIME_TO_LINT |
|
6876 */ |
|
6877 case function_time_to_lint : |
|
6878 { |
|
6879 symbol_c *last_type_symbol = NULL; |
|
6880 |
|
6881 { |
|
6882 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6883 symbol_c *IN_param_value = &this->default_variable_name; |
|
6884 |
|
6885 symbol_c *IN_type_symbol = param_data_type; |
|
6886 last_type_symbol = param_data_type; |
|
6887 |
|
6888 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6889 { |
|
6890 |
|
6891 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
6892 s4o.print("("); |
|
6893 return_type_symbol->accept(*this); |
|
6894 s4o.print(")__time_to_int("); |
|
6895 IN_param_value->accept(*this); |
|
6896 s4o.print(")"); |
|
6897 return NULL; |
|
6898 |
|
6899 } |
|
6900 |
|
6901 ERROR; |
|
6902 } |
|
6903 |
|
6904 }/*function_time_to_lint*/ |
|
6905 break; |
|
6906 |
|
6907 /**** |
|
6908 *TIME_TO_USINT |
|
6909 */ |
|
6910 case function_time_to_usint : |
|
6911 { |
|
6912 symbol_c *last_type_symbol = NULL; |
|
6913 |
|
6914 { |
|
6915 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6916 symbol_c *IN_param_value = &this->default_variable_name; |
|
6917 |
|
6918 symbol_c *IN_type_symbol = param_data_type; |
|
6919 last_type_symbol = param_data_type; |
|
6920 |
|
6921 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6922 { |
|
6923 |
|
6924 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
6925 s4o.print("("); |
|
6926 return_type_symbol->accept(*this); |
|
6927 s4o.print(")__time_to_int("); |
|
6928 IN_param_value->accept(*this); |
|
6929 s4o.print(")"); |
|
6930 return NULL; |
|
6931 |
|
6932 } |
|
6933 |
|
6934 ERROR; |
|
6935 } |
|
6936 |
|
6937 }/*function_time_to_usint*/ |
|
6938 break; |
|
6939 |
|
6940 /**** |
|
6941 *TIME_TO_UINT |
|
6942 */ |
|
6943 case function_time_to_uint : |
|
6944 { |
|
6945 symbol_c *last_type_symbol = NULL; |
|
6946 |
|
6947 { |
|
6948 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6949 symbol_c *IN_param_value = &this->default_variable_name; |
|
6950 |
|
6951 symbol_c *IN_type_symbol = param_data_type; |
|
6952 last_type_symbol = param_data_type; |
|
6953 |
|
6954 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6955 { |
|
6956 |
|
6957 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
6958 s4o.print("("); |
|
6959 return_type_symbol->accept(*this); |
|
6960 s4o.print(")__time_to_int("); |
|
6961 IN_param_value->accept(*this); |
|
6962 s4o.print(")"); |
|
6963 return NULL; |
|
6964 |
|
6965 } |
|
6966 |
|
6967 ERROR; |
|
6968 } |
|
6969 |
|
6970 }/*function_time_to_uint*/ |
|
6971 break; |
|
6972 |
|
6973 /**** |
|
6974 *TIME_TO_UDINT |
|
6975 */ |
|
6976 case function_time_to_udint : |
|
6977 { |
|
6978 symbol_c *last_type_symbol = NULL; |
|
6979 |
|
6980 { |
|
6981 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
6982 symbol_c *IN_param_value = &this->default_variable_name; |
|
6983 |
|
6984 symbol_c *IN_type_symbol = param_data_type; |
|
6985 last_type_symbol = param_data_type; |
|
6986 |
|
6987 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
6988 { |
|
6989 |
|
6990 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
6991 s4o.print("("); |
|
6992 return_type_symbol->accept(*this); |
|
6993 s4o.print(")__time_to_int("); |
|
6994 IN_param_value->accept(*this); |
|
6995 s4o.print(")"); |
|
6996 return NULL; |
|
6997 |
|
6998 } |
|
6999 |
|
7000 ERROR; |
|
7001 } |
|
7002 |
|
7003 }/*function_time_to_udint*/ |
|
7004 break; |
|
7005 |
|
7006 /**** |
|
7007 *TIME_TO_ULINT |
|
7008 */ |
|
7009 case function_time_to_ulint : |
|
7010 { |
|
7011 symbol_c *last_type_symbol = NULL; |
|
7012 |
|
7013 { |
|
7014 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7015 symbol_c *IN_param_value = &this->default_variable_name; |
|
7016 |
|
7017 symbol_c *IN_type_symbol = param_data_type; |
|
7018 last_type_symbol = param_data_type; |
|
7019 |
|
7020 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7021 { |
|
7022 |
|
7023 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
7024 s4o.print("("); |
|
7025 return_type_symbol->accept(*this); |
|
7026 s4o.print(")__time_to_int("); |
|
7027 IN_param_value->accept(*this); |
|
7028 s4o.print(")"); |
|
7029 return NULL; |
|
7030 |
|
7031 } |
|
7032 |
|
7033 ERROR; |
|
7034 } |
|
7035 |
|
7036 }/*function_time_to_ulint*/ |
|
7037 break; |
|
7038 |
|
7039 /**** |
|
7040 *TIME_TO_REAL |
|
7041 */ |
|
7042 case function_time_to_real : |
|
7043 { |
|
7044 symbol_c *last_type_symbol = NULL; |
|
7045 |
|
7046 { |
|
7047 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7048 symbol_c *IN_param_value = &this->default_variable_name; |
|
7049 |
|
7050 symbol_c *IN_type_symbol = param_data_type; |
|
7051 last_type_symbol = param_data_type; |
|
7052 |
|
7053 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7054 { |
|
7055 |
|
7056 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
7057 s4o.print("("); |
|
7058 return_type_symbol->accept(*this); |
|
7059 s4o.print(")__time_to_real("); |
|
7060 IN_param_value->accept(*this); |
|
7061 s4o.print(")"); |
|
7062 return NULL; |
|
7063 |
|
7064 } |
|
7065 |
|
7066 ERROR; |
|
7067 } |
|
7068 |
|
7069 }/*function_time_to_real*/ |
|
7070 break; |
|
7071 |
|
7072 /**** |
|
7073 *TIME_TO_LREAL |
|
7074 */ |
|
7075 case function_time_to_lreal : |
|
7076 { |
|
7077 symbol_c *last_type_symbol = NULL; |
|
7078 |
|
7079 { |
|
7080 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7081 symbol_c *IN_param_value = &this->default_variable_name; |
|
7082 |
|
7083 symbol_c *IN_type_symbol = param_data_type; |
|
7084 last_type_symbol = param_data_type; |
|
7085 |
|
7086 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7087 { |
|
7088 |
|
7089 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
7090 s4o.print("("); |
|
7091 return_type_symbol->accept(*this); |
|
7092 s4o.print(")__time_to_real("); |
|
7093 IN_param_value->accept(*this); |
|
7094 s4o.print(")"); |
|
7095 return NULL; |
|
7096 |
|
7097 } |
|
7098 |
|
7099 ERROR; |
|
7100 } |
|
7101 |
|
7102 }/*function_time_to_lreal*/ |
|
7103 break; |
|
7104 |
|
7105 /**** |
|
7106 *TIME_TO_STRING |
|
7107 */ |
|
7108 case function_time_to_string : |
|
7109 { |
|
7110 symbol_c *last_type_symbol = NULL; |
|
7111 |
|
7112 { |
|
7113 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7114 symbol_c *IN_param_value = &this->default_variable_name; |
|
7115 |
|
7116 symbol_c *IN_type_symbol = param_data_type; |
|
7117 last_type_symbol = param_data_type; |
|
7118 |
|
7119 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7120 { |
|
7121 |
|
7122 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
7123 s4o.print("("); |
|
7124 return_type_symbol->accept(*this); |
|
7125 s4o.print(")__time_to_string("); |
|
7126 IN_param_value->accept(*this); |
|
7127 s4o.print(")"); |
|
7128 return NULL; |
|
7129 |
|
7130 } |
|
7131 |
|
7132 ERROR; |
|
7133 } |
|
7134 |
|
7135 }/*function_time_to_string*/ |
|
7136 break; |
|
7137 |
|
7138 /**** |
|
7139 *TIME_TO_BYTE |
|
7140 */ |
|
7141 case function_time_to_byte : |
|
7142 { |
|
7143 symbol_c *last_type_symbol = NULL; |
|
7144 |
|
7145 { |
|
7146 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7147 symbol_c *IN_param_value = &this->default_variable_name; |
|
7148 |
|
7149 symbol_c *IN_type_symbol = param_data_type; |
|
7150 last_type_symbol = param_data_type; |
|
7151 |
|
7152 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7153 { |
|
7154 |
|
7155 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
7156 s4o.print("("); |
|
7157 return_type_symbol->accept(*this); |
|
7158 s4o.print(")__time_to_int("); |
|
7159 IN_param_value->accept(*this); |
|
7160 s4o.print(")"); |
|
7161 return NULL; |
|
7162 |
|
7163 } |
|
7164 |
|
7165 ERROR; |
|
7166 } |
|
7167 |
|
7168 }/*function_time_to_byte*/ |
|
7169 break; |
|
7170 |
|
7171 /**** |
|
7172 *TIME_TO_WORD |
|
7173 */ |
|
7174 case function_time_to_word : |
|
7175 { |
|
7176 symbol_c *last_type_symbol = NULL; |
|
7177 |
|
7178 { |
|
7179 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7180 symbol_c *IN_param_value = &this->default_variable_name; |
|
7181 |
|
7182 symbol_c *IN_type_symbol = param_data_type; |
|
7183 last_type_symbol = param_data_type; |
|
7184 |
|
7185 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7186 { |
|
7187 |
|
7188 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
7189 s4o.print("("); |
|
7190 return_type_symbol->accept(*this); |
|
7191 s4o.print(")__time_to_int("); |
|
7192 IN_param_value->accept(*this); |
|
7193 s4o.print(")"); |
|
7194 return NULL; |
|
7195 |
|
7196 } |
|
7197 |
|
7198 ERROR; |
|
7199 } |
|
7200 |
|
7201 }/*function_time_to_word*/ |
|
7202 break; |
|
7203 |
|
7204 /**** |
|
7205 *TIME_TO_DWORD |
|
7206 */ |
|
7207 case function_time_to_dword : |
|
7208 { |
|
7209 symbol_c *last_type_symbol = NULL; |
|
7210 |
|
7211 { |
|
7212 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7213 symbol_c *IN_param_value = &this->default_variable_name; |
|
7214 |
|
7215 symbol_c *IN_type_symbol = param_data_type; |
|
7216 last_type_symbol = param_data_type; |
|
7217 |
|
7218 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7219 { |
|
7220 |
|
7221 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
7222 s4o.print("("); |
|
7223 return_type_symbol->accept(*this); |
|
7224 s4o.print(")__time_to_int("); |
|
7225 IN_param_value->accept(*this); |
|
7226 s4o.print(")"); |
|
7227 return NULL; |
|
7228 |
|
7229 } |
|
7230 |
|
7231 ERROR; |
|
7232 } |
|
7233 |
|
7234 }/*function_time_to_dword*/ |
|
7235 break; |
|
7236 |
|
7237 /**** |
|
7238 *TIME_TO_LWORD |
|
7239 */ |
|
7240 case function_time_to_lword : |
|
7241 { |
|
7242 symbol_c *last_type_symbol = NULL; |
|
7243 |
|
7244 { |
|
7245 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7246 symbol_c *IN_param_value = &this->default_variable_name; |
|
7247 |
|
7248 symbol_c *IN_type_symbol = param_data_type; |
|
7249 last_type_symbol = param_data_type; |
|
7250 |
|
7251 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
7252 { |
|
7253 |
|
7254 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
7255 s4o.print("("); |
|
7256 return_type_symbol->accept(*this); |
|
7257 s4o.print(")__time_to_int("); |
|
7258 IN_param_value->accept(*this); |
|
7259 s4o.print(")"); |
|
7260 return NULL; |
|
7261 |
|
7262 } |
|
7263 |
|
7264 ERROR; |
|
7265 } |
|
7266 |
|
7267 }/*function_time_to_lword*/ |
|
7268 break; |
|
7269 |
|
7270 /**** |
|
7271 *DATE_TO_SINT |
|
7272 */ |
|
7273 case function_date_to_sint : |
|
7274 { |
|
7275 symbol_c *last_type_symbol = NULL; |
|
7276 |
|
7277 { |
|
7278 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7279 symbol_c *IN_param_value = &this->default_variable_name; |
|
7280 |
|
7281 symbol_c *IN_type_symbol = param_data_type; |
|
7282 last_type_symbol = param_data_type; |
|
7283 |
|
7284 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7285 { |
|
7286 |
|
7287 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
7288 s4o.print("("); |
|
7289 return_type_symbol->accept(*this); |
|
7290 s4o.print(")__time_to_int("); |
|
7291 IN_param_value->accept(*this); |
|
7292 s4o.print(")"); |
|
7293 return NULL; |
|
7294 |
|
7295 } |
|
7296 |
|
7297 ERROR; |
|
7298 } |
|
7299 |
|
7300 }/*function_date_to_sint*/ |
|
7301 break; |
|
7302 |
|
7303 /**** |
|
7304 *DATE_TO_INT |
|
7305 */ |
|
7306 case function_date_to_int : |
|
7307 { |
|
7308 symbol_c *last_type_symbol = NULL; |
|
7309 |
|
7310 { |
|
7311 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7312 symbol_c *IN_param_value = &this->default_variable_name; |
|
7313 |
|
7314 symbol_c *IN_type_symbol = param_data_type; |
|
7315 last_type_symbol = param_data_type; |
|
7316 |
|
7317 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7318 { |
|
7319 |
|
7320 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
7321 s4o.print("("); |
|
7322 return_type_symbol->accept(*this); |
|
7323 s4o.print(")__time_to_int("); |
|
7324 IN_param_value->accept(*this); |
|
7325 s4o.print(")"); |
|
7326 return NULL; |
|
7327 |
|
7328 } |
|
7329 |
|
7330 ERROR; |
|
7331 } |
|
7332 |
|
7333 }/*function_date_to_int*/ |
|
7334 break; |
|
7335 |
|
7336 /**** |
|
7337 *DATE_TO_DINT |
|
7338 */ |
|
7339 case function_date_to_dint : |
|
7340 { |
|
7341 symbol_c *last_type_symbol = NULL; |
|
7342 |
|
7343 { |
|
7344 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7345 symbol_c *IN_param_value = &this->default_variable_name; |
|
7346 |
|
7347 symbol_c *IN_type_symbol = param_data_type; |
|
7348 last_type_symbol = param_data_type; |
|
7349 |
|
7350 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7351 { |
|
7352 |
|
7353 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
7354 s4o.print("("); |
|
7355 return_type_symbol->accept(*this); |
|
7356 s4o.print(")__time_to_int("); |
|
7357 IN_param_value->accept(*this); |
|
7358 s4o.print(")"); |
|
7359 return NULL; |
|
7360 |
|
7361 } |
|
7362 |
|
7363 ERROR; |
|
7364 } |
|
7365 |
|
7366 }/*function_date_to_dint*/ |
|
7367 break; |
|
7368 |
|
7369 /**** |
|
7370 *DATE_TO_LINT |
|
7371 */ |
|
7372 case function_date_to_lint : |
|
7373 { |
|
7374 symbol_c *last_type_symbol = NULL; |
|
7375 |
|
7376 { |
|
7377 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7378 symbol_c *IN_param_value = &this->default_variable_name; |
|
7379 |
|
7380 symbol_c *IN_type_symbol = param_data_type; |
|
7381 last_type_symbol = param_data_type; |
|
7382 |
|
7383 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7384 { |
|
7385 |
|
7386 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
7387 s4o.print("("); |
|
7388 return_type_symbol->accept(*this); |
|
7389 s4o.print(")__time_to_int("); |
|
7390 IN_param_value->accept(*this); |
|
7391 s4o.print(")"); |
|
7392 return NULL; |
|
7393 |
|
7394 } |
|
7395 |
|
7396 ERROR; |
|
7397 } |
|
7398 |
|
7399 }/*function_date_to_lint*/ |
|
7400 break; |
|
7401 |
|
7402 /**** |
|
7403 *DATE_TO_USINT |
|
7404 */ |
|
7405 case function_date_to_usint : |
|
7406 { |
|
7407 symbol_c *last_type_symbol = NULL; |
|
7408 |
|
7409 { |
|
7410 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7411 symbol_c *IN_param_value = &this->default_variable_name; |
|
7412 |
|
7413 symbol_c *IN_type_symbol = param_data_type; |
|
7414 last_type_symbol = param_data_type; |
|
7415 |
|
7416 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7417 { |
|
7418 |
|
7419 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
7420 s4o.print("("); |
|
7421 return_type_symbol->accept(*this); |
|
7422 s4o.print(")__time_to_int("); |
|
7423 IN_param_value->accept(*this); |
|
7424 s4o.print(")"); |
|
7425 return NULL; |
|
7426 |
|
7427 } |
|
7428 |
|
7429 ERROR; |
|
7430 } |
|
7431 |
|
7432 }/*function_date_to_usint*/ |
|
7433 break; |
|
7434 |
|
7435 /**** |
|
7436 *DATE_TO_UINT |
|
7437 */ |
|
7438 case function_date_to_uint : |
|
7439 { |
|
7440 symbol_c *last_type_symbol = NULL; |
|
7441 |
|
7442 { |
|
7443 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7444 symbol_c *IN_param_value = &this->default_variable_name; |
|
7445 |
|
7446 symbol_c *IN_type_symbol = param_data_type; |
|
7447 last_type_symbol = param_data_type; |
|
7448 |
|
7449 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7450 { |
|
7451 |
|
7452 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
7453 s4o.print("("); |
|
7454 return_type_symbol->accept(*this); |
|
7455 s4o.print(")__time_to_int("); |
|
7456 IN_param_value->accept(*this); |
|
7457 s4o.print(")"); |
|
7458 return NULL; |
|
7459 |
|
7460 } |
|
7461 |
|
7462 ERROR; |
|
7463 } |
|
7464 |
|
7465 }/*function_date_to_uint*/ |
|
7466 break; |
|
7467 |
|
7468 /**** |
|
7469 *DATE_TO_UDINT |
|
7470 */ |
|
7471 case function_date_to_udint : |
|
7472 { |
|
7473 symbol_c *last_type_symbol = NULL; |
|
7474 |
|
7475 { |
|
7476 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7477 symbol_c *IN_param_value = &this->default_variable_name; |
|
7478 |
|
7479 symbol_c *IN_type_symbol = param_data_type; |
|
7480 last_type_symbol = param_data_type; |
|
7481 |
|
7482 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7483 { |
|
7484 |
|
7485 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
7486 s4o.print("("); |
|
7487 return_type_symbol->accept(*this); |
|
7488 s4o.print(")__time_to_int("); |
|
7489 IN_param_value->accept(*this); |
|
7490 s4o.print(")"); |
|
7491 return NULL; |
|
7492 |
|
7493 } |
|
7494 |
|
7495 ERROR; |
|
7496 } |
|
7497 |
|
7498 }/*function_date_to_udint*/ |
|
7499 break; |
|
7500 |
|
7501 /**** |
|
7502 *DATE_TO_ULINT |
|
7503 */ |
|
7504 case function_date_to_ulint : |
|
7505 { |
|
7506 symbol_c *last_type_symbol = NULL; |
|
7507 |
|
7508 { |
|
7509 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7510 symbol_c *IN_param_value = &this->default_variable_name; |
|
7511 |
|
7512 symbol_c *IN_type_symbol = param_data_type; |
|
7513 last_type_symbol = param_data_type; |
|
7514 |
|
7515 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7516 { |
|
7517 |
|
7518 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
7519 s4o.print("("); |
|
7520 return_type_symbol->accept(*this); |
|
7521 s4o.print(")__time_to_int("); |
|
7522 IN_param_value->accept(*this); |
|
7523 s4o.print(")"); |
|
7524 return NULL; |
|
7525 |
|
7526 } |
|
7527 |
|
7528 ERROR; |
|
7529 } |
|
7530 |
|
7531 }/*function_date_to_ulint*/ |
|
7532 break; |
|
7533 |
|
7534 /**** |
|
7535 *DATE_TO_REAL |
|
7536 */ |
|
7537 case function_date_to_real : |
|
7538 { |
|
7539 symbol_c *last_type_symbol = NULL; |
|
7540 |
|
7541 { |
|
7542 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7543 symbol_c *IN_param_value = &this->default_variable_name; |
|
7544 |
|
7545 symbol_c *IN_type_symbol = param_data_type; |
|
7546 last_type_symbol = param_data_type; |
|
7547 |
|
7548 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7549 { |
|
7550 |
|
7551 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
7552 s4o.print("("); |
|
7553 return_type_symbol->accept(*this); |
|
7554 s4o.print(")__time_to_real("); |
|
7555 IN_param_value->accept(*this); |
|
7556 s4o.print(")"); |
|
7557 return NULL; |
|
7558 |
|
7559 } |
|
7560 |
|
7561 ERROR; |
|
7562 } |
|
7563 |
|
7564 }/*function_date_to_real*/ |
|
7565 break; |
|
7566 |
|
7567 /**** |
|
7568 *DATE_TO_LREAL |
|
7569 */ |
|
7570 case function_date_to_lreal : |
|
7571 { |
|
7572 symbol_c *last_type_symbol = NULL; |
|
7573 |
|
7574 { |
|
7575 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7576 symbol_c *IN_param_value = &this->default_variable_name; |
|
7577 |
|
7578 symbol_c *IN_type_symbol = param_data_type; |
|
7579 last_type_symbol = param_data_type; |
|
7580 |
|
7581 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7582 { |
|
7583 |
|
7584 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
7585 s4o.print("("); |
|
7586 return_type_symbol->accept(*this); |
|
7587 s4o.print(")__time_to_real("); |
|
7588 IN_param_value->accept(*this); |
|
7589 s4o.print(")"); |
|
7590 return NULL; |
|
7591 |
|
7592 } |
|
7593 |
|
7594 ERROR; |
|
7595 } |
|
7596 |
|
7597 }/*function_date_to_lreal*/ |
|
7598 break; |
|
7599 |
|
7600 /**** |
|
7601 *DATE_TO_STRING |
|
7602 */ |
|
7603 case function_date_to_string : |
|
7604 { |
|
7605 symbol_c *last_type_symbol = NULL; |
|
7606 |
|
7607 { |
|
7608 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7609 symbol_c *IN_param_value = &this->default_variable_name; |
|
7610 |
|
7611 symbol_c *IN_type_symbol = param_data_type; |
|
7612 last_type_symbol = param_data_type; |
|
7613 |
|
7614 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7615 { |
|
7616 |
|
7617 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
7618 s4o.print("("); |
|
7619 return_type_symbol->accept(*this); |
|
7620 s4o.print(")__date_to_string("); |
|
7621 IN_param_value->accept(*this); |
|
7622 s4o.print(")"); |
|
7623 return NULL; |
|
7624 |
|
7625 } |
|
7626 |
|
7627 ERROR; |
|
7628 } |
|
7629 |
|
7630 }/*function_date_to_string*/ |
|
7631 break; |
|
7632 |
|
7633 /**** |
|
7634 *DATE_TO_BYTE |
|
7635 */ |
|
7636 case function_date_to_byte : |
|
7637 { |
|
7638 symbol_c *last_type_symbol = NULL; |
|
7639 |
|
7640 { |
|
7641 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7642 symbol_c *IN_param_value = &this->default_variable_name; |
|
7643 |
|
7644 symbol_c *IN_type_symbol = param_data_type; |
|
7645 last_type_symbol = param_data_type; |
|
7646 |
|
7647 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7648 { |
|
7649 |
|
7650 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
7651 s4o.print("("); |
|
7652 return_type_symbol->accept(*this); |
|
7653 s4o.print(")__time_to_int("); |
|
7654 IN_param_value->accept(*this); |
|
7655 s4o.print(")"); |
|
7656 return NULL; |
|
7657 |
|
7658 } |
|
7659 |
|
7660 ERROR; |
|
7661 } |
|
7662 |
|
7663 }/*function_date_to_byte*/ |
|
7664 break; |
|
7665 |
|
7666 /**** |
|
7667 *DATE_TO_WORD |
|
7668 */ |
|
7669 case function_date_to_word : |
|
7670 { |
|
7671 symbol_c *last_type_symbol = NULL; |
|
7672 |
|
7673 { |
|
7674 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7675 symbol_c *IN_param_value = &this->default_variable_name; |
|
7676 |
|
7677 symbol_c *IN_type_symbol = param_data_type; |
|
7678 last_type_symbol = param_data_type; |
|
7679 |
|
7680 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7681 { |
|
7682 |
|
7683 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
7684 s4o.print("("); |
|
7685 return_type_symbol->accept(*this); |
|
7686 s4o.print(")__time_to_int("); |
|
7687 IN_param_value->accept(*this); |
|
7688 s4o.print(")"); |
|
7689 return NULL; |
|
7690 |
|
7691 } |
|
7692 |
|
7693 ERROR; |
|
7694 } |
|
7695 |
|
7696 }/*function_date_to_word*/ |
|
7697 break; |
|
7698 |
|
7699 /**** |
|
7700 *DATE_TO_DWORD |
|
7701 */ |
|
7702 case function_date_to_dword : |
|
7703 { |
|
7704 symbol_c *last_type_symbol = NULL; |
|
7705 |
|
7706 { |
|
7707 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7708 symbol_c *IN_param_value = &this->default_variable_name; |
|
7709 |
|
7710 symbol_c *IN_type_symbol = param_data_type; |
|
7711 last_type_symbol = param_data_type; |
|
7712 |
|
7713 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7714 { |
|
7715 |
|
7716 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
7717 s4o.print("("); |
|
7718 return_type_symbol->accept(*this); |
|
7719 s4o.print(")__time_to_int("); |
|
7720 IN_param_value->accept(*this); |
|
7721 s4o.print(")"); |
|
7722 return NULL; |
|
7723 |
|
7724 } |
|
7725 |
|
7726 ERROR; |
|
7727 } |
|
7728 |
|
7729 }/*function_date_to_dword*/ |
|
7730 break; |
|
7731 |
|
7732 /**** |
|
7733 *DATE_TO_LWORD |
|
7734 */ |
|
7735 case function_date_to_lword : |
|
7736 { |
|
7737 symbol_c *last_type_symbol = NULL; |
|
7738 |
|
7739 { |
|
7740 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7741 symbol_c *IN_param_value = &this->default_variable_name; |
|
7742 |
|
7743 symbol_c *IN_type_symbol = param_data_type; |
|
7744 last_type_symbol = param_data_type; |
|
7745 |
|
7746 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
7747 { |
|
7748 |
|
7749 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
7750 s4o.print("("); |
|
7751 return_type_symbol->accept(*this); |
|
7752 s4o.print(")__time_to_int("); |
|
7753 IN_param_value->accept(*this); |
|
7754 s4o.print(")"); |
|
7755 return NULL; |
|
7756 |
|
7757 } |
|
7758 |
|
7759 ERROR; |
|
7760 } |
|
7761 |
|
7762 }/*function_date_to_lword*/ |
|
7763 break; |
|
7764 |
|
7765 /**** |
|
7766 *TOD_TO_SINT |
|
7767 */ |
|
7768 case function_tod_to_sint : |
|
7769 { |
|
7770 symbol_c *last_type_symbol = NULL; |
|
7771 |
|
7772 { |
|
7773 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7774 symbol_c *IN_param_value = &this->default_variable_name; |
|
7775 |
|
7776 symbol_c *IN_type_symbol = param_data_type; |
|
7777 last_type_symbol = param_data_type; |
|
7778 |
|
7779 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7780 { |
|
7781 |
|
7782 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
7783 s4o.print("("); |
|
7784 return_type_symbol->accept(*this); |
|
7785 s4o.print(")__time_to_int("); |
|
7786 IN_param_value->accept(*this); |
|
7787 s4o.print(")"); |
|
7788 return NULL; |
|
7789 |
|
7790 } |
|
7791 |
|
7792 ERROR; |
|
7793 } |
|
7794 |
|
7795 }/*function_tod_to_sint*/ |
|
7796 break; |
|
7797 |
|
7798 /**** |
|
7799 *TOD_TO_INT |
|
7800 */ |
|
7801 case function_tod_to_int : |
|
7802 { |
|
7803 symbol_c *last_type_symbol = NULL; |
|
7804 |
|
7805 { |
|
7806 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7807 symbol_c *IN_param_value = &this->default_variable_name; |
|
7808 |
|
7809 symbol_c *IN_type_symbol = param_data_type; |
|
7810 last_type_symbol = param_data_type; |
|
7811 |
|
7812 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7813 { |
|
7814 |
|
7815 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
7816 s4o.print("("); |
|
7817 return_type_symbol->accept(*this); |
|
7818 s4o.print(")__time_to_int("); |
|
7819 IN_param_value->accept(*this); |
|
7820 s4o.print(")"); |
|
7821 return NULL; |
|
7822 |
|
7823 } |
|
7824 |
|
7825 ERROR; |
|
7826 } |
|
7827 |
|
7828 }/*function_tod_to_int*/ |
|
7829 break; |
|
7830 |
|
7831 /**** |
|
7832 *TOD_TO_DINT |
|
7833 */ |
|
7834 case function_tod_to_dint : |
|
7835 { |
|
7836 symbol_c *last_type_symbol = NULL; |
|
7837 |
|
7838 { |
|
7839 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7840 symbol_c *IN_param_value = &this->default_variable_name; |
|
7841 |
|
7842 symbol_c *IN_type_symbol = param_data_type; |
|
7843 last_type_symbol = param_data_type; |
|
7844 |
|
7845 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7846 { |
|
7847 |
|
7848 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
7849 s4o.print("("); |
|
7850 return_type_symbol->accept(*this); |
|
7851 s4o.print(")__time_to_int("); |
|
7852 IN_param_value->accept(*this); |
|
7853 s4o.print(")"); |
|
7854 return NULL; |
|
7855 |
|
7856 } |
|
7857 |
|
7858 ERROR; |
|
7859 } |
|
7860 |
|
7861 }/*function_tod_to_dint*/ |
|
7862 break; |
|
7863 |
|
7864 /**** |
|
7865 *TOD_TO_LINT |
|
7866 */ |
|
7867 case function_tod_to_lint : |
|
7868 { |
|
7869 symbol_c *last_type_symbol = NULL; |
|
7870 |
|
7871 { |
|
7872 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7873 symbol_c *IN_param_value = &this->default_variable_name; |
|
7874 |
|
7875 symbol_c *IN_type_symbol = param_data_type; |
|
7876 last_type_symbol = param_data_type; |
|
7877 |
|
7878 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7879 { |
|
7880 |
|
7881 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
7882 s4o.print("("); |
|
7883 return_type_symbol->accept(*this); |
|
7884 s4o.print(")__time_to_int("); |
|
7885 IN_param_value->accept(*this); |
|
7886 s4o.print(")"); |
|
7887 return NULL; |
|
7888 |
|
7889 } |
|
7890 |
|
7891 ERROR; |
|
7892 } |
|
7893 |
|
7894 }/*function_tod_to_lint*/ |
|
7895 break; |
|
7896 |
|
7897 /**** |
|
7898 *TOD_TO_USINT |
|
7899 */ |
|
7900 case function_tod_to_usint : |
|
7901 { |
|
7902 symbol_c *last_type_symbol = NULL; |
|
7903 |
|
7904 { |
|
7905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7906 symbol_c *IN_param_value = &this->default_variable_name; |
|
7907 |
|
7908 symbol_c *IN_type_symbol = param_data_type; |
|
7909 last_type_symbol = param_data_type; |
|
7910 |
|
7911 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7912 { |
|
7913 |
|
7914 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
7915 s4o.print("("); |
|
7916 return_type_symbol->accept(*this); |
|
7917 s4o.print(")__time_to_int("); |
|
7918 IN_param_value->accept(*this); |
|
7919 s4o.print(")"); |
|
7920 return NULL; |
|
7921 |
|
7922 } |
|
7923 |
|
7924 ERROR; |
|
7925 } |
|
7926 |
|
7927 }/*function_tod_to_usint*/ |
|
7928 break; |
|
7929 |
|
7930 /**** |
|
7931 *TOD_TO_UINT |
|
7932 */ |
|
7933 case function_tod_to_uint : |
|
7934 { |
|
7935 symbol_c *last_type_symbol = NULL; |
|
7936 |
|
7937 { |
|
7938 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7939 symbol_c *IN_param_value = &this->default_variable_name; |
|
7940 |
|
7941 symbol_c *IN_type_symbol = param_data_type; |
|
7942 last_type_symbol = param_data_type; |
|
7943 |
|
7944 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7945 { |
|
7946 |
|
7947 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
7948 s4o.print("("); |
|
7949 return_type_symbol->accept(*this); |
|
7950 s4o.print(")__time_to_int("); |
|
7951 IN_param_value->accept(*this); |
|
7952 s4o.print(")"); |
|
7953 return NULL; |
|
7954 |
|
7955 } |
|
7956 |
|
7957 ERROR; |
|
7958 } |
|
7959 |
|
7960 }/*function_tod_to_uint*/ |
|
7961 break; |
|
7962 |
|
7963 /**** |
|
7964 *TOD_TO_UDINT |
|
7965 */ |
|
7966 case function_tod_to_udint : |
|
7967 { |
|
7968 symbol_c *last_type_symbol = NULL; |
|
7969 |
|
7970 { |
|
7971 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
7972 symbol_c *IN_param_value = &this->default_variable_name; |
|
7973 |
|
7974 symbol_c *IN_type_symbol = param_data_type; |
|
7975 last_type_symbol = param_data_type; |
|
7976 |
|
7977 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
7978 { |
|
7979 |
|
7980 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
7981 s4o.print("("); |
|
7982 return_type_symbol->accept(*this); |
|
7983 s4o.print(")__time_to_int("); |
|
7984 IN_param_value->accept(*this); |
|
7985 s4o.print(")"); |
|
7986 return NULL; |
|
7987 |
|
7988 } |
|
7989 |
|
7990 ERROR; |
|
7991 } |
|
7992 |
|
7993 }/*function_tod_to_udint*/ |
|
7994 break; |
|
7995 |
|
7996 /**** |
|
7997 *TOD_TO_ULINT |
|
7998 */ |
|
7999 case function_tod_to_ulint : |
|
8000 { |
|
8001 symbol_c *last_type_symbol = NULL; |
|
8002 |
|
8003 { |
|
8004 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8005 symbol_c *IN_param_value = &this->default_variable_name; |
|
8006 |
|
8007 symbol_c *IN_type_symbol = param_data_type; |
|
8008 last_type_symbol = param_data_type; |
|
8009 |
|
8010 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8011 { |
|
8012 |
|
8013 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
8014 s4o.print("("); |
|
8015 return_type_symbol->accept(*this); |
|
8016 s4o.print(")__time_to_int("); |
|
8017 IN_param_value->accept(*this); |
|
8018 s4o.print(")"); |
|
8019 return NULL; |
|
8020 |
|
8021 } |
|
8022 |
|
8023 ERROR; |
|
8024 } |
|
8025 |
|
8026 }/*function_tod_to_ulint*/ |
|
8027 break; |
|
8028 |
|
8029 /**** |
|
8030 *TOD_TO_REAL |
|
8031 */ |
|
8032 case function_tod_to_real : |
|
8033 { |
|
8034 symbol_c *last_type_symbol = NULL; |
|
8035 |
|
8036 { |
|
8037 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8038 symbol_c *IN_param_value = &this->default_variable_name; |
|
8039 |
|
8040 symbol_c *IN_type_symbol = param_data_type; |
|
8041 last_type_symbol = param_data_type; |
|
8042 |
|
8043 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8044 { |
|
8045 |
|
8046 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
8047 s4o.print("("); |
|
8048 return_type_symbol->accept(*this); |
|
8049 s4o.print(")__time_to_real("); |
|
8050 IN_param_value->accept(*this); |
|
8051 s4o.print(")"); |
|
8052 return NULL; |
|
8053 |
|
8054 } |
|
8055 |
|
8056 ERROR; |
|
8057 } |
|
8058 |
|
8059 }/*function_tod_to_real*/ |
|
8060 break; |
|
8061 |
|
8062 /**** |
|
8063 *TOD_TO_LREAL |
|
8064 */ |
|
8065 case function_tod_to_lreal : |
|
8066 { |
|
8067 symbol_c *last_type_symbol = NULL; |
|
8068 |
|
8069 { |
|
8070 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8071 symbol_c *IN_param_value = &this->default_variable_name; |
|
8072 |
|
8073 symbol_c *IN_type_symbol = param_data_type; |
|
8074 last_type_symbol = param_data_type; |
|
8075 |
|
8076 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8077 { |
|
8078 |
|
8079 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
8080 s4o.print("("); |
|
8081 return_type_symbol->accept(*this); |
|
8082 s4o.print(")__time_to_real("); |
|
8083 IN_param_value->accept(*this); |
|
8084 s4o.print(")"); |
|
8085 return NULL; |
|
8086 |
|
8087 } |
|
8088 |
|
8089 ERROR; |
|
8090 } |
|
8091 |
|
8092 }/*function_tod_to_lreal*/ |
|
8093 break; |
|
8094 |
|
8095 /**** |
|
8096 *TOD_TO_STRING |
|
8097 */ |
|
8098 case function_tod_to_string : |
|
8099 { |
|
8100 symbol_c *last_type_symbol = NULL; |
|
8101 |
|
8102 { |
|
8103 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8104 symbol_c *IN_param_value = &this->default_variable_name; |
|
8105 |
|
8106 symbol_c *IN_type_symbol = param_data_type; |
|
8107 last_type_symbol = param_data_type; |
|
8108 |
|
8109 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8110 { |
|
8111 |
|
8112 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
8113 s4o.print("("); |
|
8114 return_type_symbol->accept(*this); |
|
8115 s4o.print(")__tod_to_string("); |
|
8116 IN_param_value->accept(*this); |
|
8117 s4o.print(")"); |
|
8118 return NULL; |
|
8119 |
|
8120 } |
|
8121 |
|
8122 ERROR; |
|
8123 } |
|
8124 |
|
8125 }/*function_tod_to_string*/ |
|
8126 break; |
|
8127 |
|
8128 /**** |
|
8129 *TOD_TO_BYTE |
|
8130 */ |
|
8131 case function_tod_to_byte : |
|
8132 { |
|
8133 symbol_c *last_type_symbol = NULL; |
|
8134 |
|
8135 { |
|
8136 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8137 symbol_c *IN_param_value = &this->default_variable_name; |
|
8138 |
|
8139 symbol_c *IN_type_symbol = param_data_type; |
|
8140 last_type_symbol = param_data_type; |
|
8141 |
|
8142 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8143 { |
|
8144 |
|
8145 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
8146 s4o.print("("); |
|
8147 return_type_symbol->accept(*this); |
|
8148 s4o.print(")__time_to_int("); |
|
8149 IN_param_value->accept(*this); |
|
8150 s4o.print(")"); |
|
8151 return NULL; |
|
8152 |
|
8153 } |
|
8154 |
|
8155 ERROR; |
|
8156 } |
|
8157 |
|
8158 }/*function_tod_to_byte*/ |
|
8159 break; |
|
8160 |
|
8161 /**** |
|
8162 *TOD_TO_WORD |
|
8163 */ |
|
8164 case function_tod_to_word : |
|
8165 { |
|
8166 symbol_c *last_type_symbol = NULL; |
|
8167 |
|
8168 { |
|
8169 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8170 symbol_c *IN_param_value = &this->default_variable_name; |
|
8171 |
|
8172 symbol_c *IN_type_symbol = param_data_type; |
|
8173 last_type_symbol = param_data_type; |
|
8174 |
|
8175 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8176 { |
|
8177 |
|
8178 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
8179 s4o.print("("); |
|
8180 return_type_symbol->accept(*this); |
|
8181 s4o.print(")__time_to_int("); |
|
8182 IN_param_value->accept(*this); |
|
8183 s4o.print(")"); |
|
8184 return NULL; |
|
8185 |
|
8186 } |
|
8187 |
|
8188 ERROR; |
|
8189 } |
|
8190 |
|
8191 }/*function_tod_to_word*/ |
|
8192 break; |
|
8193 |
|
8194 /**** |
|
8195 *TOD_TO_DWORD |
|
8196 */ |
|
8197 case function_tod_to_dword : |
|
8198 { |
|
8199 symbol_c *last_type_symbol = NULL; |
|
8200 |
|
8201 { |
|
8202 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8203 symbol_c *IN_param_value = &this->default_variable_name; |
|
8204 |
|
8205 symbol_c *IN_type_symbol = param_data_type; |
|
8206 last_type_symbol = param_data_type; |
|
8207 |
|
8208 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8209 { |
|
8210 |
|
8211 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8212 s4o.print("("); |
|
8213 return_type_symbol->accept(*this); |
|
8214 s4o.print(")__time_to_int("); |
|
8215 IN_param_value->accept(*this); |
|
8216 s4o.print(")"); |
|
8217 return NULL; |
|
8218 |
|
8219 } |
|
8220 |
|
8221 ERROR; |
|
8222 } |
|
8223 |
|
8224 }/*function_tod_to_dword*/ |
|
8225 break; |
|
8226 |
|
8227 /**** |
|
8228 *TOD_TO_LWORD |
|
8229 */ |
|
8230 case function_tod_to_lword : |
|
8231 { |
|
8232 symbol_c *last_type_symbol = NULL; |
|
8233 |
|
8234 { |
|
8235 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8236 symbol_c *IN_param_value = &this->default_variable_name; |
|
8237 |
|
8238 symbol_c *IN_type_symbol = param_data_type; |
|
8239 last_type_symbol = param_data_type; |
|
8240 |
|
8241 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
8242 { |
|
8243 |
|
8244 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8245 s4o.print("("); |
|
8246 return_type_symbol->accept(*this); |
|
8247 s4o.print(")__time_to_int("); |
|
8248 IN_param_value->accept(*this); |
|
8249 s4o.print(")"); |
|
8250 return NULL; |
|
8251 |
|
8252 } |
|
8253 |
|
8254 ERROR; |
|
8255 } |
|
8256 |
|
8257 }/*function_tod_to_lword*/ |
|
8258 break; |
|
8259 |
|
8260 /**** |
|
8261 *DT_TO_SINT |
|
8262 */ |
|
8263 case function_dt_to_sint : |
|
8264 { |
|
8265 symbol_c *last_type_symbol = NULL; |
|
8266 |
|
8267 { |
|
8268 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8269 symbol_c *IN_param_value = &this->default_variable_name; |
|
8270 |
|
8271 symbol_c *IN_type_symbol = param_data_type; |
|
8272 last_type_symbol = param_data_type; |
|
8273 |
|
8274 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8275 { |
|
8276 |
|
8277 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8278 s4o.print("("); |
|
8279 return_type_symbol->accept(*this); |
|
8280 s4o.print(")__time_to_int("); |
|
8281 IN_param_value->accept(*this); |
|
8282 s4o.print(")"); |
|
8283 return NULL; |
|
8284 |
|
8285 } |
|
8286 |
|
8287 ERROR; |
|
8288 } |
|
8289 |
|
8290 }/*function_dt_to_sint*/ |
|
8291 break; |
|
8292 |
|
8293 /**** |
|
8294 *DT_TO_INT |
|
8295 */ |
|
8296 case function_dt_to_int : |
|
8297 { |
|
8298 symbol_c *last_type_symbol = NULL; |
|
8299 |
|
8300 { |
|
8301 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8302 symbol_c *IN_param_value = &this->default_variable_name; |
|
8303 |
|
8304 symbol_c *IN_type_symbol = param_data_type; |
|
8305 last_type_symbol = param_data_type; |
|
8306 |
|
8307 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8308 { |
|
8309 |
|
8310 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8311 s4o.print("("); |
|
8312 return_type_symbol->accept(*this); |
|
8313 s4o.print(")__time_to_int("); |
|
8314 IN_param_value->accept(*this); |
|
8315 s4o.print(")"); |
|
8316 return NULL; |
|
8317 |
|
8318 } |
|
8319 |
|
8320 ERROR; |
|
8321 } |
|
8322 |
|
8323 }/*function_dt_to_int*/ |
|
8324 break; |
|
8325 |
|
8326 /**** |
|
8327 *DT_TO_DINT |
|
8328 */ |
|
8329 case function_dt_to_dint : |
|
8330 { |
|
8331 symbol_c *last_type_symbol = NULL; |
|
8332 |
|
8333 { |
|
8334 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8335 symbol_c *IN_param_value = &this->default_variable_name; |
|
8336 |
|
8337 symbol_c *IN_type_symbol = param_data_type; |
|
8338 last_type_symbol = param_data_type; |
|
8339 |
|
8340 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8341 { |
|
8342 |
|
8343 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8344 s4o.print("("); |
|
8345 return_type_symbol->accept(*this); |
|
8346 s4o.print(")__time_to_int("); |
|
8347 IN_param_value->accept(*this); |
|
8348 s4o.print(")"); |
|
8349 return NULL; |
|
8350 |
|
8351 } |
|
8352 |
|
8353 ERROR; |
|
8354 } |
|
8355 |
|
8356 }/*function_dt_to_dint*/ |
|
8357 break; |
|
8358 |
|
8359 /**** |
|
8360 *DT_TO_LINT |
|
8361 */ |
|
8362 case function_dt_to_lint : |
|
8363 { |
|
8364 symbol_c *last_type_symbol = NULL; |
|
8365 |
|
8366 { |
|
8367 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8368 symbol_c *IN_param_value = &this->default_variable_name; |
|
8369 |
|
8370 symbol_c *IN_type_symbol = param_data_type; |
|
8371 last_type_symbol = param_data_type; |
|
8372 |
|
8373 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8374 { |
|
8375 |
|
8376 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8377 s4o.print("("); |
|
8378 return_type_symbol->accept(*this); |
|
8379 s4o.print(")__time_to_int("); |
|
8380 IN_param_value->accept(*this); |
|
8381 s4o.print(")"); |
|
8382 return NULL; |
|
8383 |
|
8384 } |
|
8385 |
|
8386 ERROR; |
|
8387 } |
|
8388 |
|
8389 }/*function_dt_to_lint*/ |
|
8390 break; |
|
8391 |
|
8392 /**** |
|
8393 *DT_TO_USINT |
|
8394 */ |
|
8395 case function_dt_to_usint : |
|
8396 { |
|
8397 symbol_c *last_type_symbol = NULL; |
|
8398 |
|
8399 { |
|
8400 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8401 symbol_c *IN_param_value = &this->default_variable_name; |
|
8402 |
|
8403 symbol_c *IN_type_symbol = param_data_type; |
|
8404 last_type_symbol = param_data_type; |
|
8405 |
|
8406 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8407 { |
|
8408 |
|
8409 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8410 s4o.print("("); |
|
8411 return_type_symbol->accept(*this); |
|
8412 s4o.print(")__time_to_int("); |
|
8413 IN_param_value->accept(*this); |
|
8414 s4o.print(")"); |
|
8415 return NULL; |
|
8416 |
|
8417 } |
|
8418 |
|
8419 ERROR; |
|
8420 } |
|
8421 |
|
8422 }/*function_dt_to_usint*/ |
|
8423 break; |
|
8424 |
|
8425 /**** |
|
8426 *DT_TO_UINT |
|
8427 */ |
|
8428 case function_dt_to_uint : |
|
8429 { |
|
8430 symbol_c *last_type_symbol = NULL; |
|
8431 |
|
8432 { |
|
8433 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8434 symbol_c *IN_param_value = &this->default_variable_name; |
|
8435 |
|
8436 symbol_c *IN_type_symbol = param_data_type; |
|
8437 last_type_symbol = param_data_type; |
|
8438 |
|
8439 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8440 { |
|
8441 |
|
8442 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
8443 s4o.print("("); |
|
8444 return_type_symbol->accept(*this); |
|
8445 s4o.print(")__time_to_int("); |
|
8446 IN_param_value->accept(*this); |
|
8447 s4o.print(")"); |
|
8448 return NULL; |
|
8449 |
|
8450 } |
|
8451 |
|
8452 ERROR; |
|
8453 } |
|
8454 |
|
8455 }/*function_dt_to_uint*/ |
|
8456 break; |
|
8457 |
|
8458 /**** |
|
8459 *DT_TO_UDINT |
|
8460 */ |
|
8461 case function_dt_to_udint : |
|
8462 { |
|
8463 symbol_c *last_type_symbol = NULL; |
|
8464 |
|
8465 { |
|
8466 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8467 symbol_c *IN_param_value = &this->default_variable_name; |
|
8468 |
|
8469 symbol_c *IN_type_symbol = param_data_type; |
|
8470 last_type_symbol = param_data_type; |
|
8471 |
|
8472 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8473 { |
|
8474 |
|
8475 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
8476 s4o.print("("); |
|
8477 return_type_symbol->accept(*this); |
|
8478 s4o.print(")__time_to_int("); |
|
8479 IN_param_value->accept(*this); |
|
8480 s4o.print(")"); |
|
8481 return NULL; |
|
8482 |
|
8483 } |
|
8484 |
|
8485 ERROR; |
|
8486 } |
|
8487 |
|
8488 }/*function_dt_to_udint*/ |
|
8489 break; |
|
8490 |
|
8491 /**** |
|
8492 *DT_TO_ULINT |
|
8493 */ |
|
8494 case function_dt_to_ulint : |
|
8495 { |
|
8496 symbol_c *last_type_symbol = NULL; |
|
8497 |
|
8498 { |
|
8499 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8500 symbol_c *IN_param_value = &this->default_variable_name; |
|
8501 |
|
8502 symbol_c *IN_type_symbol = param_data_type; |
|
8503 last_type_symbol = param_data_type; |
|
8504 |
|
8505 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8506 { |
|
8507 |
|
8508 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
8509 s4o.print("("); |
|
8510 return_type_symbol->accept(*this); |
|
8511 s4o.print(")__time_to_int("); |
|
8512 IN_param_value->accept(*this); |
|
8513 s4o.print(")"); |
|
8514 return NULL; |
|
8515 |
|
8516 } |
|
8517 |
|
8518 ERROR; |
|
8519 } |
|
8520 |
|
8521 }/*function_dt_to_ulint*/ |
|
8522 break; |
|
8523 |
|
8524 /**** |
|
8525 *DT_TO_REAL |
|
8526 */ |
|
8527 case function_dt_to_real : |
|
8528 { |
|
8529 symbol_c *last_type_symbol = NULL; |
|
8530 |
|
8531 { |
|
8532 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8533 symbol_c *IN_param_value = &this->default_variable_name; |
|
8534 |
|
8535 symbol_c *IN_type_symbol = param_data_type; |
|
8536 last_type_symbol = param_data_type; |
|
8537 |
|
8538 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8539 { |
|
8540 |
|
8541 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
8542 s4o.print("("); |
|
8543 return_type_symbol->accept(*this); |
|
8544 s4o.print(")__time_to_real("); |
|
8545 IN_param_value->accept(*this); |
|
8546 s4o.print(")"); |
|
8547 return NULL; |
|
8548 |
|
8549 } |
|
8550 |
|
8551 ERROR; |
|
8552 } |
|
8553 |
|
8554 }/*function_dt_to_real*/ |
|
8555 break; |
|
8556 |
|
8557 /**** |
|
8558 *DT_TO_LREAL |
|
8559 */ |
|
8560 case function_dt_to_lreal : |
|
8561 { |
|
8562 symbol_c *last_type_symbol = NULL; |
|
8563 |
|
8564 { |
|
8565 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8566 symbol_c *IN_param_value = &this->default_variable_name; |
|
8567 |
|
8568 symbol_c *IN_type_symbol = param_data_type; |
|
8569 last_type_symbol = param_data_type; |
|
8570 |
|
8571 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8572 { |
|
8573 |
|
8574 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
8575 s4o.print("("); |
|
8576 return_type_symbol->accept(*this); |
|
8577 s4o.print(")__time_to_real("); |
|
8578 IN_param_value->accept(*this); |
|
8579 s4o.print(")"); |
|
8580 return NULL; |
|
8581 |
|
8582 } |
|
8583 |
|
8584 ERROR; |
|
8585 } |
|
8586 |
|
8587 }/*function_dt_to_lreal*/ |
|
8588 break; |
|
8589 |
|
8590 /**** |
|
8591 *DT_TO_STRING |
|
8592 */ |
|
8593 case function_dt_to_string : |
|
8594 { |
|
8595 symbol_c *last_type_symbol = NULL; |
|
8596 |
|
8597 { |
|
8598 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8599 symbol_c *IN_param_value = &this->default_variable_name; |
|
8600 |
|
8601 symbol_c *IN_type_symbol = param_data_type; |
|
8602 last_type_symbol = param_data_type; |
|
8603 |
|
8604 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8605 { |
|
8606 |
|
8607 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
8608 s4o.print("("); |
|
8609 return_type_symbol->accept(*this); |
|
8610 s4o.print(")__dt_to_string("); |
|
8611 IN_param_value->accept(*this); |
|
8612 s4o.print(")"); |
|
8613 return NULL; |
|
8614 |
|
8615 } |
|
8616 |
|
8617 ERROR; |
|
8618 } |
|
8619 |
|
8620 }/*function_dt_to_string*/ |
|
8621 break; |
|
8622 |
|
8623 /**** |
|
8624 *DT_TO_BYTE |
|
8625 */ |
|
8626 case function_dt_to_byte : |
|
8627 { |
|
8628 symbol_c *last_type_symbol = NULL; |
|
8629 |
|
8630 { |
|
8631 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8632 symbol_c *IN_param_value = &this->default_variable_name; |
|
8633 |
|
8634 symbol_c *IN_type_symbol = param_data_type; |
|
8635 last_type_symbol = param_data_type; |
|
8636 |
|
8637 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8638 { |
|
8639 |
|
8640 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
8641 s4o.print("("); |
|
8642 return_type_symbol->accept(*this); |
|
8643 s4o.print(")__time_to_int("); |
|
8644 IN_param_value->accept(*this); |
|
8645 s4o.print(")"); |
|
8646 return NULL; |
|
8647 |
|
8648 } |
|
8649 |
|
8650 ERROR; |
|
8651 } |
|
8652 |
|
8653 }/*function_dt_to_byte*/ |
|
8654 break; |
|
8655 |
|
8656 /**** |
|
8657 *DT_TO_WORD |
|
8658 */ |
|
8659 case function_dt_to_word : |
|
8660 { |
|
8661 symbol_c *last_type_symbol = NULL; |
|
8662 |
|
8663 { |
|
8664 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8665 symbol_c *IN_param_value = &this->default_variable_name; |
|
8666 |
|
8667 symbol_c *IN_type_symbol = param_data_type; |
|
8668 last_type_symbol = param_data_type; |
|
8669 |
|
8670 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8671 { |
|
8672 |
|
8673 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
8674 s4o.print("("); |
|
8675 return_type_symbol->accept(*this); |
|
8676 s4o.print(")__time_to_int("); |
|
8677 IN_param_value->accept(*this); |
|
8678 s4o.print(")"); |
|
8679 return NULL; |
|
8680 |
|
8681 } |
|
8682 |
|
8683 ERROR; |
|
8684 } |
|
8685 |
|
8686 }/*function_dt_to_word*/ |
|
8687 break; |
|
8688 |
|
8689 /**** |
|
8690 *DT_TO_DWORD |
|
8691 */ |
|
8692 case function_dt_to_dword : |
|
8693 { |
|
8694 symbol_c *last_type_symbol = NULL; |
|
8695 |
|
8696 { |
|
8697 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8698 symbol_c *IN_param_value = &this->default_variable_name; |
|
8699 |
|
8700 symbol_c *IN_type_symbol = param_data_type; |
|
8701 last_type_symbol = param_data_type; |
|
8702 |
|
8703 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8704 { |
|
8705 |
|
8706 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
8707 s4o.print("("); |
|
8708 return_type_symbol->accept(*this); |
|
8709 s4o.print(")__time_to_int("); |
|
8710 IN_param_value->accept(*this); |
|
8711 s4o.print(")"); |
|
8712 return NULL; |
|
8713 |
|
8714 } |
|
8715 |
|
8716 ERROR; |
|
8717 } |
|
8718 |
|
8719 }/*function_dt_to_dword*/ |
|
8720 break; |
|
8721 |
|
8722 /**** |
|
8723 *DT_TO_LWORD |
|
8724 */ |
|
8725 case function_dt_to_lword : |
|
8726 { |
|
8727 symbol_c *last_type_symbol = NULL; |
|
8728 |
|
8729 { |
|
8730 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8731 symbol_c *IN_param_value = &this->default_variable_name; |
|
8732 |
|
8733 symbol_c *IN_type_symbol = param_data_type; |
|
8734 last_type_symbol = param_data_type; |
|
8735 |
|
8736 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
8737 { |
|
8738 |
|
8739 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
8740 s4o.print("("); |
|
8741 return_type_symbol->accept(*this); |
|
8742 s4o.print(")__time_to_int("); |
|
8743 IN_param_value->accept(*this); |
|
8744 s4o.print(")"); |
|
8745 return NULL; |
|
8746 |
|
8747 } |
|
8748 |
|
8749 ERROR; |
|
8750 } |
|
8751 |
|
8752 }/*function_dt_to_lword*/ |
|
8753 break; |
|
8754 |
|
8755 /**** |
|
8756 *STRING_TO_BOOL |
|
8757 */ |
|
8758 case function_string_to_bool : |
|
8759 { |
|
8760 symbol_c *last_type_symbol = NULL; |
|
8761 |
|
8762 { |
|
8763 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8764 symbol_c *IN_param_value = &this->default_variable_name; |
|
8765 |
|
8766 symbol_c *IN_type_symbol = param_data_type; |
|
8767 last_type_symbol = param_data_type; |
|
8768 |
|
8769 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8770 { |
|
8771 |
|
8772 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
8773 s4o.print("("); |
|
8774 return_type_symbol->accept(*this); |
|
8775 s4o.print(")__string_to_bool("); |
|
8776 IN_param_value->accept(*this); |
|
8777 s4o.print(")"); |
|
8778 return NULL; |
|
8779 |
|
8780 } |
|
8781 |
|
8782 ERROR; |
|
8783 } |
|
8784 |
|
8785 }/*function_string_to_bool*/ |
|
8786 break; |
|
8787 |
|
8788 /**** |
|
8789 *STRING_TO_SINT |
|
8790 */ |
|
8791 case function_string_to_sint : |
|
8792 { |
|
8793 symbol_c *last_type_symbol = NULL; |
|
8794 |
|
8795 { |
|
8796 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8797 symbol_c *IN_param_value = &this->default_variable_name; |
|
8798 |
|
8799 symbol_c *IN_type_symbol = param_data_type; |
|
8800 last_type_symbol = param_data_type; |
|
8801 |
|
8802 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8803 { |
|
8804 |
|
8805 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
8806 s4o.print("("); |
|
8807 return_type_symbol->accept(*this); |
|
8808 s4o.print(")__string_to_sint("); |
|
8809 IN_param_value->accept(*this); |
|
8810 s4o.print(")"); |
|
8811 return NULL; |
|
8812 |
|
8813 } |
|
8814 |
|
8815 ERROR; |
|
8816 } |
|
8817 |
|
8818 }/*function_string_to_sint*/ |
|
8819 break; |
|
8820 |
|
8821 /**** |
|
8822 *STRING_TO_INT |
|
8823 */ |
|
8824 case function_string_to_int : |
|
8825 { |
|
8826 symbol_c *last_type_symbol = NULL; |
|
8827 |
|
8828 { |
|
8829 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8830 symbol_c *IN_param_value = &this->default_variable_name; |
|
8831 |
|
8832 symbol_c *IN_type_symbol = param_data_type; |
|
8833 last_type_symbol = param_data_type; |
|
8834 |
|
8835 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8836 { |
|
8837 |
|
8838 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
8839 s4o.print("("); |
|
8840 return_type_symbol->accept(*this); |
|
8841 s4o.print(")__string_to_sint("); |
|
8842 IN_param_value->accept(*this); |
|
8843 s4o.print(")"); |
|
8844 return NULL; |
|
8845 |
|
8846 } |
|
8847 |
|
8848 ERROR; |
|
8849 } |
|
8850 |
|
8851 }/*function_string_to_int*/ |
|
8852 break; |
|
8853 |
|
8854 /**** |
|
8855 *STRING_TO_DINT |
|
8856 */ |
|
8857 case function_string_to_dint : |
|
8858 { |
|
8859 symbol_c *last_type_symbol = NULL; |
|
8860 |
|
8861 { |
|
8862 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8863 symbol_c *IN_param_value = &this->default_variable_name; |
|
8864 |
|
8865 symbol_c *IN_type_symbol = param_data_type; |
|
8866 last_type_symbol = param_data_type; |
|
8867 |
|
8868 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8869 { |
|
8870 |
|
8871 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
8872 s4o.print("("); |
|
8873 return_type_symbol->accept(*this); |
|
8874 s4o.print(")__string_to_sint("); |
|
8875 IN_param_value->accept(*this); |
|
8876 s4o.print(")"); |
|
8877 return NULL; |
|
8878 |
|
8879 } |
|
8880 |
|
8881 ERROR; |
|
8882 } |
|
8883 |
|
8884 }/*function_string_to_dint*/ |
|
8885 break; |
|
8886 |
|
8887 /**** |
|
8888 *STRING_TO_LINT |
|
8889 */ |
|
8890 case function_string_to_lint : |
|
8891 { |
|
8892 symbol_c *last_type_symbol = NULL; |
|
8893 |
|
8894 { |
|
8895 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8896 symbol_c *IN_param_value = &this->default_variable_name; |
|
8897 |
|
8898 symbol_c *IN_type_symbol = param_data_type; |
|
8899 last_type_symbol = param_data_type; |
|
8900 |
|
8901 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8902 { |
|
8903 |
|
8904 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
8905 s4o.print("("); |
|
8906 return_type_symbol->accept(*this); |
|
8907 s4o.print(")__string_to_sint("); |
|
8908 IN_param_value->accept(*this); |
|
8909 s4o.print(")"); |
|
8910 return NULL; |
|
8911 |
|
8912 } |
|
8913 |
|
8914 ERROR; |
|
8915 } |
|
8916 |
|
8917 }/*function_string_to_lint*/ |
|
8918 break; |
|
8919 |
|
8920 /**** |
|
8921 *STRING_TO_USINT |
|
8922 */ |
|
8923 case function_string_to_usint : |
|
8924 { |
|
8925 symbol_c *last_type_symbol = NULL; |
|
8926 |
|
8927 { |
|
8928 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8929 symbol_c *IN_param_value = &this->default_variable_name; |
|
8930 |
|
8931 symbol_c *IN_type_symbol = param_data_type; |
|
8932 last_type_symbol = param_data_type; |
|
8933 |
|
8934 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8935 { |
|
8936 |
|
8937 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
8938 s4o.print("("); |
|
8939 return_type_symbol->accept(*this); |
|
8940 s4o.print(")__string_to_uint("); |
|
8941 IN_param_value->accept(*this); |
|
8942 s4o.print(")"); |
|
8943 return NULL; |
|
8944 |
|
8945 } |
|
8946 |
|
8947 ERROR; |
|
8948 } |
|
8949 |
|
8950 }/*function_string_to_usint*/ |
|
8951 break; |
|
8952 |
|
8953 /**** |
|
8954 *STRING_TO_UINT |
|
8955 */ |
|
8956 case function_string_to_uint : |
|
8957 { |
|
8958 symbol_c *last_type_symbol = NULL; |
|
8959 |
|
8960 { |
|
8961 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8962 symbol_c *IN_param_value = &this->default_variable_name; |
|
8963 |
|
8964 symbol_c *IN_type_symbol = param_data_type; |
|
8965 last_type_symbol = param_data_type; |
|
8966 |
|
8967 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
8968 { |
|
8969 |
|
8970 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
8971 s4o.print("("); |
|
8972 return_type_symbol->accept(*this); |
|
8973 s4o.print(")__string_to_uint("); |
|
8974 IN_param_value->accept(*this); |
|
8975 s4o.print(")"); |
|
8976 return NULL; |
|
8977 |
|
8978 } |
|
8979 |
|
8980 ERROR; |
|
8981 } |
|
8982 |
|
8983 }/*function_string_to_uint*/ |
|
8984 break; |
|
8985 |
|
8986 /**** |
|
8987 *STRING_TO_UDINT |
|
8988 */ |
|
8989 case function_string_to_udint : |
|
8990 { |
|
8991 symbol_c *last_type_symbol = NULL; |
|
8992 |
|
8993 { |
|
8994 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
8995 symbol_c *IN_param_value = &this->default_variable_name; |
|
8996 |
|
8997 symbol_c *IN_type_symbol = param_data_type; |
|
8998 last_type_symbol = param_data_type; |
|
8999 |
|
9000 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9001 { |
|
9002 |
|
9003 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9004 s4o.print("("); |
|
9005 return_type_symbol->accept(*this); |
|
9006 s4o.print(")__string_to_uint("); |
|
9007 IN_param_value->accept(*this); |
|
9008 s4o.print(")"); |
|
9009 return NULL; |
|
9010 |
|
9011 } |
|
9012 |
|
9013 ERROR; |
|
9014 } |
|
9015 |
|
9016 }/*function_string_to_udint*/ |
|
9017 break; |
|
9018 |
|
9019 /**** |
|
9020 *STRING_TO_ULINT |
|
9021 */ |
|
9022 case function_string_to_ulint : |
|
9023 { |
|
9024 symbol_c *last_type_symbol = NULL; |
|
9025 |
|
9026 { |
|
9027 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9028 symbol_c *IN_param_value = &this->default_variable_name; |
|
9029 |
|
9030 symbol_c *IN_type_symbol = param_data_type; |
|
9031 last_type_symbol = param_data_type; |
|
9032 |
|
9033 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9034 { |
|
9035 |
|
9036 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9037 s4o.print("("); |
|
9038 return_type_symbol->accept(*this); |
|
9039 s4o.print(")__string_to_uint("); |
|
9040 IN_param_value->accept(*this); |
|
9041 s4o.print(")"); |
|
9042 return NULL; |
|
9043 |
|
9044 } |
|
9045 |
|
9046 ERROR; |
|
9047 } |
|
9048 |
|
9049 }/*function_string_to_ulint*/ |
|
9050 break; |
|
9051 |
|
9052 /**** |
|
9053 *STRING_TO_REAL |
|
9054 */ |
|
9055 case function_string_to_real : |
|
9056 { |
|
9057 symbol_c *last_type_symbol = NULL; |
|
9058 |
|
9059 { |
|
9060 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9061 symbol_c *IN_param_value = &this->default_variable_name; |
|
9062 |
|
9063 symbol_c *IN_type_symbol = param_data_type; |
|
9064 last_type_symbol = param_data_type; |
|
9065 |
|
9066 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9067 { |
|
9068 |
|
9069 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9070 s4o.print("("); |
|
9071 return_type_symbol->accept(*this); |
|
9072 s4o.print(")__string_to_real("); |
|
9073 IN_param_value->accept(*this); |
|
9074 s4o.print(")"); |
|
9075 return NULL; |
|
9076 |
|
9077 } |
|
9078 |
|
9079 ERROR; |
|
9080 } |
|
9081 |
|
9082 }/*function_string_to_real*/ |
|
9083 break; |
|
9084 |
|
9085 /**** |
|
9086 *STRING_TO_LREAL |
|
9087 */ |
|
9088 case function_string_to_lreal : |
|
9089 { |
|
9090 symbol_c *last_type_symbol = NULL; |
|
9091 |
|
9092 { |
|
9093 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9094 symbol_c *IN_param_value = &this->default_variable_name; |
|
9095 |
|
9096 symbol_c *IN_type_symbol = param_data_type; |
|
9097 last_type_symbol = param_data_type; |
|
9098 |
|
9099 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9100 { |
|
9101 |
|
9102 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9103 s4o.print("("); |
|
9104 return_type_symbol->accept(*this); |
|
9105 s4o.print(")__string_to_real("); |
|
9106 IN_param_value->accept(*this); |
|
9107 s4o.print(")"); |
|
9108 return NULL; |
|
9109 |
|
9110 } |
|
9111 |
|
9112 ERROR; |
|
9113 } |
|
9114 |
|
9115 }/*function_string_to_lreal*/ |
|
9116 break; |
|
9117 |
|
9118 /**** |
|
9119 *STRING_TO_TIME |
|
9120 */ |
|
9121 case function_string_to_time : |
|
9122 { |
|
9123 symbol_c *last_type_symbol = NULL; |
|
9124 |
|
9125 { |
|
9126 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9127 symbol_c *IN_param_value = &this->default_variable_name; |
|
9128 |
|
9129 symbol_c *IN_type_symbol = param_data_type; |
|
9130 last_type_symbol = param_data_type; |
|
9131 |
|
9132 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9133 { |
|
9134 |
|
9135 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
9136 s4o.print("("); |
|
9137 return_type_symbol->accept(*this); |
|
9138 s4o.print(")__string_to_time("); |
|
9139 IN_param_value->accept(*this); |
|
9140 s4o.print(")"); |
|
9141 return NULL; |
|
9142 |
|
9143 } |
|
9144 |
|
9145 ERROR; |
|
9146 } |
|
9147 |
|
9148 }/*function_string_to_time*/ |
|
9149 break; |
|
9150 |
|
9151 /**** |
|
9152 *STRING_TO_DATE |
|
9153 */ |
|
9154 case function_string_to_date : |
|
9155 { |
|
9156 symbol_c *last_type_symbol = NULL; |
|
9157 |
|
9158 { |
|
9159 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9160 symbol_c *IN_param_value = &this->default_variable_name; |
|
9161 |
|
9162 symbol_c *IN_type_symbol = param_data_type; |
|
9163 last_type_symbol = param_data_type; |
|
9164 |
|
9165 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9166 { |
|
9167 |
|
9168 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
9169 s4o.print("("); |
|
9170 return_type_symbol->accept(*this); |
|
9171 s4o.print(")__string_to_time("); |
|
9172 IN_param_value->accept(*this); |
|
9173 s4o.print(")"); |
|
9174 return NULL; |
|
9175 |
|
9176 } |
|
9177 |
|
9178 ERROR; |
|
9179 } |
|
9180 |
|
9181 }/*function_string_to_date*/ |
|
9182 break; |
|
9183 |
|
9184 /**** |
|
9185 *STRING_TO_TOD |
|
9186 */ |
|
9187 case function_string_to_tod : |
|
9188 { |
|
9189 symbol_c *last_type_symbol = NULL; |
|
9190 |
|
9191 { |
|
9192 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9193 symbol_c *IN_param_value = &this->default_variable_name; |
|
9194 |
|
9195 symbol_c *IN_type_symbol = param_data_type; |
|
9196 last_type_symbol = param_data_type; |
|
9197 |
|
9198 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9199 { |
|
9200 |
|
9201 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
9202 s4o.print("("); |
|
9203 return_type_symbol->accept(*this); |
|
9204 s4o.print(")__string_to_time("); |
|
9205 IN_param_value->accept(*this); |
|
9206 s4o.print(")"); |
|
9207 return NULL; |
|
9208 |
|
9209 } |
|
9210 |
|
9211 ERROR; |
|
9212 } |
|
9213 |
|
9214 }/*function_string_to_tod*/ |
|
9215 break; |
|
9216 |
|
9217 /**** |
|
9218 *STRING_TO_DT |
|
9219 */ |
|
9220 case function_string_to_dt : |
|
9221 { |
|
9222 symbol_c *last_type_symbol = NULL; |
|
9223 |
|
9224 { |
|
9225 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9226 symbol_c *IN_param_value = &this->default_variable_name; |
|
9227 |
|
9228 symbol_c *IN_type_symbol = param_data_type; |
|
9229 last_type_symbol = param_data_type; |
|
9230 |
|
9231 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9232 { |
|
9233 |
|
9234 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
9235 s4o.print("("); |
|
9236 return_type_symbol->accept(*this); |
|
9237 s4o.print(")__string_to_time("); |
|
9238 IN_param_value->accept(*this); |
|
9239 s4o.print(")"); |
|
9240 return NULL; |
|
9241 |
|
9242 } |
|
9243 |
|
9244 ERROR; |
|
9245 } |
|
9246 |
|
9247 }/*function_string_to_dt*/ |
|
9248 break; |
|
9249 |
|
9250 /**** |
|
9251 *STRING_TO_BYTE |
|
9252 */ |
|
9253 case function_string_to_byte : |
|
9254 { |
|
9255 symbol_c *last_type_symbol = NULL; |
|
9256 |
|
9257 { |
|
9258 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9259 symbol_c *IN_param_value = &this->default_variable_name; |
|
9260 |
|
9261 symbol_c *IN_type_symbol = param_data_type; |
|
9262 last_type_symbol = param_data_type; |
|
9263 |
|
9264 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9265 { |
|
9266 |
|
9267 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
9268 s4o.print("("); |
|
9269 return_type_symbol->accept(*this); |
|
9270 s4o.print(")__string_to_bit("); |
|
9271 IN_param_value->accept(*this); |
|
9272 s4o.print(")"); |
|
9273 return NULL; |
|
9274 |
|
9275 } |
|
9276 |
|
9277 ERROR; |
|
9278 } |
|
9279 |
|
9280 }/*function_string_to_byte*/ |
|
9281 break; |
|
9282 |
|
9283 /**** |
|
9284 *STRING_TO_WORD |
|
9285 */ |
|
9286 case function_string_to_word : |
|
9287 { |
|
9288 symbol_c *last_type_symbol = NULL; |
|
9289 |
|
9290 { |
|
9291 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9292 symbol_c *IN_param_value = &this->default_variable_name; |
|
9293 |
|
9294 symbol_c *IN_type_symbol = param_data_type; |
|
9295 last_type_symbol = param_data_type; |
|
9296 |
|
9297 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9298 { |
|
9299 |
|
9300 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9301 s4o.print("("); |
|
9302 return_type_symbol->accept(*this); |
|
9303 s4o.print(")__string_to_bit("); |
|
9304 IN_param_value->accept(*this); |
|
9305 s4o.print(")"); |
|
9306 return NULL; |
|
9307 |
|
9308 } |
|
9309 |
|
9310 ERROR; |
|
9311 } |
|
9312 |
|
9313 }/*function_string_to_word*/ |
|
9314 break; |
|
9315 |
|
9316 /**** |
|
9317 *STRING_TO_DWORD |
|
9318 */ |
|
9319 case function_string_to_dword : |
|
9320 { |
|
9321 symbol_c *last_type_symbol = NULL; |
|
9322 |
|
9323 { |
|
9324 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9325 symbol_c *IN_param_value = &this->default_variable_name; |
|
9326 |
|
9327 symbol_c *IN_type_symbol = param_data_type; |
|
9328 last_type_symbol = param_data_type; |
|
9329 |
|
9330 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9331 { |
|
9332 |
|
9333 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9334 s4o.print("("); |
|
9335 return_type_symbol->accept(*this); |
|
9336 s4o.print(")__string_to_bit("); |
|
9337 IN_param_value->accept(*this); |
|
9338 s4o.print(")"); |
|
9339 return NULL; |
|
9340 |
|
9341 } |
|
9342 |
|
9343 ERROR; |
|
9344 } |
|
9345 |
|
9346 }/*function_string_to_dword*/ |
|
9347 break; |
|
9348 |
|
9349 /**** |
|
9350 *STRING_TO_LWORD |
|
9351 */ |
|
9352 case function_string_to_lword : |
|
9353 { |
|
9354 symbol_c *last_type_symbol = NULL; |
|
9355 |
|
9356 { |
|
9357 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9358 symbol_c *IN_param_value = &this->default_variable_name; |
|
9359 |
|
9360 symbol_c *IN_type_symbol = param_data_type; |
|
9361 last_type_symbol = param_data_type; |
|
9362 |
|
9363 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
9364 { |
|
9365 |
|
9366 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9367 s4o.print("("); |
|
9368 return_type_symbol->accept(*this); |
|
9369 s4o.print(")__string_to_bit("); |
|
9370 IN_param_value->accept(*this); |
|
9371 s4o.print(")"); |
|
9372 return NULL; |
|
9373 |
|
9374 } |
|
9375 |
|
9376 ERROR; |
|
9377 } |
|
9378 |
|
9379 }/*function_string_to_lword*/ |
|
9380 break; |
|
9381 |
|
9382 /**** |
|
9383 *BYTE_TO_BOOL |
|
9384 */ |
|
9385 case function_byte_to_bool : |
|
9386 { |
|
9387 symbol_c *last_type_symbol = NULL; |
|
9388 |
|
9389 { |
|
9390 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9391 symbol_c *IN_param_value = &this->default_variable_name; |
|
9392 |
|
9393 symbol_c *IN_type_symbol = param_data_type; |
|
9394 last_type_symbol = param_data_type; |
|
9395 |
|
9396 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9397 { |
|
9398 |
|
9399 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
9400 s4o.print("("); |
|
9401 return_type_symbol->accept(*this); |
|
9402 s4o.print(")"); |
|
9403 IN_param_value->accept(*this); |
|
9404 return NULL; |
|
9405 |
|
9406 } |
|
9407 |
|
9408 ERROR; |
|
9409 } |
|
9410 |
|
9411 }/*function_byte_to_bool*/ |
|
9412 break; |
|
9413 |
|
9414 /**** |
|
9415 *BYTE_TO_SINT |
|
9416 */ |
|
9417 case function_byte_to_sint : |
|
9418 { |
|
9419 symbol_c *last_type_symbol = NULL; |
|
9420 |
|
9421 { |
|
9422 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9423 symbol_c *IN_param_value = &this->default_variable_name; |
|
9424 |
|
9425 symbol_c *IN_type_symbol = param_data_type; |
|
9426 last_type_symbol = param_data_type; |
|
9427 |
|
9428 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9429 { |
|
9430 |
|
9431 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
9432 s4o.print("("); |
|
9433 return_type_symbol->accept(*this); |
|
9434 s4o.print(")"); |
|
9435 IN_param_value->accept(*this); |
|
9436 return NULL; |
|
9437 |
|
9438 } |
|
9439 |
|
9440 ERROR; |
|
9441 } |
|
9442 |
|
9443 }/*function_byte_to_sint*/ |
|
9444 break; |
|
9445 |
|
9446 /**** |
|
9447 *BYTE_TO_INT |
|
9448 */ |
|
9449 case function_byte_to_int : |
|
9450 { |
|
9451 symbol_c *last_type_symbol = NULL; |
|
9452 |
|
9453 { |
|
9454 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9455 symbol_c *IN_param_value = &this->default_variable_name; |
|
9456 |
|
9457 symbol_c *IN_type_symbol = param_data_type; |
|
9458 last_type_symbol = param_data_type; |
|
9459 |
|
9460 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9461 { |
|
9462 |
|
9463 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
9464 s4o.print("("); |
|
9465 return_type_symbol->accept(*this); |
|
9466 s4o.print(")"); |
|
9467 IN_param_value->accept(*this); |
|
9468 return NULL; |
|
9469 |
|
9470 } |
|
9471 |
|
9472 ERROR; |
|
9473 } |
|
9474 |
|
9475 }/*function_byte_to_int*/ |
|
9476 break; |
|
9477 |
|
9478 /**** |
|
9479 *BYTE_TO_DINT |
|
9480 */ |
|
9481 case function_byte_to_dint : |
|
9482 { |
|
9483 symbol_c *last_type_symbol = NULL; |
|
9484 |
|
9485 { |
|
9486 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9487 symbol_c *IN_param_value = &this->default_variable_name; |
|
9488 |
|
9489 symbol_c *IN_type_symbol = param_data_type; |
|
9490 last_type_symbol = param_data_type; |
|
9491 |
|
9492 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9493 { |
|
9494 |
|
9495 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
9496 s4o.print("("); |
|
9497 return_type_symbol->accept(*this); |
|
9498 s4o.print(")"); |
|
9499 IN_param_value->accept(*this); |
|
9500 return NULL; |
|
9501 |
|
9502 } |
|
9503 |
|
9504 ERROR; |
|
9505 } |
|
9506 |
|
9507 }/*function_byte_to_dint*/ |
|
9508 break; |
|
9509 |
|
9510 /**** |
|
9511 *BYTE_TO_LINT |
|
9512 */ |
|
9513 case function_byte_to_lint : |
|
9514 { |
|
9515 symbol_c *last_type_symbol = NULL; |
|
9516 |
|
9517 { |
|
9518 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9519 symbol_c *IN_param_value = &this->default_variable_name; |
|
9520 |
|
9521 symbol_c *IN_type_symbol = param_data_type; |
|
9522 last_type_symbol = param_data_type; |
|
9523 |
|
9524 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9525 { |
|
9526 |
|
9527 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
9528 s4o.print("("); |
|
9529 return_type_symbol->accept(*this); |
|
9530 s4o.print(")"); |
|
9531 IN_param_value->accept(*this); |
|
9532 return NULL; |
|
9533 |
|
9534 } |
|
9535 |
|
9536 ERROR; |
|
9537 } |
|
9538 |
|
9539 }/*function_byte_to_lint*/ |
|
9540 break; |
|
9541 |
|
9542 /**** |
|
9543 *BYTE_TO_USINT |
|
9544 */ |
|
9545 case function_byte_to_usint : |
|
9546 { |
|
9547 symbol_c *last_type_symbol = NULL; |
|
9548 |
|
9549 { |
|
9550 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9551 symbol_c *IN_param_value = &this->default_variable_name; |
|
9552 |
|
9553 symbol_c *IN_type_symbol = param_data_type; |
|
9554 last_type_symbol = param_data_type; |
|
9555 |
|
9556 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9557 { |
|
9558 |
|
9559 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
9560 s4o.print("("); |
|
9561 return_type_symbol->accept(*this); |
|
9562 s4o.print(")"); |
|
9563 IN_param_value->accept(*this); |
|
9564 return NULL; |
|
9565 |
|
9566 } |
|
9567 |
|
9568 ERROR; |
|
9569 } |
|
9570 |
|
9571 }/*function_byte_to_usint*/ |
|
9572 break; |
|
9573 |
|
9574 /**** |
|
9575 *BYTE_TO_UINT |
|
9576 */ |
|
9577 case function_byte_to_uint : |
|
9578 { |
|
9579 symbol_c *last_type_symbol = NULL; |
|
9580 |
|
9581 { |
|
9582 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9583 symbol_c *IN_param_value = &this->default_variable_name; |
|
9584 |
|
9585 symbol_c *IN_type_symbol = param_data_type; |
|
9586 last_type_symbol = param_data_type; |
|
9587 |
|
9588 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9589 { |
|
9590 |
|
9591 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
9592 s4o.print("("); |
|
9593 return_type_symbol->accept(*this); |
|
9594 s4o.print(")"); |
|
9595 IN_param_value->accept(*this); |
|
9596 return NULL; |
|
9597 |
|
9598 } |
|
9599 |
|
9600 ERROR; |
|
9601 } |
|
9602 |
|
9603 }/*function_byte_to_uint*/ |
|
9604 break; |
|
9605 |
|
9606 /**** |
|
9607 *BYTE_TO_UDINT |
|
9608 */ |
|
9609 case function_byte_to_udint : |
|
9610 { |
|
9611 symbol_c *last_type_symbol = NULL; |
|
9612 |
|
9613 { |
|
9614 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9615 symbol_c *IN_param_value = &this->default_variable_name; |
|
9616 |
|
9617 symbol_c *IN_type_symbol = param_data_type; |
|
9618 last_type_symbol = param_data_type; |
|
9619 |
|
9620 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9621 { |
|
9622 |
|
9623 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
9624 s4o.print("("); |
|
9625 return_type_symbol->accept(*this); |
|
9626 s4o.print(")"); |
|
9627 IN_param_value->accept(*this); |
|
9628 return NULL; |
|
9629 |
|
9630 } |
|
9631 |
|
9632 ERROR; |
|
9633 } |
|
9634 |
|
9635 }/*function_byte_to_udint*/ |
|
9636 break; |
|
9637 |
|
9638 /**** |
|
9639 *BYTE_TO_ULINT |
|
9640 */ |
|
9641 case function_byte_to_ulint : |
|
9642 { |
|
9643 symbol_c *last_type_symbol = NULL; |
|
9644 |
|
9645 { |
|
9646 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9647 symbol_c *IN_param_value = &this->default_variable_name; |
|
9648 |
|
9649 symbol_c *IN_type_symbol = param_data_type; |
|
9650 last_type_symbol = param_data_type; |
|
9651 |
|
9652 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9653 { |
|
9654 |
|
9655 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
9656 s4o.print("("); |
|
9657 return_type_symbol->accept(*this); |
|
9658 s4o.print(")"); |
|
9659 IN_param_value->accept(*this); |
|
9660 return NULL; |
|
9661 |
|
9662 } |
|
9663 |
|
9664 ERROR; |
|
9665 } |
|
9666 |
|
9667 }/*function_byte_to_ulint*/ |
|
9668 break; |
|
9669 |
|
9670 /**** |
|
9671 *BYTE_TO_REAL |
|
9672 */ |
|
9673 case function_byte_to_real : |
|
9674 { |
|
9675 symbol_c *last_type_symbol = NULL; |
|
9676 |
|
9677 { |
|
9678 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9679 symbol_c *IN_param_value = &this->default_variable_name; |
|
9680 |
|
9681 symbol_c *IN_type_symbol = param_data_type; |
|
9682 last_type_symbol = param_data_type; |
|
9683 |
|
9684 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9685 { |
|
9686 |
|
9687 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
9688 s4o.print("("); |
|
9689 return_type_symbol->accept(*this); |
|
9690 s4o.print(")"); |
|
9691 IN_param_value->accept(*this); |
|
9692 return NULL; |
|
9693 |
|
9694 } |
|
9695 |
|
9696 ERROR; |
|
9697 } |
|
9698 |
|
9699 }/*function_byte_to_real*/ |
|
9700 break; |
|
9701 |
|
9702 /**** |
|
9703 *BYTE_TO_LREAL |
|
9704 */ |
|
9705 case function_byte_to_lreal : |
|
9706 { |
|
9707 symbol_c *last_type_symbol = NULL; |
|
9708 |
|
9709 { |
|
9710 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9711 symbol_c *IN_param_value = &this->default_variable_name; |
|
9712 |
|
9713 symbol_c *IN_type_symbol = param_data_type; |
|
9714 last_type_symbol = param_data_type; |
|
9715 |
|
9716 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9717 { |
|
9718 |
|
9719 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
9720 s4o.print("("); |
|
9721 return_type_symbol->accept(*this); |
|
9722 s4o.print(")"); |
|
9723 IN_param_value->accept(*this); |
|
9724 return NULL; |
|
9725 |
|
9726 } |
|
9727 |
|
9728 ERROR; |
|
9729 } |
|
9730 |
|
9731 }/*function_byte_to_lreal*/ |
|
9732 break; |
|
9733 |
|
9734 /**** |
|
9735 *BYTE_TO_TIME |
|
9736 */ |
|
9737 case function_byte_to_time : |
|
9738 { |
|
9739 symbol_c *last_type_symbol = NULL; |
|
9740 |
|
9741 { |
|
9742 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9743 symbol_c *IN_param_value = &this->default_variable_name; |
|
9744 |
|
9745 symbol_c *IN_type_symbol = param_data_type; |
|
9746 last_type_symbol = param_data_type; |
|
9747 |
|
9748 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9749 { |
|
9750 |
|
9751 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
9752 s4o.print("("); |
|
9753 return_type_symbol->accept(*this); |
|
9754 s4o.print(")__int_to_time("); |
|
9755 IN_param_value->accept(*this); |
|
9756 s4o.print(")"); |
|
9757 return NULL; |
|
9758 |
|
9759 } |
|
9760 |
|
9761 ERROR; |
|
9762 } |
|
9763 |
|
9764 }/*function_byte_to_time*/ |
|
9765 break; |
|
9766 |
|
9767 /**** |
|
9768 *BYTE_TO_DATE |
|
9769 */ |
|
9770 case function_byte_to_date : |
|
9771 { |
|
9772 symbol_c *last_type_symbol = NULL; |
|
9773 |
|
9774 { |
|
9775 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9776 symbol_c *IN_param_value = &this->default_variable_name; |
|
9777 |
|
9778 symbol_c *IN_type_symbol = param_data_type; |
|
9779 last_type_symbol = param_data_type; |
|
9780 |
|
9781 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9782 { |
|
9783 |
|
9784 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
9785 s4o.print("("); |
|
9786 return_type_symbol->accept(*this); |
|
9787 s4o.print(")__int_to_time("); |
|
9788 IN_param_value->accept(*this); |
|
9789 s4o.print(")"); |
|
9790 return NULL; |
|
9791 |
|
9792 } |
|
9793 |
|
9794 ERROR; |
|
9795 } |
|
9796 |
|
9797 }/*function_byte_to_date*/ |
|
9798 break; |
|
9799 |
|
9800 /**** |
|
9801 *BYTE_TO_TOD |
|
9802 */ |
|
9803 case function_byte_to_tod : |
|
9804 { |
|
9805 symbol_c *last_type_symbol = NULL; |
|
9806 |
|
9807 { |
|
9808 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9809 symbol_c *IN_param_value = &this->default_variable_name; |
|
9810 |
|
9811 symbol_c *IN_type_symbol = param_data_type; |
|
9812 last_type_symbol = param_data_type; |
|
9813 |
|
9814 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9815 { |
|
9816 |
|
9817 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
9818 s4o.print("("); |
|
9819 return_type_symbol->accept(*this); |
|
9820 s4o.print(")__int_to_time("); |
|
9821 IN_param_value->accept(*this); |
|
9822 s4o.print(")"); |
|
9823 return NULL; |
|
9824 |
|
9825 } |
|
9826 |
|
9827 ERROR; |
|
9828 } |
|
9829 |
|
9830 }/*function_byte_to_tod*/ |
|
9831 break; |
|
9832 |
|
9833 /**** |
|
9834 *BYTE_TO_DT |
|
9835 */ |
|
9836 case function_byte_to_dt : |
|
9837 { |
|
9838 symbol_c *last_type_symbol = NULL; |
|
9839 |
|
9840 { |
|
9841 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9842 symbol_c *IN_param_value = &this->default_variable_name; |
|
9843 |
|
9844 symbol_c *IN_type_symbol = param_data_type; |
|
9845 last_type_symbol = param_data_type; |
|
9846 |
|
9847 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9848 { |
|
9849 |
|
9850 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
9851 s4o.print("("); |
|
9852 return_type_symbol->accept(*this); |
|
9853 s4o.print(")__int_to_time("); |
|
9854 IN_param_value->accept(*this); |
|
9855 s4o.print(")"); |
|
9856 return NULL; |
|
9857 |
|
9858 } |
|
9859 |
|
9860 ERROR; |
|
9861 } |
|
9862 |
|
9863 }/*function_byte_to_dt*/ |
|
9864 break; |
|
9865 |
|
9866 /**** |
|
9867 *BYTE_TO_STRING |
|
9868 */ |
|
9869 case function_byte_to_string : |
|
9870 { |
|
9871 symbol_c *last_type_symbol = NULL; |
|
9872 |
|
9873 { |
|
9874 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9875 symbol_c *IN_param_value = &this->default_variable_name; |
|
9876 |
|
9877 symbol_c *IN_type_symbol = param_data_type; |
|
9878 last_type_symbol = param_data_type; |
|
9879 |
|
9880 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9881 { |
|
9882 |
|
9883 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
9884 s4o.print("("); |
|
9885 return_type_symbol->accept(*this); |
|
9886 s4o.print(")__bit_to_string("); |
|
9887 IN_param_value->accept(*this); |
|
9888 s4o.print(")"); |
|
9889 return NULL; |
|
9890 |
|
9891 } |
|
9892 |
|
9893 ERROR; |
|
9894 } |
|
9895 |
|
9896 }/*function_byte_to_string*/ |
|
9897 break; |
|
9898 |
|
9899 /**** |
|
9900 *BYTE_TO_WORD |
|
9901 */ |
|
9902 case function_byte_to_word : |
|
9903 { |
|
9904 symbol_c *last_type_symbol = NULL; |
|
9905 |
|
9906 { |
|
9907 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9908 symbol_c *IN_param_value = &this->default_variable_name; |
|
9909 |
|
9910 symbol_c *IN_type_symbol = param_data_type; |
|
9911 last_type_symbol = param_data_type; |
|
9912 |
|
9913 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9914 { |
|
9915 |
|
9916 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
9917 s4o.print("("); |
|
9918 return_type_symbol->accept(*this); |
|
9919 s4o.print(")"); |
|
9920 IN_param_value->accept(*this); |
|
9921 return NULL; |
|
9922 |
|
9923 } |
|
9924 |
|
9925 ERROR; |
|
9926 } |
|
9927 |
|
9928 }/*function_byte_to_word*/ |
|
9929 break; |
|
9930 |
|
9931 /**** |
|
9932 *BYTE_TO_DWORD |
|
9933 */ |
|
9934 case function_byte_to_dword : |
|
9935 { |
|
9936 symbol_c *last_type_symbol = NULL; |
|
9937 |
|
9938 { |
|
9939 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9940 symbol_c *IN_param_value = &this->default_variable_name; |
|
9941 |
|
9942 symbol_c *IN_type_symbol = param_data_type; |
|
9943 last_type_symbol = param_data_type; |
|
9944 |
|
9945 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9946 { |
|
9947 |
|
9948 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
9949 s4o.print("("); |
|
9950 return_type_symbol->accept(*this); |
|
9951 s4o.print(")"); |
|
9952 IN_param_value->accept(*this); |
|
9953 return NULL; |
|
9954 |
|
9955 } |
|
9956 |
|
9957 ERROR; |
|
9958 } |
|
9959 |
|
9960 }/*function_byte_to_dword*/ |
|
9961 break; |
|
9962 |
|
9963 /**** |
|
9964 *BYTE_TO_LWORD |
|
9965 */ |
|
9966 case function_byte_to_lword : |
|
9967 { |
|
9968 symbol_c *last_type_symbol = NULL; |
|
9969 |
|
9970 { |
|
9971 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
9972 symbol_c *IN_param_value = &this->default_variable_name; |
|
9973 |
|
9974 symbol_c *IN_type_symbol = param_data_type; |
|
9975 last_type_symbol = param_data_type; |
|
9976 |
|
9977 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
9978 { |
|
9979 |
|
9980 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
9981 s4o.print("("); |
|
9982 return_type_symbol->accept(*this); |
|
9983 s4o.print(")"); |
|
9984 IN_param_value->accept(*this); |
|
9985 return NULL; |
|
9986 |
|
9987 } |
|
9988 |
|
9989 ERROR; |
|
9990 } |
|
9991 |
|
9992 }/*function_byte_to_lword*/ |
|
9993 break; |
|
9994 |
|
9995 /**** |
|
9996 *WORD_TO_BOOL |
|
9997 */ |
|
9998 case function_word_to_bool : |
|
9999 { |
|
10000 symbol_c *last_type_symbol = NULL; |
|
10001 |
|
10002 { |
|
10003 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10004 symbol_c *IN_param_value = &this->default_variable_name; |
|
10005 |
|
10006 symbol_c *IN_type_symbol = param_data_type; |
|
10007 last_type_symbol = param_data_type; |
|
10008 |
|
10009 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10010 { |
|
10011 |
|
10012 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10013 s4o.print("("); |
|
10014 return_type_symbol->accept(*this); |
|
10015 s4o.print(")"); |
|
10016 IN_param_value->accept(*this); |
|
10017 return NULL; |
|
10018 |
|
10019 } |
|
10020 |
|
10021 ERROR; |
|
10022 } |
|
10023 |
|
10024 }/*function_word_to_bool*/ |
|
10025 break; |
|
10026 |
|
10027 /**** |
|
10028 *WORD_TO_SINT |
|
10029 */ |
|
10030 case function_word_to_sint : |
|
10031 { |
|
10032 symbol_c *last_type_symbol = NULL; |
|
10033 |
|
10034 { |
|
10035 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10036 symbol_c *IN_param_value = &this->default_variable_name; |
|
10037 |
|
10038 symbol_c *IN_type_symbol = param_data_type; |
|
10039 last_type_symbol = param_data_type; |
|
10040 |
|
10041 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10042 { |
|
10043 |
|
10044 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10045 s4o.print("("); |
|
10046 return_type_symbol->accept(*this); |
|
10047 s4o.print(")"); |
|
10048 IN_param_value->accept(*this); |
|
10049 return NULL; |
|
10050 |
|
10051 } |
|
10052 |
|
10053 ERROR; |
|
10054 } |
|
10055 |
|
10056 }/*function_word_to_sint*/ |
|
10057 break; |
|
10058 |
|
10059 /**** |
|
10060 *WORD_TO_INT |
|
10061 */ |
|
10062 case function_word_to_int : |
|
10063 { |
|
10064 symbol_c *last_type_symbol = NULL; |
|
10065 |
|
10066 { |
|
10067 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10068 symbol_c *IN_param_value = &this->default_variable_name; |
|
10069 |
|
10070 symbol_c *IN_type_symbol = param_data_type; |
|
10071 last_type_symbol = param_data_type; |
|
10072 |
|
10073 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10074 { |
|
10075 |
|
10076 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10077 s4o.print("("); |
|
10078 return_type_symbol->accept(*this); |
|
10079 s4o.print(")"); |
|
10080 IN_param_value->accept(*this); |
|
10081 return NULL; |
|
10082 |
|
10083 } |
|
10084 |
|
10085 ERROR; |
|
10086 } |
|
10087 |
|
10088 }/*function_word_to_int*/ |
|
10089 break; |
|
10090 |
|
10091 /**** |
|
10092 *WORD_TO_DINT |
|
10093 */ |
|
10094 case function_word_to_dint : |
|
10095 { |
|
10096 symbol_c *last_type_symbol = NULL; |
|
10097 |
|
10098 { |
|
10099 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10100 symbol_c *IN_param_value = &this->default_variable_name; |
|
10101 |
|
10102 symbol_c *IN_type_symbol = param_data_type; |
|
10103 last_type_symbol = param_data_type; |
|
10104 |
|
10105 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10106 { |
|
10107 |
|
10108 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10109 s4o.print("("); |
|
10110 return_type_symbol->accept(*this); |
|
10111 s4o.print(")"); |
|
10112 IN_param_value->accept(*this); |
|
10113 return NULL; |
|
10114 |
|
10115 } |
|
10116 |
|
10117 ERROR; |
|
10118 } |
|
10119 |
|
10120 }/*function_word_to_dint*/ |
|
10121 break; |
|
10122 |
|
10123 /**** |
|
10124 *WORD_TO_LINT |
|
10125 */ |
|
10126 case function_word_to_lint : |
|
10127 { |
|
10128 symbol_c *last_type_symbol = NULL; |
|
10129 |
|
10130 { |
|
10131 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10132 symbol_c *IN_param_value = &this->default_variable_name; |
|
10133 |
|
10134 symbol_c *IN_type_symbol = param_data_type; |
|
10135 last_type_symbol = param_data_type; |
|
10136 |
|
10137 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10138 { |
|
10139 |
|
10140 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10141 s4o.print("("); |
|
10142 return_type_symbol->accept(*this); |
|
10143 s4o.print(")"); |
|
10144 IN_param_value->accept(*this); |
|
10145 return NULL; |
|
10146 |
|
10147 } |
|
10148 |
|
10149 ERROR; |
|
10150 } |
|
10151 |
|
10152 }/*function_word_to_lint*/ |
|
10153 break; |
|
10154 |
|
10155 /**** |
|
10156 *WORD_TO_USINT |
|
10157 */ |
|
10158 case function_word_to_usint : |
|
10159 { |
|
10160 symbol_c *last_type_symbol = NULL; |
|
10161 |
|
10162 { |
|
10163 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10164 symbol_c *IN_param_value = &this->default_variable_name; |
|
10165 |
|
10166 symbol_c *IN_type_symbol = param_data_type; |
|
10167 last_type_symbol = param_data_type; |
|
10168 |
|
10169 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10170 { |
|
10171 |
|
10172 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10173 s4o.print("("); |
|
10174 return_type_symbol->accept(*this); |
|
10175 s4o.print(")"); |
|
10176 IN_param_value->accept(*this); |
|
10177 return NULL; |
|
10178 |
|
10179 } |
|
10180 |
|
10181 ERROR; |
|
10182 } |
|
10183 |
|
10184 }/*function_word_to_usint*/ |
|
10185 break; |
|
10186 |
|
10187 /**** |
|
10188 *WORD_TO_UINT |
|
10189 */ |
|
10190 case function_word_to_uint : |
|
10191 { |
|
10192 symbol_c *last_type_symbol = NULL; |
|
10193 |
|
10194 { |
|
10195 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10196 symbol_c *IN_param_value = &this->default_variable_name; |
|
10197 |
|
10198 symbol_c *IN_type_symbol = param_data_type; |
|
10199 last_type_symbol = param_data_type; |
|
10200 |
|
10201 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10202 { |
|
10203 |
|
10204 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10205 s4o.print("("); |
|
10206 return_type_symbol->accept(*this); |
|
10207 s4o.print(")"); |
|
10208 IN_param_value->accept(*this); |
|
10209 return NULL; |
|
10210 |
|
10211 } |
|
10212 |
|
10213 ERROR; |
|
10214 } |
|
10215 |
|
10216 }/*function_word_to_uint*/ |
|
10217 break; |
|
10218 |
|
10219 /**** |
|
10220 *WORD_TO_UDINT |
|
10221 */ |
|
10222 case function_word_to_udint : |
|
10223 { |
|
10224 symbol_c *last_type_symbol = NULL; |
|
10225 |
|
10226 { |
|
10227 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10228 symbol_c *IN_param_value = &this->default_variable_name; |
|
10229 |
|
10230 symbol_c *IN_type_symbol = param_data_type; |
|
10231 last_type_symbol = param_data_type; |
|
10232 |
|
10233 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10234 { |
|
10235 |
|
10236 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10237 s4o.print("("); |
|
10238 return_type_symbol->accept(*this); |
|
10239 s4o.print(")"); |
|
10240 IN_param_value->accept(*this); |
|
10241 return NULL; |
|
10242 |
|
10243 } |
|
10244 |
|
10245 ERROR; |
|
10246 } |
|
10247 |
|
10248 }/*function_word_to_udint*/ |
|
10249 break; |
|
10250 |
|
10251 /**** |
|
10252 *WORD_TO_ULINT |
|
10253 */ |
|
10254 case function_word_to_ulint : |
|
10255 { |
|
10256 symbol_c *last_type_symbol = NULL; |
|
10257 |
|
10258 { |
|
10259 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10260 symbol_c *IN_param_value = &this->default_variable_name; |
|
10261 |
|
10262 symbol_c *IN_type_symbol = param_data_type; |
|
10263 last_type_symbol = param_data_type; |
|
10264 |
|
10265 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10266 { |
|
10267 |
|
10268 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10269 s4o.print("("); |
|
10270 return_type_symbol->accept(*this); |
|
10271 s4o.print(")"); |
|
10272 IN_param_value->accept(*this); |
|
10273 return NULL; |
|
10274 |
|
10275 } |
|
10276 |
|
10277 ERROR; |
|
10278 } |
|
10279 |
|
10280 }/*function_word_to_ulint*/ |
|
10281 break; |
|
10282 |
|
10283 /**** |
|
10284 *WORD_TO_REAL |
|
10285 */ |
|
10286 case function_word_to_real : |
|
10287 { |
|
10288 symbol_c *last_type_symbol = NULL; |
|
10289 |
|
10290 { |
|
10291 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10292 symbol_c *IN_param_value = &this->default_variable_name; |
|
10293 |
|
10294 symbol_c *IN_type_symbol = param_data_type; |
|
10295 last_type_symbol = param_data_type; |
|
10296 |
|
10297 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10298 { |
|
10299 |
|
10300 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10301 s4o.print("("); |
|
10302 return_type_symbol->accept(*this); |
|
10303 s4o.print(")"); |
|
10304 IN_param_value->accept(*this); |
|
10305 return NULL; |
|
10306 |
|
10307 } |
|
10308 |
|
10309 ERROR; |
|
10310 } |
|
10311 |
|
10312 }/*function_word_to_real*/ |
|
10313 break; |
|
10314 |
|
10315 /**** |
|
10316 *WORD_TO_LREAL |
|
10317 */ |
|
10318 case function_word_to_lreal : |
|
10319 { |
|
10320 symbol_c *last_type_symbol = NULL; |
|
10321 |
|
10322 { |
|
10323 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10324 symbol_c *IN_param_value = &this->default_variable_name; |
|
10325 |
|
10326 symbol_c *IN_type_symbol = param_data_type; |
|
10327 last_type_symbol = param_data_type; |
|
10328 |
|
10329 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10330 { |
|
10331 |
|
10332 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
10333 s4o.print("("); |
|
10334 return_type_symbol->accept(*this); |
|
10335 s4o.print(")"); |
|
10336 IN_param_value->accept(*this); |
|
10337 return NULL; |
|
10338 |
|
10339 } |
|
10340 |
|
10341 ERROR; |
|
10342 } |
|
10343 |
|
10344 }/*function_word_to_lreal*/ |
|
10345 break; |
|
10346 |
|
10347 /**** |
|
10348 *WORD_TO_TIME |
|
10349 */ |
|
10350 case function_word_to_time : |
|
10351 { |
|
10352 symbol_c *last_type_symbol = NULL; |
|
10353 |
|
10354 { |
|
10355 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10356 symbol_c *IN_param_value = &this->default_variable_name; |
|
10357 |
|
10358 symbol_c *IN_type_symbol = param_data_type; |
|
10359 last_type_symbol = param_data_type; |
|
10360 |
|
10361 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10362 { |
|
10363 |
|
10364 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10365 s4o.print("("); |
|
10366 return_type_symbol->accept(*this); |
|
10367 s4o.print(")__int_to_time("); |
|
10368 IN_param_value->accept(*this); |
|
10369 s4o.print(")"); |
|
10370 return NULL; |
|
10371 |
|
10372 } |
|
10373 |
|
10374 ERROR; |
|
10375 } |
|
10376 |
|
10377 }/*function_word_to_time*/ |
|
10378 break; |
|
10379 |
|
10380 /**** |
|
10381 *WORD_TO_DATE |
|
10382 */ |
|
10383 case function_word_to_date : |
|
10384 { |
|
10385 symbol_c *last_type_symbol = NULL; |
|
10386 |
|
10387 { |
|
10388 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10389 symbol_c *IN_param_value = &this->default_variable_name; |
|
10390 |
|
10391 symbol_c *IN_type_symbol = param_data_type; |
|
10392 last_type_symbol = param_data_type; |
|
10393 |
|
10394 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10395 { |
|
10396 |
|
10397 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
10398 s4o.print("("); |
|
10399 return_type_symbol->accept(*this); |
|
10400 s4o.print(")__int_to_time("); |
|
10401 IN_param_value->accept(*this); |
|
10402 s4o.print(")"); |
|
10403 return NULL; |
|
10404 |
|
10405 } |
|
10406 |
|
10407 ERROR; |
|
10408 } |
|
10409 |
|
10410 }/*function_word_to_date*/ |
|
10411 break; |
|
10412 |
|
10413 /**** |
|
10414 *WORD_TO_TOD |
|
10415 */ |
|
10416 case function_word_to_tod : |
|
10417 { |
|
10418 symbol_c *last_type_symbol = NULL; |
|
10419 |
|
10420 { |
|
10421 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10422 symbol_c *IN_param_value = &this->default_variable_name; |
|
10423 |
|
10424 symbol_c *IN_type_symbol = param_data_type; |
|
10425 last_type_symbol = param_data_type; |
|
10426 |
|
10427 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10428 { |
|
10429 |
|
10430 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
10431 s4o.print("("); |
|
10432 return_type_symbol->accept(*this); |
|
10433 s4o.print(")__int_to_time("); |
|
10434 IN_param_value->accept(*this); |
|
10435 s4o.print(")"); |
|
10436 return NULL; |
|
10437 |
|
10438 } |
|
10439 |
|
10440 ERROR; |
|
10441 } |
|
10442 |
|
10443 }/*function_word_to_tod*/ |
|
10444 break; |
|
10445 |
|
10446 /**** |
|
10447 *WORD_TO_DT |
|
10448 */ |
|
10449 case function_word_to_dt : |
|
10450 { |
|
10451 symbol_c *last_type_symbol = NULL; |
|
10452 |
|
10453 { |
|
10454 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10455 symbol_c *IN_param_value = &this->default_variable_name; |
|
10456 |
|
10457 symbol_c *IN_type_symbol = param_data_type; |
|
10458 last_type_symbol = param_data_type; |
|
10459 |
|
10460 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10461 { |
|
10462 |
|
10463 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
10464 s4o.print("("); |
|
10465 return_type_symbol->accept(*this); |
|
10466 s4o.print(")__int_to_time("); |
|
10467 IN_param_value->accept(*this); |
|
10468 s4o.print(")"); |
|
10469 return NULL; |
|
10470 |
|
10471 } |
|
10472 |
|
10473 ERROR; |
|
10474 } |
|
10475 |
|
10476 }/*function_word_to_dt*/ |
|
10477 break; |
|
10478 |
|
10479 /**** |
|
10480 *WORD_TO_STRING |
|
10481 */ |
|
10482 case function_word_to_string : |
|
10483 { |
|
10484 symbol_c *last_type_symbol = NULL; |
|
10485 |
|
10486 { |
|
10487 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10488 symbol_c *IN_param_value = &this->default_variable_name; |
|
10489 |
|
10490 symbol_c *IN_type_symbol = param_data_type; |
|
10491 last_type_symbol = param_data_type; |
|
10492 |
|
10493 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10494 { |
|
10495 |
|
10496 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
10497 s4o.print("("); |
|
10498 return_type_symbol->accept(*this); |
|
10499 s4o.print(")__bit_to_string("); |
|
10500 IN_param_value->accept(*this); |
|
10501 s4o.print(")"); |
|
10502 return NULL; |
|
10503 |
|
10504 } |
|
10505 |
|
10506 ERROR; |
|
10507 } |
|
10508 |
|
10509 }/*function_word_to_string*/ |
|
10510 break; |
|
10511 |
|
10512 /**** |
|
10513 *WORD_TO_BYTE |
|
10514 */ |
|
10515 case function_word_to_byte : |
|
10516 { |
|
10517 symbol_c *last_type_symbol = NULL; |
|
10518 |
|
10519 { |
|
10520 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10521 symbol_c *IN_param_value = &this->default_variable_name; |
|
10522 |
|
10523 symbol_c *IN_type_symbol = param_data_type; |
|
10524 last_type_symbol = param_data_type; |
|
10525 |
|
10526 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10527 { |
|
10528 |
|
10529 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
10530 s4o.print("("); |
|
10531 return_type_symbol->accept(*this); |
|
10532 s4o.print(")"); |
|
10533 IN_param_value->accept(*this); |
|
10534 return NULL; |
|
10535 |
|
10536 } |
|
10537 |
|
10538 ERROR; |
|
10539 } |
|
10540 |
|
10541 }/*function_word_to_byte*/ |
|
10542 break; |
|
10543 |
|
10544 /**** |
|
10545 *WORD_TO_DWORD |
|
10546 */ |
|
10547 case function_word_to_dword : |
|
10548 { |
|
10549 symbol_c *last_type_symbol = NULL; |
|
10550 |
|
10551 { |
|
10552 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10553 symbol_c *IN_param_value = &this->default_variable_name; |
|
10554 |
|
10555 symbol_c *IN_type_symbol = param_data_type; |
|
10556 last_type_symbol = param_data_type; |
|
10557 |
|
10558 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10559 { |
|
10560 |
|
10561 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
10562 s4o.print("("); |
|
10563 return_type_symbol->accept(*this); |
|
10564 s4o.print(")"); |
|
10565 IN_param_value->accept(*this); |
|
10566 return NULL; |
|
10567 |
|
10568 } |
|
10569 |
|
10570 ERROR; |
|
10571 } |
|
10572 |
|
10573 }/*function_word_to_dword*/ |
|
10574 break; |
|
10575 |
|
10576 /**** |
|
10577 *WORD_TO_LWORD |
|
10578 */ |
|
10579 case function_word_to_lword : |
|
10580 { |
|
10581 symbol_c *last_type_symbol = NULL; |
|
10582 |
|
10583 { |
|
10584 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10585 symbol_c *IN_param_value = &this->default_variable_name; |
|
10586 |
|
10587 symbol_c *IN_type_symbol = param_data_type; |
|
10588 last_type_symbol = param_data_type; |
|
10589 |
|
10590 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
10591 { |
|
10592 |
|
10593 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
10594 s4o.print("("); |
|
10595 return_type_symbol->accept(*this); |
|
10596 s4o.print(")"); |
|
10597 IN_param_value->accept(*this); |
|
10598 return NULL; |
|
10599 |
|
10600 } |
|
10601 |
|
10602 ERROR; |
|
10603 } |
|
10604 |
|
10605 }/*function_word_to_lword*/ |
|
10606 break; |
|
10607 |
|
10608 /**** |
|
10609 *DWORD_TO_BOOL |
|
10610 */ |
|
10611 case function_dword_to_bool : |
|
10612 { |
|
10613 symbol_c *last_type_symbol = NULL; |
|
10614 |
|
10615 { |
|
10616 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10617 symbol_c *IN_param_value = &this->default_variable_name; |
|
10618 |
|
10619 symbol_c *IN_type_symbol = param_data_type; |
|
10620 last_type_symbol = param_data_type; |
|
10621 |
|
10622 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10623 { |
|
10624 |
|
10625 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
10626 s4o.print("("); |
|
10627 return_type_symbol->accept(*this); |
|
10628 s4o.print(")"); |
|
10629 IN_param_value->accept(*this); |
|
10630 return NULL; |
|
10631 |
|
10632 } |
|
10633 |
|
10634 ERROR; |
|
10635 } |
|
10636 |
|
10637 }/*function_dword_to_bool*/ |
|
10638 break; |
|
10639 |
|
10640 /**** |
|
10641 *DWORD_TO_SINT |
|
10642 */ |
|
10643 case function_dword_to_sint : |
|
10644 { |
|
10645 symbol_c *last_type_symbol = NULL; |
|
10646 |
|
10647 { |
|
10648 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10649 symbol_c *IN_param_value = &this->default_variable_name; |
|
10650 |
|
10651 symbol_c *IN_type_symbol = param_data_type; |
|
10652 last_type_symbol = param_data_type; |
|
10653 |
|
10654 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10655 { |
|
10656 |
|
10657 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
10658 s4o.print("("); |
|
10659 return_type_symbol->accept(*this); |
|
10660 s4o.print(")"); |
|
10661 IN_param_value->accept(*this); |
|
10662 return NULL; |
|
10663 |
|
10664 } |
|
10665 |
|
10666 ERROR; |
|
10667 } |
|
10668 |
|
10669 }/*function_dword_to_sint*/ |
|
10670 break; |
|
10671 |
|
10672 /**** |
|
10673 *DWORD_TO_INT |
|
10674 */ |
|
10675 case function_dword_to_int : |
|
10676 { |
|
10677 symbol_c *last_type_symbol = NULL; |
|
10678 |
|
10679 { |
|
10680 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10681 symbol_c *IN_param_value = &this->default_variable_name; |
|
10682 |
|
10683 symbol_c *IN_type_symbol = param_data_type; |
|
10684 last_type_symbol = param_data_type; |
|
10685 |
|
10686 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10687 { |
|
10688 |
|
10689 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
10690 s4o.print("("); |
|
10691 return_type_symbol->accept(*this); |
|
10692 s4o.print(")"); |
|
10693 IN_param_value->accept(*this); |
|
10694 return NULL; |
|
10695 |
|
10696 } |
|
10697 |
|
10698 ERROR; |
|
10699 } |
|
10700 |
|
10701 }/*function_dword_to_int*/ |
|
10702 break; |
|
10703 |
|
10704 /**** |
|
10705 *DWORD_TO_DINT |
|
10706 */ |
|
10707 case function_dword_to_dint : |
|
10708 { |
|
10709 symbol_c *last_type_symbol = NULL; |
|
10710 |
|
10711 { |
|
10712 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10713 symbol_c *IN_param_value = &this->default_variable_name; |
|
10714 |
|
10715 symbol_c *IN_type_symbol = param_data_type; |
|
10716 last_type_symbol = param_data_type; |
|
10717 |
|
10718 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10719 { |
|
10720 |
|
10721 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
10722 s4o.print("("); |
|
10723 return_type_symbol->accept(*this); |
|
10724 s4o.print(")"); |
|
10725 IN_param_value->accept(*this); |
|
10726 return NULL; |
|
10727 |
|
10728 } |
|
10729 |
|
10730 ERROR; |
|
10731 } |
|
10732 |
|
10733 }/*function_dword_to_dint*/ |
|
10734 break; |
|
10735 |
|
10736 /**** |
|
10737 *DWORD_TO_LINT |
|
10738 */ |
|
10739 case function_dword_to_lint : |
|
10740 { |
|
10741 symbol_c *last_type_symbol = NULL; |
|
10742 |
|
10743 { |
|
10744 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10745 symbol_c *IN_param_value = &this->default_variable_name; |
|
10746 |
|
10747 symbol_c *IN_type_symbol = param_data_type; |
|
10748 last_type_symbol = param_data_type; |
|
10749 |
|
10750 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10751 { |
|
10752 |
|
10753 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
10754 s4o.print("("); |
|
10755 return_type_symbol->accept(*this); |
|
10756 s4o.print(")"); |
|
10757 IN_param_value->accept(*this); |
|
10758 return NULL; |
|
10759 |
|
10760 } |
|
10761 |
|
10762 ERROR; |
|
10763 } |
|
10764 |
|
10765 }/*function_dword_to_lint*/ |
|
10766 break; |
|
10767 |
|
10768 /**** |
|
10769 *DWORD_TO_USINT |
|
10770 */ |
|
10771 case function_dword_to_usint : |
|
10772 { |
|
10773 symbol_c *last_type_symbol = NULL; |
|
10774 |
|
10775 { |
|
10776 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10777 symbol_c *IN_param_value = &this->default_variable_name; |
|
10778 |
|
10779 symbol_c *IN_type_symbol = param_data_type; |
|
10780 last_type_symbol = param_data_type; |
|
10781 |
|
10782 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10783 { |
|
10784 |
|
10785 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
10786 s4o.print("("); |
|
10787 return_type_symbol->accept(*this); |
|
10788 s4o.print(")"); |
|
10789 IN_param_value->accept(*this); |
|
10790 return NULL; |
|
10791 |
|
10792 } |
|
10793 |
|
10794 ERROR; |
|
10795 } |
|
10796 |
|
10797 }/*function_dword_to_usint*/ |
|
10798 break; |
|
10799 |
|
10800 /**** |
|
10801 *DWORD_TO_UINT |
|
10802 */ |
|
10803 case function_dword_to_uint : |
|
10804 { |
|
10805 symbol_c *last_type_symbol = NULL; |
|
10806 |
|
10807 { |
|
10808 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10809 symbol_c *IN_param_value = &this->default_variable_name; |
|
10810 |
|
10811 symbol_c *IN_type_symbol = param_data_type; |
|
10812 last_type_symbol = param_data_type; |
|
10813 |
|
10814 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10815 { |
|
10816 |
|
10817 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
10818 s4o.print("("); |
|
10819 return_type_symbol->accept(*this); |
|
10820 s4o.print(")"); |
|
10821 IN_param_value->accept(*this); |
|
10822 return NULL; |
|
10823 |
|
10824 } |
|
10825 |
|
10826 ERROR; |
|
10827 } |
|
10828 |
|
10829 }/*function_dword_to_uint*/ |
|
10830 break; |
|
10831 |
|
10832 /**** |
|
10833 *DWORD_TO_UDINT |
|
10834 */ |
|
10835 case function_dword_to_udint : |
|
10836 { |
|
10837 symbol_c *last_type_symbol = NULL; |
|
10838 |
|
10839 { |
|
10840 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10841 symbol_c *IN_param_value = &this->default_variable_name; |
|
10842 |
|
10843 symbol_c *IN_type_symbol = param_data_type; |
|
10844 last_type_symbol = param_data_type; |
|
10845 |
|
10846 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10847 { |
|
10848 |
|
10849 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
10850 s4o.print("("); |
|
10851 return_type_symbol->accept(*this); |
|
10852 s4o.print(")"); |
|
10853 IN_param_value->accept(*this); |
|
10854 return NULL; |
|
10855 |
|
10856 } |
|
10857 |
|
10858 ERROR; |
|
10859 } |
|
10860 |
|
10861 }/*function_dword_to_udint*/ |
|
10862 break; |
|
10863 |
|
10864 /**** |
|
10865 *DWORD_TO_ULINT |
|
10866 */ |
|
10867 case function_dword_to_ulint : |
|
10868 { |
|
10869 symbol_c *last_type_symbol = NULL; |
|
10870 |
|
10871 { |
|
10872 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10873 symbol_c *IN_param_value = &this->default_variable_name; |
|
10874 |
|
10875 symbol_c *IN_type_symbol = param_data_type; |
|
10876 last_type_symbol = param_data_type; |
|
10877 |
|
10878 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10879 { |
|
10880 |
|
10881 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
10882 s4o.print("("); |
|
10883 return_type_symbol->accept(*this); |
|
10884 s4o.print(")"); |
|
10885 IN_param_value->accept(*this); |
|
10886 return NULL; |
|
10887 |
|
10888 } |
|
10889 |
|
10890 ERROR; |
|
10891 } |
|
10892 |
|
10893 }/*function_dword_to_ulint*/ |
|
10894 break; |
|
10895 |
|
10896 /**** |
|
10897 *DWORD_TO_REAL |
|
10898 */ |
|
10899 case function_dword_to_real : |
|
10900 { |
|
10901 symbol_c *last_type_symbol = NULL; |
|
10902 |
|
10903 { |
|
10904 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10905 symbol_c *IN_param_value = &this->default_variable_name; |
|
10906 |
|
10907 symbol_c *IN_type_symbol = param_data_type; |
|
10908 last_type_symbol = param_data_type; |
|
10909 |
|
10910 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10911 { |
|
10912 |
|
10913 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
10914 s4o.print("("); |
|
10915 return_type_symbol->accept(*this); |
|
10916 s4o.print(")"); |
|
10917 IN_param_value->accept(*this); |
|
10918 return NULL; |
|
10919 |
|
10920 } |
|
10921 |
|
10922 ERROR; |
|
10923 } |
|
10924 |
|
10925 }/*function_dword_to_real*/ |
|
10926 break; |
|
10927 |
|
10928 /**** |
|
10929 *DWORD_TO_LREAL |
|
10930 */ |
|
10931 case function_dword_to_lreal : |
|
10932 { |
|
10933 symbol_c *last_type_symbol = NULL; |
|
10934 |
|
10935 { |
|
10936 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10937 symbol_c *IN_param_value = &this->default_variable_name; |
|
10938 |
|
10939 symbol_c *IN_type_symbol = param_data_type; |
|
10940 last_type_symbol = param_data_type; |
|
10941 |
|
10942 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10943 { |
|
10944 |
|
10945 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
10946 s4o.print("("); |
|
10947 return_type_symbol->accept(*this); |
|
10948 s4o.print(")"); |
|
10949 IN_param_value->accept(*this); |
|
10950 return NULL; |
|
10951 |
|
10952 } |
|
10953 |
|
10954 ERROR; |
|
10955 } |
|
10956 |
|
10957 }/*function_dword_to_lreal*/ |
|
10958 break; |
|
10959 |
|
10960 /**** |
|
10961 *DWORD_TO_TIME |
|
10962 */ |
|
10963 case function_dword_to_time : |
|
10964 { |
|
10965 symbol_c *last_type_symbol = NULL; |
|
10966 |
|
10967 { |
|
10968 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
10969 symbol_c *IN_param_value = &this->default_variable_name; |
|
10970 |
|
10971 symbol_c *IN_type_symbol = param_data_type; |
|
10972 last_type_symbol = param_data_type; |
|
10973 |
|
10974 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
10975 { |
|
10976 |
|
10977 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
10978 s4o.print("("); |
|
10979 return_type_symbol->accept(*this); |
|
10980 s4o.print(")__int_to_time("); |
|
10981 IN_param_value->accept(*this); |
|
10982 s4o.print(")"); |
|
10983 return NULL; |
|
10984 |
|
10985 } |
|
10986 |
|
10987 ERROR; |
|
10988 } |
|
10989 |
|
10990 }/*function_dword_to_time*/ |
|
10991 break; |
|
10992 |
|
10993 /**** |
|
10994 *DWORD_TO_DATE |
|
10995 */ |
|
10996 case function_dword_to_date : |
|
10997 { |
|
10998 symbol_c *last_type_symbol = NULL; |
|
10999 |
|
11000 { |
|
11001 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11002 symbol_c *IN_param_value = &this->default_variable_name; |
|
11003 |
|
11004 symbol_c *IN_type_symbol = param_data_type; |
|
11005 last_type_symbol = param_data_type; |
|
11006 |
|
11007 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11008 { |
|
11009 |
|
11010 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11011 s4o.print("("); |
|
11012 return_type_symbol->accept(*this); |
|
11013 s4o.print(")__int_to_time("); |
|
11014 IN_param_value->accept(*this); |
|
11015 s4o.print(")"); |
|
11016 return NULL; |
|
11017 |
|
11018 } |
|
11019 |
|
11020 ERROR; |
|
11021 } |
|
11022 |
|
11023 }/*function_dword_to_date*/ |
|
11024 break; |
|
11025 |
|
11026 /**** |
|
11027 *DWORD_TO_TOD |
|
11028 */ |
|
11029 case function_dword_to_tod : |
|
11030 { |
|
11031 symbol_c *last_type_symbol = NULL; |
|
11032 |
|
11033 { |
|
11034 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11035 symbol_c *IN_param_value = &this->default_variable_name; |
|
11036 |
|
11037 symbol_c *IN_type_symbol = param_data_type; |
|
11038 last_type_symbol = param_data_type; |
|
11039 |
|
11040 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11041 { |
|
11042 |
|
11043 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11044 s4o.print("("); |
|
11045 return_type_symbol->accept(*this); |
|
11046 s4o.print(")__int_to_time("); |
|
11047 IN_param_value->accept(*this); |
|
11048 s4o.print(")"); |
|
11049 return NULL; |
|
11050 |
|
11051 } |
|
11052 |
|
11053 ERROR; |
|
11054 } |
|
11055 |
|
11056 }/*function_dword_to_tod*/ |
|
11057 break; |
|
11058 |
|
11059 /**** |
|
11060 *DWORD_TO_DT |
|
11061 */ |
|
11062 case function_dword_to_dt : |
|
11063 { |
|
11064 symbol_c *last_type_symbol = NULL; |
|
11065 |
|
11066 { |
|
11067 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11068 symbol_c *IN_param_value = &this->default_variable_name; |
|
11069 |
|
11070 symbol_c *IN_type_symbol = param_data_type; |
|
11071 last_type_symbol = param_data_type; |
|
11072 |
|
11073 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11074 { |
|
11075 |
|
11076 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11077 s4o.print("("); |
|
11078 return_type_symbol->accept(*this); |
|
11079 s4o.print(")__int_to_time("); |
|
11080 IN_param_value->accept(*this); |
|
11081 s4o.print(")"); |
|
11082 return NULL; |
|
11083 |
|
11084 } |
|
11085 |
|
11086 ERROR; |
|
11087 } |
|
11088 |
|
11089 }/*function_dword_to_dt*/ |
|
11090 break; |
|
11091 |
|
11092 /**** |
|
11093 *DWORD_TO_STRING |
|
11094 */ |
|
11095 case function_dword_to_string : |
|
11096 { |
|
11097 symbol_c *last_type_symbol = NULL; |
|
11098 |
|
11099 { |
|
11100 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11101 symbol_c *IN_param_value = &this->default_variable_name; |
|
11102 |
|
11103 symbol_c *IN_type_symbol = param_data_type; |
|
11104 last_type_symbol = param_data_type; |
|
11105 |
|
11106 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11107 { |
|
11108 |
|
11109 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11110 s4o.print("("); |
|
11111 return_type_symbol->accept(*this); |
|
11112 s4o.print(")__bit_to_string("); |
|
11113 IN_param_value->accept(*this); |
|
11114 s4o.print(")"); |
|
11115 return NULL; |
|
11116 |
|
11117 } |
|
11118 |
|
11119 ERROR; |
|
11120 } |
|
11121 |
|
11122 }/*function_dword_to_string*/ |
|
11123 break; |
|
11124 |
|
11125 /**** |
|
11126 *DWORD_TO_BYTE |
|
11127 */ |
|
11128 case function_dword_to_byte : |
|
11129 { |
|
11130 symbol_c *last_type_symbol = NULL; |
|
11131 |
|
11132 { |
|
11133 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11134 symbol_c *IN_param_value = &this->default_variable_name; |
|
11135 |
|
11136 symbol_c *IN_type_symbol = param_data_type; |
|
11137 last_type_symbol = param_data_type; |
|
11138 |
|
11139 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11140 { |
|
11141 |
|
11142 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
11143 s4o.print("("); |
|
11144 return_type_symbol->accept(*this); |
|
11145 s4o.print(")"); |
|
11146 IN_param_value->accept(*this); |
|
11147 return NULL; |
|
11148 |
|
11149 } |
|
11150 |
|
11151 ERROR; |
|
11152 } |
|
11153 |
|
11154 }/*function_dword_to_byte*/ |
|
11155 break; |
|
11156 |
|
11157 /**** |
|
11158 *DWORD_TO_WORD |
|
11159 */ |
|
11160 case function_dword_to_word : |
|
11161 { |
|
11162 symbol_c *last_type_symbol = NULL; |
|
11163 |
|
11164 { |
|
11165 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11166 symbol_c *IN_param_value = &this->default_variable_name; |
|
11167 |
|
11168 symbol_c *IN_type_symbol = param_data_type; |
|
11169 last_type_symbol = param_data_type; |
|
11170 |
|
11171 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11172 { |
|
11173 |
|
11174 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11175 s4o.print("("); |
|
11176 return_type_symbol->accept(*this); |
|
11177 s4o.print(")"); |
|
11178 IN_param_value->accept(*this); |
|
11179 return NULL; |
|
11180 |
|
11181 } |
|
11182 |
|
11183 ERROR; |
|
11184 } |
|
11185 |
|
11186 }/*function_dword_to_word*/ |
|
11187 break; |
|
11188 |
|
11189 /**** |
|
11190 *DWORD_TO_LWORD |
|
11191 */ |
|
11192 case function_dword_to_lword : |
|
11193 { |
|
11194 symbol_c *last_type_symbol = NULL; |
|
11195 |
|
11196 { |
|
11197 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11198 symbol_c *IN_param_value = &this->default_variable_name; |
|
11199 |
|
11200 symbol_c *IN_type_symbol = param_data_type; |
|
11201 last_type_symbol = param_data_type; |
|
11202 |
|
11203 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11204 { |
|
11205 |
|
11206 symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
11207 s4o.print("("); |
|
11208 return_type_symbol->accept(*this); |
|
11209 s4o.print(")"); |
|
11210 IN_param_value->accept(*this); |
|
11211 return NULL; |
|
11212 |
|
11213 } |
|
11214 |
|
11215 ERROR; |
|
11216 } |
|
11217 |
|
11218 }/*function_dword_to_lword*/ |
|
11219 break; |
|
11220 |
|
11221 /**** |
|
11222 *LWORD_TO_BOOL |
|
11223 */ |
|
11224 case function_lword_to_bool : |
|
11225 { |
|
11226 symbol_c *last_type_symbol = NULL; |
|
11227 |
|
11228 { |
|
11229 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11230 symbol_c *IN_param_value = &this->default_variable_name; |
|
11231 |
|
11232 symbol_c *IN_type_symbol = param_data_type; |
|
11233 last_type_symbol = param_data_type; |
|
11234 |
|
11235 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11236 { |
|
11237 |
|
11238 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
11239 s4o.print("("); |
|
11240 return_type_symbol->accept(*this); |
|
11241 s4o.print(")"); |
|
11242 IN_param_value->accept(*this); |
|
11243 return NULL; |
|
11244 |
|
11245 } |
|
11246 |
|
11247 ERROR; |
|
11248 } |
|
11249 |
|
11250 }/*function_lword_to_bool*/ |
|
11251 break; |
|
11252 |
|
11253 /**** |
|
11254 *LWORD_TO_SINT |
|
11255 */ |
|
11256 case function_lword_to_sint : |
|
11257 { |
|
11258 symbol_c *last_type_symbol = NULL; |
|
11259 |
|
11260 { |
|
11261 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11262 symbol_c *IN_param_value = &this->default_variable_name; |
|
11263 |
|
11264 symbol_c *IN_type_symbol = param_data_type; |
|
11265 last_type_symbol = param_data_type; |
|
11266 |
|
11267 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11268 { |
|
11269 |
|
11270 symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
11271 s4o.print("("); |
|
11272 return_type_symbol->accept(*this); |
|
11273 s4o.print(")"); |
|
11274 IN_param_value->accept(*this); |
|
11275 return NULL; |
|
11276 |
|
11277 } |
|
11278 |
|
11279 ERROR; |
|
11280 } |
|
11281 |
|
11282 }/*function_lword_to_sint*/ |
|
11283 break; |
|
11284 |
|
11285 /**** |
|
11286 *LWORD_TO_INT |
|
11287 */ |
|
11288 case function_lword_to_int : |
|
11289 { |
|
11290 symbol_c *last_type_symbol = NULL; |
|
11291 |
|
11292 { |
|
11293 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11294 symbol_c *IN_param_value = &this->default_variable_name; |
|
11295 |
|
11296 symbol_c *IN_type_symbol = param_data_type; |
|
11297 last_type_symbol = param_data_type; |
|
11298 |
|
11299 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11300 { |
|
11301 |
|
11302 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
11303 s4o.print("("); |
|
11304 return_type_symbol->accept(*this); |
|
11305 s4o.print(")"); |
|
11306 IN_param_value->accept(*this); |
|
11307 return NULL; |
|
11308 |
|
11309 } |
|
11310 |
|
11311 ERROR; |
|
11312 } |
|
11313 |
|
11314 }/*function_lword_to_int*/ |
|
11315 break; |
|
11316 |
|
11317 /**** |
|
11318 *LWORD_TO_DINT |
|
11319 */ |
|
11320 case function_lword_to_dint : |
|
11321 { |
|
11322 symbol_c *last_type_symbol = NULL; |
|
11323 |
|
11324 { |
|
11325 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11326 symbol_c *IN_param_value = &this->default_variable_name; |
|
11327 |
|
11328 symbol_c *IN_type_symbol = param_data_type; |
|
11329 last_type_symbol = param_data_type; |
|
11330 |
|
11331 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11332 { |
|
11333 |
|
11334 symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
11335 s4o.print("("); |
|
11336 return_type_symbol->accept(*this); |
|
11337 s4o.print(")"); |
|
11338 IN_param_value->accept(*this); |
|
11339 return NULL; |
|
11340 |
|
11341 } |
|
11342 |
|
11343 ERROR; |
|
11344 } |
|
11345 |
|
11346 }/*function_lword_to_dint*/ |
|
11347 break; |
|
11348 |
|
11349 /**** |
|
11350 *LWORD_TO_LINT |
|
11351 */ |
|
11352 case function_lword_to_lint : |
|
11353 { |
|
11354 symbol_c *last_type_symbol = NULL; |
|
11355 |
|
11356 { |
|
11357 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11358 symbol_c *IN_param_value = &this->default_variable_name; |
|
11359 |
|
11360 symbol_c *IN_type_symbol = param_data_type; |
|
11361 last_type_symbol = param_data_type; |
|
11362 |
|
11363 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11364 { |
|
11365 |
|
11366 symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
11367 s4o.print("("); |
|
11368 return_type_symbol->accept(*this); |
|
11369 s4o.print(")"); |
|
11370 IN_param_value->accept(*this); |
|
11371 return NULL; |
|
11372 |
|
11373 } |
|
11374 |
|
11375 ERROR; |
|
11376 } |
|
11377 |
|
11378 }/*function_lword_to_lint*/ |
|
11379 break; |
|
11380 |
|
11381 /**** |
|
11382 *LWORD_TO_USINT |
|
11383 */ |
|
11384 case function_lword_to_usint : |
|
11385 { |
|
11386 symbol_c *last_type_symbol = NULL; |
|
11387 |
|
11388 { |
|
11389 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11390 symbol_c *IN_param_value = &this->default_variable_name; |
|
11391 |
|
11392 symbol_c *IN_type_symbol = param_data_type; |
|
11393 last_type_symbol = param_data_type; |
|
11394 |
|
11395 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11396 { |
|
11397 |
|
11398 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11399 s4o.print("("); |
|
11400 return_type_symbol->accept(*this); |
|
11401 s4o.print(")"); |
|
11402 IN_param_value->accept(*this); |
|
11403 return NULL; |
|
11404 |
|
11405 } |
|
11406 |
|
11407 ERROR; |
|
11408 } |
|
11409 |
|
11410 }/*function_lword_to_usint*/ |
|
11411 break; |
|
11412 |
|
11413 /**** |
|
11414 *LWORD_TO_UINT |
|
11415 */ |
|
11416 case function_lword_to_uint : |
|
11417 { |
|
11418 symbol_c *last_type_symbol = NULL; |
|
11419 |
|
11420 { |
|
11421 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11422 symbol_c *IN_param_value = &this->default_variable_name; |
|
11423 |
|
11424 symbol_c *IN_type_symbol = param_data_type; |
|
11425 last_type_symbol = param_data_type; |
|
11426 |
|
11427 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11428 { |
|
11429 |
|
11430 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11431 s4o.print("("); |
|
11432 return_type_symbol->accept(*this); |
|
11433 s4o.print(")"); |
|
11434 IN_param_value->accept(*this); |
|
11435 return NULL; |
|
11436 |
|
11437 } |
|
11438 |
|
11439 ERROR; |
|
11440 } |
|
11441 |
|
11442 }/*function_lword_to_uint*/ |
|
11443 break; |
|
11444 |
|
11445 /**** |
|
11446 *LWORD_TO_UDINT |
|
11447 */ |
|
11448 case function_lword_to_udint : |
|
11449 { |
|
11450 symbol_c *last_type_symbol = NULL; |
|
11451 |
|
11452 { |
|
11453 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11454 symbol_c *IN_param_value = &this->default_variable_name; |
|
11455 |
|
11456 symbol_c *IN_type_symbol = param_data_type; |
|
11457 last_type_symbol = param_data_type; |
|
11458 |
|
11459 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11460 { |
|
11461 |
|
11462 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11463 s4o.print("("); |
|
11464 return_type_symbol->accept(*this); |
|
11465 s4o.print(")"); |
|
11466 IN_param_value->accept(*this); |
|
11467 return NULL; |
|
11468 |
|
11469 } |
|
11470 |
|
11471 ERROR; |
|
11472 } |
|
11473 |
|
11474 }/*function_lword_to_udint*/ |
|
11475 break; |
|
11476 |
|
11477 /**** |
|
11478 *LWORD_TO_ULINT |
|
11479 */ |
|
11480 case function_lword_to_ulint : |
|
11481 { |
|
11482 symbol_c *last_type_symbol = NULL; |
|
11483 |
|
11484 { |
|
11485 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11486 symbol_c *IN_param_value = &this->default_variable_name; |
|
11487 |
|
11488 symbol_c *IN_type_symbol = param_data_type; |
|
11489 last_type_symbol = param_data_type; |
|
11490 |
|
11491 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11492 { |
|
11493 |
|
11494 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11495 s4o.print("("); |
|
11496 return_type_symbol->accept(*this); |
|
11497 s4o.print(")"); |
|
11498 IN_param_value->accept(*this); |
|
11499 return NULL; |
|
11500 |
|
11501 } |
|
11502 |
|
11503 ERROR; |
|
11504 } |
|
11505 |
|
11506 }/*function_lword_to_ulint*/ |
|
11507 break; |
|
11508 |
|
11509 /**** |
|
11510 *LWORD_TO_REAL |
|
11511 */ |
|
11512 case function_lword_to_real : |
|
11513 { |
|
11514 symbol_c *last_type_symbol = NULL; |
|
11515 |
|
11516 { |
|
11517 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11518 symbol_c *IN_param_value = &this->default_variable_name; |
|
11519 |
|
11520 symbol_c *IN_type_symbol = param_data_type; |
|
11521 last_type_symbol = param_data_type; |
|
11522 |
|
11523 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11524 { |
|
11525 |
|
11526 symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
11527 s4o.print("("); |
|
11528 return_type_symbol->accept(*this); |
|
11529 s4o.print(")"); |
|
11530 IN_param_value->accept(*this); |
|
11531 return NULL; |
|
11532 |
|
11533 } |
|
11534 |
|
11535 ERROR; |
|
11536 } |
|
11537 |
|
11538 }/*function_lword_to_real*/ |
|
11539 break; |
|
11540 |
|
11541 /**** |
|
11542 *LWORD_TO_LREAL |
|
11543 */ |
|
11544 case function_lword_to_lreal : |
|
11545 { |
|
11546 symbol_c *last_type_symbol = NULL; |
|
11547 |
|
11548 { |
|
11549 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11550 symbol_c *IN_param_value = &this->default_variable_name; |
|
11551 |
|
11552 symbol_c *IN_type_symbol = param_data_type; |
|
11553 last_type_symbol = param_data_type; |
|
11554 |
|
11555 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11556 { |
|
11557 |
|
11558 symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
11559 s4o.print("("); |
|
11560 return_type_symbol->accept(*this); |
|
11561 s4o.print(")"); |
|
11562 IN_param_value->accept(*this); |
|
11563 return NULL; |
|
11564 |
|
11565 } |
|
11566 |
|
11567 ERROR; |
|
11568 } |
|
11569 |
|
11570 }/*function_lword_to_lreal*/ |
|
11571 break; |
|
11572 |
|
11573 /**** |
|
11574 *LWORD_TO_TIME |
|
11575 */ |
|
11576 case function_lword_to_time : |
|
11577 { |
|
11578 symbol_c *last_type_symbol = NULL; |
|
11579 |
|
11580 { |
|
11581 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11582 symbol_c *IN_param_value = &this->default_variable_name; |
|
11583 |
|
11584 symbol_c *IN_type_symbol = param_data_type; |
|
11585 last_type_symbol = param_data_type; |
|
11586 |
|
11587 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11588 { |
|
11589 |
|
11590 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
11591 s4o.print("("); |
|
11592 return_type_symbol->accept(*this); |
|
11593 s4o.print(")__int_to_time("); |
|
11594 IN_param_value->accept(*this); |
|
11595 s4o.print(")"); |
|
11596 return NULL; |
|
11597 |
|
11598 } |
|
11599 |
|
11600 ERROR; |
|
11601 } |
|
11602 |
|
11603 }/*function_lword_to_time*/ |
|
11604 break; |
|
11605 |
|
11606 /**** |
|
11607 *LWORD_TO_DATE |
|
11608 */ |
|
11609 case function_lword_to_date : |
|
11610 { |
|
11611 symbol_c *last_type_symbol = NULL; |
|
11612 |
|
11613 { |
|
11614 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11615 symbol_c *IN_param_value = &this->default_variable_name; |
|
11616 |
|
11617 symbol_c *IN_type_symbol = param_data_type; |
|
11618 last_type_symbol = param_data_type; |
|
11619 |
|
11620 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11621 { |
|
11622 |
|
11623 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
11624 s4o.print("("); |
|
11625 return_type_symbol->accept(*this); |
|
11626 s4o.print(")__int_to_time("); |
|
11627 IN_param_value->accept(*this); |
|
11628 s4o.print(")"); |
|
11629 return NULL; |
|
11630 |
|
11631 } |
|
11632 |
|
11633 ERROR; |
|
11634 } |
|
11635 |
|
11636 }/*function_lword_to_date*/ |
|
11637 break; |
|
11638 |
|
11639 /**** |
|
11640 *LWORD_TO_TOD |
|
11641 */ |
|
11642 case function_lword_to_tod : |
|
11643 { |
|
11644 symbol_c *last_type_symbol = NULL; |
|
11645 |
|
11646 { |
|
11647 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11648 symbol_c *IN_param_value = &this->default_variable_name; |
|
11649 |
|
11650 symbol_c *IN_type_symbol = param_data_type; |
|
11651 last_type_symbol = param_data_type; |
|
11652 |
|
11653 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11654 { |
|
11655 |
|
11656 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
11657 s4o.print("("); |
|
11658 return_type_symbol->accept(*this); |
|
11659 s4o.print(")__int_to_time("); |
|
11660 IN_param_value->accept(*this); |
|
11661 s4o.print(")"); |
|
11662 return NULL; |
|
11663 |
|
11664 } |
|
11665 |
|
11666 ERROR; |
|
11667 } |
|
11668 |
|
11669 }/*function_lword_to_tod*/ |
|
11670 break; |
|
11671 |
|
11672 /**** |
|
11673 *LWORD_TO_DT |
|
11674 */ |
|
11675 case function_lword_to_dt : |
|
11676 { |
|
11677 symbol_c *last_type_symbol = NULL; |
|
11678 |
|
11679 { |
|
11680 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11681 symbol_c *IN_param_value = &this->default_variable_name; |
|
11682 |
|
11683 symbol_c *IN_type_symbol = param_data_type; |
|
11684 last_type_symbol = param_data_type; |
|
11685 |
|
11686 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11687 { |
|
11688 |
|
11689 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
11690 s4o.print("("); |
|
11691 return_type_symbol->accept(*this); |
|
11692 s4o.print(")__int_to_time("); |
|
11693 IN_param_value->accept(*this); |
|
11694 s4o.print(")"); |
|
11695 return NULL; |
|
11696 |
|
11697 } |
|
11698 |
|
11699 ERROR; |
|
11700 } |
|
11701 |
|
11702 }/*function_lword_to_dt*/ |
|
11703 break; |
|
11704 |
|
11705 /**** |
|
11706 *LWORD_TO_STRING |
|
11707 */ |
|
11708 case function_lword_to_string : |
|
11709 { |
|
11710 symbol_c *last_type_symbol = NULL; |
|
11711 |
|
11712 { |
|
11713 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11714 symbol_c *IN_param_value = &this->default_variable_name; |
|
11715 |
|
11716 symbol_c *IN_type_symbol = param_data_type; |
|
11717 last_type_symbol = param_data_type; |
|
11718 |
|
11719 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11720 { |
|
11721 |
|
11722 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
11723 s4o.print("("); |
|
11724 return_type_symbol->accept(*this); |
|
11725 s4o.print(")__bit_to_string("); |
|
11726 IN_param_value->accept(*this); |
|
11727 s4o.print(")"); |
|
11728 return NULL; |
|
11729 |
|
11730 } |
|
11731 |
|
11732 ERROR; |
|
11733 } |
|
11734 |
|
11735 }/*function_lword_to_string*/ |
|
11736 break; |
|
11737 |
|
11738 /**** |
|
11739 *LWORD_TO_BYTE |
|
11740 */ |
|
11741 case function_lword_to_byte : |
|
11742 { |
|
11743 symbol_c *last_type_symbol = NULL; |
|
11744 |
|
11745 { |
|
11746 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11747 symbol_c *IN_param_value = &this->default_variable_name; |
|
11748 |
|
11749 symbol_c *IN_type_symbol = param_data_type; |
|
11750 last_type_symbol = param_data_type; |
|
11751 |
|
11752 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11753 { |
|
11754 |
|
11755 symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
11756 s4o.print("("); |
|
11757 return_type_symbol->accept(*this); |
|
11758 s4o.print(")"); |
|
11759 IN_param_value->accept(*this); |
|
11760 return NULL; |
|
11761 |
|
11762 } |
|
11763 |
|
11764 ERROR; |
|
11765 } |
|
11766 |
|
11767 }/*function_lword_to_byte*/ |
|
11768 break; |
|
11769 |
|
11770 /**** |
|
11771 *LWORD_TO_WORD |
|
11772 */ |
|
11773 case function_lword_to_word : |
|
11774 { |
|
11775 symbol_c *last_type_symbol = NULL; |
|
11776 |
|
11777 { |
|
11778 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11779 symbol_c *IN_param_value = &this->default_variable_name; |
|
11780 |
|
11781 symbol_c *IN_type_symbol = param_data_type; |
|
11782 last_type_symbol = param_data_type; |
|
11783 |
|
11784 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11785 { |
|
11786 |
|
11787 symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
11788 s4o.print("("); |
|
11789 return_type_symbol->accept(*this); |
|
11790 s4o.print(")"); |
|
11791 IN_param_value->accept(*this); |
|
11792 return NULL; |
|
11793 |
|
11794 } |
|
11795 |
|
11796 ERROR; |
|
11797 } |
|
11798 |
|
11799 }/*function_lword_to_word*/ |
|
11800 break; |
|
11801 |
|
11802 /**** |
|
11803 *LWORD_TO_DWORD |
|
11804 */ |
|
11805 case function_lword_to_dword : |
|
11806 { |
|
11807 symbol_c *last_type_symbol = NULL; |
|
11808 |
|
11809 { |
|
11810 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11811 symbol_c *IN_param_value = &this->default_variable_name; |
|
11812 |
|
11813 symbol_c *IN_type_symbol = param_data_type; |
|
11814 last_type_symbol = param_data_type; |
|
11815 |
|
11816 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11817 { |
|
11818 |
|
11819 symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
11820 s4o.print("("); |
|
11821 return_type_symbol->accept(*this); |
|
11822 s4o.print(")"); |
|
11823 IN_param_value->accept(*this); |
|
11824 return NULL; |
|
11825 |
|
11826 } |
|
11827 |
|
11828 ERROR; |
|
11829 } |
|
11830 |
|
11831 }/*function_lword_to_dword*/ |
|
11832 break; |
|
11833 |
|
11834 /**** |
|
11835 *TRUNC |
|
11836 */ |
|
11837 case function_trunc : |
|
11838 { |
|
11839 symbol_c *last_type_symbol = NULL; |
|
11840 |
|
11841 { |
|
11842 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11843 symbol_c *IN_param_value = &this->default_variable_name; |
|
11844 |
|
11845 symbol_c *IN_type_symbol = param_data_type; |
|
11846 last_type_symbol = param_data_type; |
|
11847 |
|
11848 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
11849 { |
|
11850 |
|
11851 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
11852 s4o.print("(int)"); |
|
11853 IN_param_value->accept(*this); |
|
11854 return NULL; |
|
11855 |
|
11856 } |
|
11857 |
|
11858 ERROR; |
|
11859 } |
|
11860 |
|
11861 }/*function_trunc*/ |
|
11862 break; |
|
11863 |
|
11864 /**** |
|
11865 *BCD_TO_USINT |
|
11866 */ |
|
11867 case function_bcd_to_usint : |
|
11868 { |
|
11869 symbol_c *last_type_symbol = NULL; |
|
11870 |
|
11871 { |
|
11872 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11873 symbol_c *IN_param_value = &this->default_variable_name; |
|
11874 |
|
11875 symbol_c *IN_type_symbol = param_data_type; |
|
11876 last_type_symbol = param_data_type; |
|
11877 |
|
11878 if(search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) |
|
11879 { |
|
11880 |
|
11881 symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
11882 s4o.print("("); |
|
11883 return_type_symbol->accept(*this); |
|
11884 s4o.print(")__bcd_to_uint("); |
|
11885 IN_param_value->accept(*this); |
|
11886 s4o.print(")"); |
|
11887 return NULL; |
|
11888 |
|
11889 } |
|
11890 |
|
11891 ERROR; |
|
11892 } |
|
11893 |
|
11894 }/*function_bcd_to_usint*/ |
|
11895 break; |
|
11896 |
|
11897 /**** |
|
11898 *BCD_TO_UINT |
|
11899 */ |
|
11900 case function_bcd_to_uint : |
|
11901 { |
|
11902 symbol_c *last_type_symbol = NULL; |
|
11903 |
|
11904 { |
|
11905 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11906 symbol_c *IN_param_value = &this->default_variable_name; |
|
11907 |
|
11908 symbol_c *IN_type_symbol = param_data_type; |
|
11909 last_type_symbol = param_data_type; |
|
11910 |
|
11911 if(search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) |
|
11912 { |
|
11913 |
|
11914 symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
11915 s4o.print("("); |
|
11916 return_type_symbol->accept(*this); |
|
11917 s4o.print(")__bcd_to_uint("); |
|
11918 IN_param_value->accept(*this); |
|
11919 s4o.print(")"); |
|
11920 return NULL; |
|
11921 |
|
11922 } |
|
11923 |
|
11924 ERROR; |
|
11925 } |
|
11926 |
|
11927 }/*function_bcd_to_uint*/ |
|
11928 break; |
|
11929 |
|
11930 /**** |
|
11931 *BCD_TO_UDINT |
|
11932 */ |
|
11933 case function_bcd_to_udint : |
|
11934 { |
|
11935 symbol_c *last_type_symbol = NULL; |
|
11936 |
|
11937 { |
|
11938 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11939 symbol_c *IN_param_value = &this->default_variable_name; |
|
11940 |
|
11941 symbol_c *IN_type_symbol = param_data_type; |
|
11942 last_type_symbol = param_data_type; |
|
11943 |
|
11944 if(search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) |
|
11945 { |
|
11946 |
|
11947 symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
11948 s4o.print("("); |
|
11949 return_type_symbol->accept(*this); |
|
11950 s4o.print(")__bcd_to_uint("); |
|
11951 IN_param_value->accept(*this); |
|
11952 s4o.print(")"); |
|
11953 return NULL; |
|
11954 |
|
11955 } |
|
11956 |
|
11957 ERROR; |
|
11958 } |
|
11959 |
|
11960 }/*function_bcd_to_udint*/ |
|
11961 break; |
|
11962 |
|
11963 /**** |
|
11964 *BCD_TO_ULINT |
|
11965 */ |
|
11966 case function_bcd_to_ulint : |
|
11967 { |
|
11968 symbol_c *last_type_symbol = NULL; |
|
11969 |
|
11970 { |
|
11971 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
11972 symbol_c *IN_param_value = &this->default_variable_name; |
|
11973 |
|
11974 symbol_c *IN_type_symbol = param_data_type; |
|
11975 last_type_symbol = param_data_type; |
|
11976 |
|
11977 if(search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) |
|
11978 { |
|
11979 |
|
11980 symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
11981 s4o.print("("); |
|
11982 return_type_symbol->accept(*this); |
|
11983 s4o.print(")__bcd_to_uint("); |
|
11984 IN_param_value->accept(*this); |
|
11985 s4o.print(")"); |
|
11986 return NULL; |
|
11987 |
|
11988 } |
|
11989 |
|
11990 ERROR; |
|
11991 } |
|
11992 |
|
11993 }/*function_bcd_to_ulint*/ |
|
11994 break; |
|
11995 |
|
11996 /**** |
|
11997 *USINT_TO_BCD |
|
11998 */ |
|
11999 case function_usint_to_bcd : |
|
12000 { |
|
12001 symbol_c *last_type_symbol = NULL; |
|
12002 |
|
12003 { |
|
12004 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12005 symbol_c *IN_param_value = &this->default_variable_name; |
|
12006 |
|
12007 symbol_c *IN_type_symbol = param_data_type; |
|
12008 last_type_symbol = param_data_type; |
|
12009 |
|
12010 if(search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) |
|
12011 { |
|
12012 |
|
12013 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
12014 s4o.print("("); |
|
12015 return_type_symbol->accept(*this); |
|
12016 s4o.print(")__uint_to_bcd("); |
|
12017 IN_param_value->accept(*this); |
|
12018 s4o.print(")"); |
|
12019 return NULL; |
|
12020 |
|
12021 } |
|
12022 |
|
12023 ERROR; |
|
12024 } |
|
12025 |
|
12026 }/*function_usint_to_bcd*/ |
|
12027 break; |
|
12028 |
|
12029 /**** |
|
12030 *UINT_TO_BCD |
|
12031 */ |
|
12032 case function_uint_to_bcd : |
|
12033 { |
|
12034 symbol_c *last_type_symbol = NULL; |
|
12035 |
|
12036 { |
|
12037 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12038 symbol_c *IN_param_value = &this->default_variable_name; |
|
12039 |
|
12040 symbol_c *IN_type_symbol = param_data_type; |
|
12041 last_type_symbol = param_data_type; |
|
12042 |
|
12043 if(search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) |
|
12044 { |
|
12045 |
|
12046 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
12047 s4o.print("("); |
|
12048 return_type_symbol->accept(*this); |
|
12049 s4o.print(")__uint_to_bcd("); |
|
12050 IN_param_value->accept(*this); |
|
12051 s4o.print(")"); |
|
12052 return NULL; |
|
12053 |
|
12054 } |
|
12055 |
|
12056 ERROR; |
|
12057 } |
|
12058 |
|
12059 }/*function_uint_to_bcd*/ |
|
12060 break; |
|
12061 |
|
12062 /**** |
|
12063 *UDINT_TO_BCD |
|
12064 */ |
|
12065 case function_udint_to_bcd : |
|
12066 { |
|
12067 symbol_c *last_type_symbol = NULL; |
|
12068 |
|
12069 { |
|
12070 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12071 symbol_c *IN_param_value = &this->default_variable_name; |
|
12072 |
|
12073 symbol_c *IN_type_symbol = param_data_type; |
|
12074 last_type_symbol = param_data_type; |
|
12075 |
|
12076 if(search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) |
|
12077 { |
|
12078 |
|
12079 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
12080 s4o.print("("); |
|
12081 return_type_symbol->accept(*this); |
|
12082 s4o.print(")__uint_to_bcd("); |
|
12083 IN_param_value->accept(*this); |
|
12084 s4o.print(")"); |
|
12085 return NULL; |
|
12086 |
|
12087 } |
|
12088 |
|
12089 ERROR; |
|
12090 } |
|
12091 |
|
12092 }/*function_udint_to_bcd*/ |
|
12093 break; |
|
12094 |
|
12095 /**** |
|
12096 *ULINT_TO_BCD |
|
12097 */ |
|
12098 case function_ulint_to_bcd : |
|
12099 { |
|
12100 symbol_c *last_type_symbol = NULL; |
|
12101 |
|
12102 { |
|
12103 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12104 symbol_c *IN_param_value = &this->default_variable_name; |
|
12105 |
|
12106 symbol_c *IN_type_symbol = param_data_type; |
|
12107 last_type_symbol = param_data_type; |
|
12108 |
|
12109 if(search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) |
|
12110 { |
|
12111 |
|
12112 symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name; |
|
12113 s4o.print("("); |
|
12114 return_type_symbol->accept(*this); |
|
12115 s4o.print(")__uint_to_bcd("); |
|
12116 IN_param_value->accept(*this); |
|
12117 s4o.print(")"); |
|
12118 return NULL; |
|
12119 |
|
12120 } |
|
12121 |
|
12122 ERROR; |
|
12123 } |
|
12124 |
|
12125 }/*function_ulint_to_bcd*/ |
|
12126 break; |
|
12127 |
|
12128 /**** |
|
12129 *DATE_AND_TIME_TO_TIME_OF_DAY |
|
12130 */ |
|
12131 case function_date_and_time_to_time_of_day : |
|
12132 { |
|
12133 symbol_c *last_type_symbol = NULL; |
|
12134 |
|
12135 { |
|
12136 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12137 symbol_c *IN_param_value = &this->default_variable_name; |
|
12138 |
|
12139 symbol_c *IN_type_symbol = param_data_type; |
|
12140 last_type_symbol = param_data_type; |
|
12141 |
|
12142 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
12143 { |
|
12144 |
|
12145 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12146 s4o.print("__date_and_time_to_time_of_day("); |
|
12147 IN_param_value->accept(*this); |
|
12148 s4o.print(")"); |
|
12149 return NULL; |
|
12150 |
|
12151 } |
|
12152 |
|
12153 ERROR; |
|
12154 } |
|
12155 |
|
12156 }/*function_date_and_time_to_time_of_day*/ |
|
12157 break; |
|
12158 |
|
12159 /**** |
|
12160 *DATE_AND_TIME_TO_DATE |
|
12161 */ |
|
12162 case function_date_and_time_to_date : |
|
12163 { |
|
12164 symbol_c *last_type_symbol = NULL; |
|
12165 |
|
12166 { |
|
12167 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12168 symbol_c *IN_param_value = &this->default_variable_name; |
|
12169 |
|
12170 symbol_c *IN_type_symbol = param_data_type; |
|
12171 last_type_symbol = param_data_type; |
|
12172 |
|
12173 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
12174 { |
|
12175 |
|
12176 symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
12177 s4o.print("__date_and_time_to_date("); |
|
12178 IN_param_value->accept(*this); |
|
12179 s4o.print(")"); |
|
12180 return NULL; |
|
12181 |
|
12182 } |
|
12183 |
|
12184 ERROR; |
|
12185 } |
|
12186 |
|
12187 }/*function_date_and_time_to_date*/ |
|
12188 break; |
|
12189 |
|
12190 /**** |
|
12191 *ABS |
|
12192 */ |
|
12193 case function_abs : |
|
12194 { |
|
12195 symbol_c *last_type_symbol = NULL; |
|
12196 |
|
12197 { |
|
12198 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12199 symbol_c *IN_param_value = &this->default_variable_name; |
|
12200 |
|
12201 symbol_c *IN_type_symbol = param_data_type; |
|
12202 last_type_symbol = param_data_type; |
|
12203 |
|
12204 if(search_expression_type->is_num_type(IN_type_symbol)) |
|
12205 { |
|
12206 |
|
12207 symbol_c * return_type_symbol = IN_type_symbol; |
|
12208 s4o.print("__abs_"); |
|
12209 IN_type_symbol->accept(*this); |
|
12210 s4o.print("("); |
|
12211 IN_param_value->accept(*this); |
|
12212 s4o.print(")"); |
|
12213 return NULL; |
|
12214 |
|
12215 } |
|
12216 |
|
12217 ERROR; |
|
12218 } |
|
12219 |
|
12220 }/*function_abs*/ |
|
12221 break; |
|
12222 |
|
12223 /**** |
|
12224 *SQRT |
|
12225 */ |
|
12226 case function_sqrt : |
|
12227 { |
|
12228 symbol_c *last_type_symbol = NULL; |
|
12229 |
|
12230 { |
|
12231 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12232 symbol_c *IN_param_value = &this->default_variable_name; |
|
12233 |
|
12234 symbol_c *IN_type_symbol = param_data_type; |
|
12235 last_type_symbol = param_data_type; |
|
12236 |
|
12237 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12238 { |
|
12239 |
|
12240 symbol_c * return_type_symbol = IN_type_symbol; |
|
12241 s4o.print("sqrt("); |
|
12242 IN_param_value->accept(*this); |
|
12243 s4o.print(")"); |
|
12244 return NULL; |
|
12245 |
|
12246 } |
|
12247 |
|
12248 ERROR; |
|
12249 } |
|
12250 |
|
12251 }/*function_sqrt*/ |
|
12252 break; |
|
12253 |
|
12254 /**** |
|
12255 *LN |
|
12256 */ |
|
12257 case function_ln : |
|
12258 { |
|
12259 symbol_c *last_type_symbol = NULL; |
|
12260 |
|
12261 { |
|
12262 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12263 symbol_c *IN_param_value = &this->default_variable_name; |
|
12264 |
|
12265 symbol_c *IN_type_symbol = param_data_type; |
|
12266 last_type_symbol = param_data_type; |
|
12267 |
|
12268 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12269 { |
|
12270 |
|
12271 symbol_c * return_type_symbol = IN_type_symbol; |
|
12272 s4o.print("ln("); |
|
12273 IN_param_value->accept(*this); |
|
12274 s4o.print(")"); |
|
12275 return NULL; |
|
12276 |
|
12277 } |
|
12278 |
|
12279 ERROR; |
|
12280 } |
|
12281 |
|
12282 }/*function_ln*/ |
|
12283 break; |
|
12284 |
|
12285 /**** |
|
12286 *LOG |
|
12287 */ |
|
12288 case function_log : |
|
12289 { |
|
12290 symbol_c *last_type_symbol = NULL; |
|
12291 |
|
12292 { |
|
12293 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12294 symbol_c *IN_param_value = &this->default_variable_name; |
|
12295 |
|
12296 symbol_c *IN_type_symbol = param_data_type; |
|
12297 last_type_symbol = param_data_type; |
|
12298 |
|
12299 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12300 { |
|
12301 |
|
12302 symbol_c * return_type_symbol = IN_type_symbol; |
|
12303 s4o.print("log("); |
|
12304 IN_param_value->accept(*this); |
|
12305 s4o.print(")"); |
|
12306 return NULL; |
|
12307 |
|
12308 } |
|
12309 |
|
12310 ERROR; |
|
12311 } |
|
12312 |
|
12313 }/*function_log*/ |
|
12314 break; |
|
12315 |
|
12316 /**** |
|
12317 *EXP |
|
12318 */ |
|
12319 case function_exp : |
|
12320 { |
|
12321 symbol_c *last_type_symbol = NULL; |
|
12322 |
|
12323 { |
|
12324 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12325 symbol_c *IN_param_value = &this->default_variable_name; |
|
12326 |
|
12327 symbol_c *IN_type_symbol = param_data_type; |
|
12328 last_type_symbol = param_data_type; |
|
12329 |
|
12330 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12331 { |
|
12332 |
|
12333 symbol_c * return_type_symbol = IN_type_symbol; |
|
12334 s4o.print("exp("); |
|
12335 IN_param_value->accept(*this); |
|
12336 s4o.print(")"); |
|
12337 return NULL; |
|
12338 |
|
12339 } |
|
12340 |
|
12341 ERROR; |
|
12342 } |
|
12343 |
|
12344 }/*function_exp*/ |
|
12345 break; |
|
12346 |
|
12347 /**** |
|
12348 *SIN |
|
12349 */ |
|
12350 case function_sin : |
|
12351 { |
|
12352 symbol_c *last_type_symbol = NULL; |
|
12353 |
|
12354 { |
|
12355 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12356 symbol_c *IN_param_value = &this->default_variable_name; |
|
12357 |
|
12358 symbol_c *IN_type_symbol = param_data_type; |
|
12359 last_type_symbol = param_data_type; |
|
12360 |
|
12361 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12362 { |
|
12363 |
|
12364 symbol_c * return_type_symbol = IN_type_symbol; |
|
12365 s4o.print("sin("); |
|
12366 IN_param_value->accept(*this); |
|
12367 s4o.print(")"); |
|
12368 return NULL; |
|
12369 |
|
12370 } |
|
12371 |
|
12372 ERROR; |
|
12373 } |
|
12374 |
|
12375 }/*function_sin*/ |
|
12376 break; |
|
12377 |
|
12378 /**** |
|
12379 *COS |
|
12380 */ |
|
12381 case function_cos : |
|
12382 { |
|
12383 symbol_c *last_type_symbol = NULL; |
|
12384 |
|
12385 { |
|
12386 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12387 symbol_c *IN_param_value = &this->default_variable_name; |
|
12388 |
|
12389 symbol_c *IN_type_symbol = param_data_type; |
|
12390 last_type_symbol = param_data_type; |
|
12391 |
|
12392 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12393 { |
|
12394 |
|
12395 symbol_c * return_type_symbol = IN_type_symbol; |
|
12396 s4o.print("cos("); |
|
12397 IN_param_value->accept(*this); |
|
12398 s4o.print(")"); |
|
12399 return NULL; |
|
12400 |
|
12401 } |
|
12402 |
|
12403 ERROR; |
|
12404 } |
|
12405 |
|
12406 }/*function_cos*/ |
|
12407 break; |
|
12408 |
|
12409 /**** |
|
12410 *TAN |
|
12411 */ |
|
12412 case function_tan : |
|
12413 { |
|
12414 symbol_c *last_type_symbol = NULL; |
|
12415 |
|
12416 { |
|
12417 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12418 symbol_c *IN_param_value = &this->default_variable_name; |
|
12419 |
|
12420 symbol_c *IN_type_symbol = param_data_type; |
|
12421 last_type_symbol = param_data_type; |
|
12422 |
|
12423 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12424 { |
|
12425 |
|
12426 symbol_c * return_type_symbol = IN_type_symbol; |
|
12427 s4o.print("tan("); |
|
12428 IN_param_value->accept(*this); |
|
12429 s4o.print(")"); |
|
12430 return NULL; |
|
12431 |
|
12432 } |
|
12433 |
|
12434 ERROR; |
|
12435 } |
|
12436 |
|
12437 }/*function_tan*/ |
|
12438 break; |
|
12439 |
|
12440 /**** |
|
12441 *ASIN |
|
12442 */ |
|
12443 case function_asin : |
|
12444 { |
|
12445 symbol_c *last_type_symbol = NULL; |
|
12446 |
|
12447 { |
|
12448 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12449 symbol_c *IN_param_value = &this->default_variable_name; |
|
12450 |
|
12451 symbol_c *IN_type_symbol = param_data_type; |
|
12452 last_type_symbol = param_data_type; |
|
12453 |
|
12454 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12455 { |
|
12456 |
|
12457 symbol_c * return_type_symbol = IN_type_symbol; |
|
12458 s4o.print("asin("); |
|
12459 IN_param_value->accept(*this); |
|
12460 s4o.print(")"); |
|
12461 return NULL; |
|
12462 |
|
12463 } |
|
12464 |
|
12465 ERROR; |
|
12466 } |
|
12467 |
|
12468 }/*function_asin*/ |
|
12469 break; |
|
12470 |
|
12471 /**** |
|
12472 *ACOS |
|
12473 */ |
|
12474 case function_acos : |
|
12475 { |
|
12476 symbol_c *last_type_symbol = NULL; |
|
12477 |
|
12478 { |
|
12479 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12480 symbol_c *IN_param_value = &this->default_variable_name; |
|
12481 |
|
12482 symbol_c *IN_type_symbol = param_data_type; |
|
12483 last_type_symbol = param_data_type; |
|
12484 |
|
12485 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12486 { |
|
12487 |
|
12488 symbol_c * return_type_symbol = IN_type_symbol; |
|
12489 s4o.print("acos("); |
|
12490 IN_param_value->accept(*this); |
|
12491 s4o.print(")"); |
|
12492 return NULL; |
|
12493 |
|
12494 } |
|
12495 |
|
12496 ERROR; |
|
12497 } |
|
12498 |
|
12499 }/*function_acos*/ |
|
12500 break; |
|
12501 |
|
12502 /**** |
|
12503 *ATAN |
|
12504 */ |
|
12505 case function_atan : |
|
12506 { |
|
12507 symbol_c *last_type_symbol = NULL; |
|
12508 |
|
12509 { |
|
12510 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12511 symbol_c *IN_param_value = &this->default_variable_name; |
|
12512 |
|
12513 symbol_c *IN_type_symbol = param_data_type; |
|
12514 last_type_symbol = param_data_type; |
|
12515 |
|
12516 if(search_expression_type->is_real_type(IN_type_symbol)) |
|
12517 { |
|
12518 |
|
12519 symbol_c * return_type_symbol = IN_type_symbol; |
|
12520 s4o.print("atan("); |
|
12521 IN_param_value->accept(*this); |
|
12522 s4o.print(")"); |
|
12523 return NULL; |
|
12524 |
|
12525 } |
|
12526 |
|
12527 ERROR; |
|
12528 } |
|
12529 |
|
12530 }/*function_atan*/ |
|
12531 break; |
|
12532 |
|
12533 /**** |
|
12534 *ADD |
|
12535 */ |
|
12536 case function_add : |
|
12537 { |
|
12538 symbol_c *last_type_symbol = NULL; |
|
12539 |
|
12540 { |
|
12541 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12542 symbol_c *IN1_param_value = &this->default_variable_name; |
|
12543 |
|
12544 symbol_c *IN1_type_symbol = param_data_type; |
|
12545 last_type_symbol = param_data_type; |
|
12546 |
|
12547 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
12548 { |
|
12549 |
|
12550 { |
|
12551 identifier_c param_name("IN2"); |
|
12552 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12553 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12554 |
|
12555 /* Get the value from a foo(<param_value>) style call */ |
|
12556 if (IN2_param_value == NULL) |
|
12557 IN2_param_value = function_call_param_iterator.next(); |
|
12558 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12559 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 ; |
|
12560 |
|
12561 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
12562 { |
|
12563 |
|
12564 symbol_c * return_type_symbol = last_type_symbol; |
|
12565 s4o.indent_right(); |
|
12566 s4o.print("(\n" + s4o.indent_spaces); |
|
12567 IN1_param_value->accept(*this); |
|
12568 s4o.print("+\n" + s4o.indent_spaces); |
|
12569 IN2_param_value->accept(*this); |
|
12570 |
|
12571 int base_num = 3; |
|
12572 symbol_c *param_value = NULL; |
|
12573 do{ |
|
12574 char my_name[10]; |
|
12575 sprintf(my_name, "IN%d", base_num++); |
|
12576 identifier_c param_name(my_name); |
|
12577 |
|
12578 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12579 param_value = function_call_param_iterator.search(¶m_name); |
|
12580 |
|
12581 /* Get the value from a foo(<param_value>) style call */ |
|
12582 if (param_value == NULL) |
|
12583 param_value = function_call_param_iterator.next(); |
|
12584 if (param_value != NULL){ |
|
12585 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
12586 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
12587 |
|
12588 /*Function specific CODE */ |
|
12589 s4o.print("+\n" + s4o.indent_spaces); |
|
12590 param_value->accept(*this); |
|
12591 |
|
12592 } |
|
12593 |
|
12594 }while(param_value != NULL); |
|
12595 s4o.print(")"); |
|
12596 s4o.indent_left(); |
|
12597 return NULL; |
|
12598 |
|
12599 |
|
12600 } |
|
12601 |
|
12602 ERROR; |
|
12603 } |
|
12604 |
|
12605 } |
|
12606 |
|
12607 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
12608 { |
|
12609 |
|
12610 { |
|
12611 identifier_c param_name("IN2"); |
|
12612 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12613 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12614 |
|
12615 /* Get the value from a foo(<param_value>) style call */ |
|
12616 if (IN2_param_value == NULL) |
|
12617 IN2_param_value = function_call_param_iterator.next(); |
|
12618 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12619 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 ; |
|
12620 |
|
12621 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12622 { |
|
12623 |
|
12624 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12625 s4o.print("__time_add("); |
|
12626 IN1_param_value->accept(*this); |
|
12627 s4o.print(", "); |
|
12628 IN2_param_value->accept(*this); |
|
12629 s4o.print(")"); |
|
12630 return NULL; |
|
12631 |
|
12632 } |
|
12633 |
|
12634 ERROR; |
|
12635 } |
|
12636 |
|
12637 } |
|
12638 |
|
12639 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
12640 { |
|
12641 |
|
12642 { |
|
12643 identifier_c param_name("IN2"); |
|
12644 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12645 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12646 |
|
12647 /* Get the value from a foo(<param_value>) style call */ |
|
12648 if (IN2_param_value == NULL) |
|
12649 IN2_param_value = function_call_param_iterator.next(); |
|
12650 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12651 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 ; |
|
12652 |
|
12653 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12654 { |
|
12655 |
|
12656 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12657 s4o.print("__time_add("); |
|
12658 IN1_param_value->accept(*this); |
|
12659 s4o.print(", "); |
|
12660 IN2_param_value->accept(*this); |
|
12661 s4o.print(")"); |
|
12662 return NULL; |
|
12663 |
|
12664 } |
|
12665 |
|
12666 ERROR; |
|
12667 } |
|
12668 |
|
12669 } |
|
12670 |
|
12671 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12672 { |
|
12673 |
|
12674 { |
|
12675 identifier_c param_name("IN2"); |
|
12676 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12677 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12678 |
|
12679 /* Get the value from a foo(<param_value>) style call */ |
|
12680 if (IN2_param_value == NULL) |
|
12681 IN2_param_value = function_call_param_iterator.next(); |
|
12682 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12683 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 ; |
|
12684 |
|
12685 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12686 { |
|
12687 |
|
12688 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12689 s4o.print("__time_add("); |
|
12690 IN1_param_value->accept(*this); |
|
12691 s4o.print(", "); |
|
12692 IN2_param_value->accept(*this); |
|
12693 s4o.print(")"); |
|
12694 return NULL; |
|
12695 |
|
12696 } |
|
12697 |
|
12698 ERROR; |
|
12699 } |
|
12700 |
|
12701 } |
|
12702 |
|
12703 ERROR; |
|
12704 } |
|
12705 |
|
12706 }/*function_add*/ |
|
12707 break; |
|
12708 |
|
12709 /**** |
|
12710 *MUL |
|
12711 */ |
|
12712 case function_mul : |
|
12713 { |
|
12714 symbol_c *last_type_symbol = NULL; |
|
12715 |
|
12716 { |
|
12717 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12718 symbol_c *IN1_param_value = &this->default_variable_name; |
|
12719 |
|
12720 symbol_c *IN1_type_symbol = param_data_type; |
|
12721 last_type_symbol = param_data_type; |
|
12722 |
|
12723 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
12724 { |
|
12725 |
|
12726 { |
|
12727 identifier_c param_name("IN2"); |
|
12728 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12729 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12730 |
|
12731 /* Get the value from a foo(<param_value>) style call */ |
|
12732 if (IN2_param_value == NULL) |
|
12733 IN2_param_value = function_call_param_iterator.next(); |
|
12734 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12735 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 ; |
|
12736 |
|
12737 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
12738 { |
|
12739 |
|
12740 symbol_c * return_type_symbol = last_type_symbol; |
|
12741 s4o.indent_right(); |
|
12742 s4o.print("(\n" + s4o.indent_spaces); |
|
12743 IN1_param_value->accept(*this); |
|
12744 s4o.print("*\n" + s4o.indent_spaces); |
|
12745 IN2_param_value->accept(*this); |
|
12746 |
|
12747 int base_num = 3; |
|
12748 symbol_c *param_value = NULL; |
|
12749 do{ |
|
12750 char my_name[10]; |
|
12751 sprintf(my_name, "IN%d", base_num++); |
|
12752 identifier_c param_name(my_name); |
|
12753 |
|
12754 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12755 param_value = function_call_param_iterator.search(¶m_name); |
|
12756 |
|
12757 /* Get the value from a foo(<param_value>) style call */ |
|
12758 if (param_value == NULL) |
|
12759 param_value = function_call_param_iterator.next(); |
|
12760 if (param_value != NULL){ |
|
12761 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
12762 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
12763 |
|
12764 /*Function specific CODE */ |
|
12765 s4o.print("*\n" + s4o.indent_spaces); |
|
12766 param_value->accept(*this); |
|
12767 |
|
12768 } |
|
12769 |
|
12770 }while(param_value != NULL); |
|
12771 s4o.print(")"); |
|
12772 s4o.indent_left(); |
|
12773 return NULL; |
|
12774 |
|
12775 |
|
12776 } |
|
12777 |
|
12778 ERROR; |
|
12779 } |
|
12780 |
|
12781 } |
|
12782 |
|
12783 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12784 { |
|
12785 |
|
12786 { |
|
12787 identifier_c param_name("IN2"); |
|
12788 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12789 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12790 |
|
12791 /* Get the value from a foo(<param_value>) style call */ |
|
12792 if (IN2_param_value == NULL) |
|
12793 IN2_param_value = function_call_param_iterator.next(); |
|
12794 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12795 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 ; |
|
12796 |
|
12797 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
12798 { |
|
12799 |
|
12800 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12801 s4o.print("__time_mul("); |
|
12802 IN1_param_value->accept(*this); |
|
12803 s4o.print(", "); |
|
12804 IN2_param_value->accept(*this); |
|
12805 s4o.print(")"); |
|
12806 return NULL; |
|
12807 |
|
12808 } |
|
12809 |
|
12810 ERROR; |
|
12811 } |
|
12812 |
|
12813 } |
|
12814 |
|
12815 ERROR; |
|
12816 } |
|
12817 |
|
12818 }/*function_mul*/ |
|
12819 break; |
|
12820 |
|
12821 /**** |
|
12822 *SUB |
|
12823 */ |
|
12824 case function_sub : |
|
12825 { |
|
12826 symbol_c *last_type_symbol = NULL; |
|
12827 |
|
12828 { |
|
12829 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12830 symbol_c *IN1_param_value = &this->default_variable_name; |
|
12831 |
|
12832 symbol_c *IN1_type_symbol = param_data_type; |
|
12833 last_type_symbol = param_data_type; |
|
12834 |
|
12835 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
12836 { |
|
12837 |
|
12838 { |
|
12839 identifier_c param_name("IN2"); |
|
12840 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12841 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12842 |
|
12843 /* Get the value from a foo(<param_value>) style call */ |
|
12844 if (IN2_param_value == NULL) |
|
12845 IN2_param_value = function_call_param_iterator.next(); |
|
12846 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12847 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 ; |
|
12848 |
|
12849 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
12850 { |
|
12851 |
|
12852 symbol_c * return_type_symbol = last_type_symbol; |
|
12853 s4o.indent_right(); |
|
12854 s4o.print("(\n" + s4o.indent_spaces); |
|
12855 IN1_param_value->accept(*this); |
|
12856 s4o.print("-\n" + s4o.indent_spaces); |
|
12857 IN2_param_value->accept(*this); |
|
12858 s4o.print(")"); |
|
12859 s4o.indent_left(); |
|
12860 return NULL; |
|
12861 |
|
12862 } |
|
12863 |
|
12864 ERROR; |
|
12865 } |
|
12866 |
|
12867 } |
|
12868 |
|
12869 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
12870 { |
|
12871 |
|
12872 { |
|
12873 identifier_c param_name("IN2"); |
|
12874 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12875 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12876 |
|
12877 /* Get the value from a foo(<param_value>) style call */ |
|
12878 if (IN2_param_value == NULL) |
|
12879 IN2_param_value = function_call_param_iterator.next(); |
|
12880 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12881 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 ; |
|
12882 |
|
12883 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
12884 { |
|
12885 |
|
12886 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12887 s4o.print("__time_sub("); |
|
12888 IN1_param_value->accept(*this); |
|
12889 s4o.print(", "); |
|
12890 IN2_param_value->accept(*this); |
|
12891 s4o.print(")"); |
|
12892 return NULL; |
|
12893 |
|
12894 } |
|
12895 |
|
12896 ERROR; |
|
12897 } |
|
12898 |
|
12899 } |
|
12900 |
|
12901 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
12902 { |
|
12903 |
|
12904 { |
|
12905 identifier_c param_name("IN2"); |
|
12906 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12907 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12908 |
|
12909 /* Get the value from a foo(<param_value>) style call */ |
|
12910 if (IN2_param_value == NULL) |
|
12911 IN2_param_value = function_call_param_iterator.next(); |
|
12912 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12913 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 ; |
|
12914 |
|
12915 if(search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) |
|
12916 { |
|
12917 |
|
12918 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12919 s4o.print("__time_sub("); |
|
12920 IN1_param_value->accept(*this); |
|
12921 s4o.print(", "); |
|
12922 IN2_param_value->accept(*this); |
|
12923 s4o.print(")"); |
|
12924 return NULL; |
|
12925 |
|
12926 } |
|
12927 |
|
12928 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12929 { |
|
12930 |
|
12931 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
12932 s4o.print("__time_sub("); |
|
12933 IN1_param_value->accept(*this); |
|
12934 s4o.print(", "); |
|
12935 IN2_param_value->accept(*this); |
|
12936 s4o.print(")"); |
|
12937 return NULL; |
|
12938 |
|
12939 } |
|
12940 |
|
12941 ERROR; |
|
12942 } |
|
12943 |
|
12944 } |
|
12945 |
|
12946 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
12947 { |
|
12948 |
|
12949 { |
|
12950 identifier_c param_name("IN2"); |
|
12951 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12952 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12953 |
|
12954 /* Get the value from a foo(<param_value>) style call */ |
|
12955 if (IN2_param_value == NULL) |
|
12956 IN2_param_value = function_call_param_iterator.next(); |
|
12957 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
12958 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 ; |
|
12959 |
|
12960 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
12961 { |
|
12962 |
|
12963 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
12964 s4o.print("__time_sub("); |
|
12965 IN1_param_value->accept(*this); |
|
12966 s4o.print(", "); |
|
12967 IN2_param_value->accept(*this); |
|
12968 s4o.print(")"); |
|
12969 return NULL; |
|
12970 |
|
12971 } |
|
12972 |
|
12973 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12974 { |
|
12975 |
|
12976 symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
12977 s4o.print("__time_sub("); |
|
12978 IN1_param_value->accept(*this); |
|
12979 s4o.print(", "); |
|
12980 IN2_param_value->accept(*this); |
|
12981 s4o.print(")"); |
|
12982 return NULL; |
|
12983 |
|
12984 } |
|
12985 |
|
12986 ERROR; |
|
12987 } |
|
12988 |
|
12989 } |
|
12990 |
|
12991 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
12992 { |
|
12993 |
|
12994 { |
|
12995 identifier_c param_name("IN2"); |
|
12996 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
12997 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
12998 |
|
12999 /* Get the value from a foo(<param_value>) style call */ |
|
13000 if (IN2_param_value == NULL) |
|
13001 IN2_param_value = function_call_param_iterator.next(); |
|
13002 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13003 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 ; |
|
13004 |
|
13005 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
13006 { |
|
13007 |
|
13008 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
13009 s4o.print("__time_sub("); |
|
13010 IN1_param_value->accept(*this); |
|
13011 s4o.print(", "); |
|
13012 IN2_param_value->accept(*this); |
|
13013 s4o.print(")"); |
|
13014 return NULL; |
|
13015 |
|
13016 } |
|
13017 |
|
13018 ERROR; |
|
13019 } |
|
13020 |
|
13021 } |
|
13022 |
|
13023 ERROR; |
|
13024 } |
|
13025 |
|
13026 }/*function_sub*/ |
|
13027 break; |
|
13028 |
|
13029 /**** |
|
13030 *DIV |
|
13031 */ |
|
13032 case function_div : |
|
13033 { |
|
13034 symbol_c *last_type_symbol = NULL; |
|
13035 |
|
13036 { |
|
13037 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13038 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13039 |
|
13040 symbol_c *IN1_type_symbol = param_data_type; |
|
13041 last_type_symbol = param_data_type; |
|
13042 |
|
13043 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
13044 { |
|
13045 |
|
13046 { |
|
13047 identifier_c param_name("IN2"); |
|
13048 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13049 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13050 |
|
13051 /* Get the value from a foo(<param_value>) style call */ |
|
13052 if (IN2_param_value == NULL) |
|
13053 IN2_param_value = function_call_param_iterator.next(); |
|
13054 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13055 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 ; |
|
13056 |
|
13057 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
13058 { |
|
13059 |
|
13060 symbol_c * return_type_symbol = last_type_symbol; |
|
13061 s4o.indent_right(); |
|
13062 s4o.print("(\n" + s4o.indent_spaces); |
|
13063 IN1_param_value->accept(*this); |
|
13064 s4o.print("/\n" + s4o.indent_spaces); |
|
13065 IN2_param_value->accept(*this); |
|
13066 s4o.print(")"); |
|
13067 s4o.indent_left(); |
|
13068 return NULL; |
|
13069 |
|
13070 } |
|
13071 |
|
13072 ERROR; |
|
13073 } |
|
13074 |
|
13075 } |
|
13076 |
|
13077 if(search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) |
|
13078 { |
|
13079 |
|
13080 { |
|
13081 identifier_c param_name("IN2"); |
|
13082 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13083 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13084 |
|
13085 /* Get the value from a foo(<param_value>) style call */ |
|
13086 if (IN2_param_value == NULL) |
|
13087 IN2_param_value = function_call_param_iterator.next(); |
|
13088 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13089 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 ; |
|
13090 |
|
13091 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
13092 { |
|
13093 |
|
13094 symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
13095 s4o.print("__time_div("); |
|
13096 IN1_param_value->accept(*this); |
|
13097 s4o.print(", "); |
|
13098 IN2_param_value->accept(*this); |
|
13099 s4o.print(")"); |
|
13100 return NULL; |
|
13101 |
|
13102 } |
|
13103 |
|
13104 ERROR; |
|
13105 } |
|
13106 |
|
13107 } |
|
13108 |
|
13109 ERROR; |
|
13110 } |
|
13111 |
|
13112 }/*function_div*/ |
|
13113 break; |
|
13114 |
|
13115 /**** |
|
13116 *MOD |
|
13117 */ |
|
13118 case function_mod : |
|
13119 { |
|
13120 symbol_c *last_type_symbol = NULL; |
|
13121 |
|
13122 { |
|
13123 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13124 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13125 |
|
13126 symbol_c *IN1_type_symbol = param_data_type; |
|
13127 last_type_symbol = param_data_type; |
|
13128 |
|
13129 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
13130 { |
|
13131 |
|
13132 { |
|
13133 identifier_c param_name("IN2"); |
|
13134 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13135 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13136 |
|
13137 /* Get the value from a foo(<param_value>) style call */ |
|
13138 if (IN2_param_value == NULL) |
|
13139 IN2_param_value = function_call_param_iterator.next(); |
|
13140 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13141 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 ; |
|
13142 |
|
13143 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
13144 { |
|
13145 |
|
13146 symbol_c * return_type_symbol = last_type_symbol; |
|
13147 s4o.indent_right(); |
|
13148 s4o.print("(\n" + s4o.indent_spaces); |
|
13149 IN1_param_value->accept(*this); |
|
13150 s4o.print("%\n" + s4o.indent_spaces); |
|
13151 IN2_param_value->accept(*this); |
|
13152 s4o.print(")"); |
|
13153 s4o.indent_left(); |
|
13154 return NULL; |
|
13155 |
|
13156 } |
|
13157 |
|
13158 ERROR; |
|
13159 } |
|
13160 |
|
13161 } |
|
13162 |
|
13163 ERROR; |
|
13164 } |
|
13165 |
|
13166 }/*function_mod*/ |
|
13167 break; |
|
13168 |
|
13169 /**** |
|
13170 *EXPT |
|
13171 */ |
|
13172 case function_expt : |
|
13173 { |
|
13174 symbol_c *last_type_symbol = NULL; |
|
13175 |
|
13176 { |
|
13177 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13178 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13179 |
|
13180 symbol_c *IN1_type_symbol = param_data_type; |
|
13181 last_type_symbol = param_data_type; |
|
13182 |
|
13183 if(search_expression_type->is_num_type(IN1_type_symbol)) |
|
13184 { |
|
13185 |
|
13186 { |
|
13187 identifier_c param_name("IN2"); |
|
13188 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13189 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13190 |
|
13191 /* Get the value from a foo(<param_value>) style call */ |
|
13192 if (IN2_param_value == NULL) |
|
13193 IN2_param_value = function_call_param_iterator.next(); |
|
13194 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13195 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 ; |
|
13196 |
|
13197 if(search_expression_type->is_num_type(IN2_type_symbol)) |
|
13198 { |
|
13199 |
|
13200 symbol_c * return_type_symbol = last_type_symbol; |
|
13201 s4o.print("pow("); |
|
13202 IN1_param_value->accept(*this); |
|
13203 s4o.print(", "); |
|
13204 IN2_param_value->accept(*this); |
|
13205 s4o.print(")"); |
|
13206 return NULL; |
|
13207 |
|
13208 } |
|
13209 |
|
13210 ERROR; |
|
13211 } |
|
13212 |
|
13213 } |
|
13214 |
|
13215 ERROR; |
|
13216 } |
|
13217 |
|
13218 }/*function_expt*/ |
|
13219 break; |
|
13220 |
|
13221 /**** |
|
13222 *MOVE |
|
13223 */ |
|
13224 case function_move : |
|
13225 { |
|
13226 symbol_c *last_type_symbol = NULL; |
|
13227 |
|
13228 { |
|
13229 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13230 symbol_c *IN_param_value = &this->default_variable_name; |
|
13231 |
|
13232 symbol_c *IN_type_symbol = param_data_type; |
|
13233 last_type_symbol = param_data_type; |
|
13234 |
|
13235 if(search_expression_type->is_num_type(IN_type_symbol)) |
|
13236 { |
|
13237 |
|
13238 symbol_c * return_type_symbol = last_type_symbol; |
|
13239 IN_param_value->accept(*this); |
|
13240 return NULL; |
|
13241 |
|
13242 } |
|
13243 |
|
13244 ERROR; |
|
13245 } |
|
13246 |
|
13247 }/*function_move*/ |
|
13248 break; |
|
13249 |
|
13250 /**** |
|
13251 *SHL |
|
13252 */ |
|
13253 case function_shl : |
|
13254 { |
|
13255 symbol_c *last_type_symbol = NULL; |
|
13256 |
|
13257 { |
|
13258 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13259 symbol_c *IN_param_value = &this->default_variable_name; |
|
13260 |
|
13261 symbol_c *IN_type_symbol = param_data_type; |
|
13262 last_type_symbol = param_data_type; |
|
13263 |
|
13264 if(search_expression_type->is_binary_type(IN_type_symbol)) |
|
13265 { |
|
13266 |
|
13267 { |
|
13268 identifier_c param_name("N"); |
|
13269 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13270 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
13271 |
|
13272 /* Get the value from a foo(<param_value>) style call */ |
|
13273 if (N_param_value == NULL) |
|
13274 N_param_value = function_call_param_iterator.next(); |
|
13275 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
13276 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 ; |
|
13277 |
|
13278 if(search_expression_type->is_integer_type(N_type_symbol)) |
|
13279 { |
|
13280 |
|
13281 symbol_c * return_type_symbol = IN_type_symbol; |
|
13282 IN_param_value->accept(*this); |
|
13283 s4o.print("<<"); |
|
13284 N_param_value->accept(*this); |
|
13285 return NULL; |
|
13286 |
|
13287 } |
|
13288 |
|
13289 ERROR; |
|
13290 } |
|
13291 |
|
13292 } |
|
13293 |
|
13294 ERROR; |
|
13295 } |
|
13296 |
|
13297 }/*function_shl*/ |
|
13298 break; |
|
13299 |
|
13300 /**** |
|
13301 *SHR |
|
13302 */ |
|
13303 case function_shr : |
|
13304 { |
|
13305 symbol_c *last_type_symbol = NULL; |
|
13306 |
|
13307 { |
|
13308 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13309 symbol_c *IN_param_value = &this->default_variable_name; |
|
13310 |
|
13311 symbol_c *IN_type_symbol = param_data_type; |
|
13312 last_type_symbol = param_data_type; |
|
13313 |
|
13314 if(search_expression_type->is_binary_type(IN_type_symbol)) |
|
13315 { |
|
13316 |
|
13317 { |
|
13318 identifier_c param_name("N"); |
|
13319 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13320 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
13321 |
|
13322 /* Get the value from a foo(<param_value>) style call */ |
|
13323 if (N_param_value == NULL) |
|
13324 N_param_value = function_call_param_iterator.next(); |
|
13325 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
13326 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 ; |
|
13327 |
|
13328 if(search_expression_type->is_integer_type(N_type_symbol)) |
|
13329 { |
|
13330 |
|
13331 symbol_c * return_type_symbol = IN_type_symbol; |
|
13332 IN_param_value->accept(*this); |
|
13333 s4o.print(">>"); |
|
13334 N_param_value->accept(*this); |
|
13335 return NULL; |
|
13336 |
|
13337 } |
|
13338 |
|
13339 ERROR; |
|
13340 } |
|
13341 |
|
13342 } |
|
13343 |
|
13344 ERROR; |
|
13345 } |
|
13346 |
|
13347 }/*function_shr*/ |
|
13348 break; |
|
13349 |
|
13350 /**** |
|
13351 *ROR |
|
13352 */ |
|
13353 case function_ror : |
|
13354 { |
|
13355 symbol_c *last_type_symbol = NULL; |
|
13356 |
|
13357 { |
|
13358 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13359 symbol_c *IN_param_value = &this->default_variable_name; |
|
13360 |
|
13361 symbol_c *IN_type_symbol = param_data_type; |
|
13362 last_type_symbol = param_data_type; |
|
13363 |
|
13364 if(search_expression_type->is_nbinary_type(IN_type_symbol)) |
|
13365 { |
|
13366 |
|
13367 { |
|
13368 identifier_c param_name("N"); |
|
13369 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13370 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
13371 |
|
13372 /* Get the value from a foo(<param_value>) style call */ |
|
13373 if (N_param_value == NULL) |
|
13374 N_param_value = function_call_param_iterator.next(); |
|
13375 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
13376 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 ; |
|
13377 |
|
13378 if(search_expression_type->is_integer_type(N_type_symbol)) |
|
13379 { |
|
13380 |
|
13381 symbol_c * return_type_symbol = IN_type_symbol; |
|
13382 s4o.print("__ror_"); |
|
13383 IN_type_symbol->accept(*this); |
|
13384 s4o.print("("); |
|
13385 IN_param_value->accept(*this); |
|
13386 s4o.print(", "); |
|
13387 N_param_value->accept(*this); |
|
13388 s4o.print(")"); |
|
13389 return NULL; |
|
13390 |
|
13391 } |
|
13392 |
|
13393 ERROR; |
|
13394 } |
|
13395 |
|
13396 } |
|
13397 |
|
13398 ERROR; |
|
13399 } |
|
13400 |
|
13401 }/*function_ror*/ |
|
13402 break; |
|
13403 |
|
13404 /**** |
|
13405 *ROL |
|
13406 */ |
|
13407 case function_rol : |
|
13408 { |
|
13409 symbol_c *last_type_symbol = NULL; |
|
13410 |
|
13411 { |
|
13412 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13413 symbol_c *IN_param_value = &this->default_variable_name; |
|
13414 |
|
13415 symbol_c *IN_type_symbol = param_data_type; |
|
13416 last_type_symbol = param_data_type; |
|
13417 |
|
13418 if(search_expression_type->is_nbinary_type(IN_type_symbol)) |
|
13419 { |
|
13420 |
|
13421 { |
|
13422 identifier_c param_name("N"); |
|
13423 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13424 symbol_c *N_param_value = function_call_param_iterator.search(¶m_name); |
|
13425 |
|
13426 /* Get the value from a foo(<param_value>) style call */ |
|
13427 if (N_param_value == NULL) |
|
13428 N_param_value = function_call_param_iterator.next(); |
|
13429 symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value); |
|
13430 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 ; |
|
13431 |
|
13432 if(search_expression_type->is_integer_type(N_type_symbol)) |
|
13433 { |
|
13434 |
|
13435 symbol_c * return_type_symbol = IN_type_symbol; |
|
13436 s4o.print("__rol_"); |
|
13437 IN_type_symbol->accept(*this); |
|
13438 s4o.print("("); |
|
13439 IN_param_value->accept(*this); |
|
13440 s4o.print(", "); |
|
13441 N_param_value->accept(*this); |
|
13442 s4o.print(")"); |
|
13443 return NULL; |
|
13444 |
|
13445 } |
|
13446 |
|
13447 ERROR; |
|
13448 } |
|
13449 |
|
13450 } |
|
13451 |
|
13452 ERROR; |
|
13453 } |
|
13454 |
|
13455 }/*function_rol*/ |
|
13456 break; |
|
13457 |
|
13458 /**** |
|
13459 *AND |
|
13460 */ |
|
13461 case function_and : |
|
13462 { |
|
13463 symbol_c *last_type_symbol = NULL; |
|
13464 |
|
13465 { |
|
13466 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13467 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13468 |
|
13469 symbol_c *IN1_type_symbol = param_data_type; |
|
13470 last_type_symbol = param_data_type; |
|
13471 |
|
13472 if(search_expression_type->is_binary_type(IN1_type_symbol)) |
|
13473 { |
|
13474 |
|
13475 { |
|
13476 identifier_c param_name("IN2"); |
|
13477 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13478 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13479 |
|
13480 /* Get the value from a foo(<param_value>) style call */ |
|
13481 if (IN2_param_value == NULL) |
|
13482 IN2_param_value = function_call_param_iterator.next(); |
|
13483 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13484 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 ; |
|
13485 |
|
13486 if(search_expression_type->is_binary_type(IN2_type_symbol)) |
|
13487 { |
|
13488 |
|
13489 symbol_c * return_type_symbol = last_type_symbol; |
|
13490 s4o.indent_right(); |
|
13491 s4o.print("("); |
|
13492 if (search_expression_type->is_bool_type(last_type_symbol)) |
|
13493 s4o.print("(\n" + s4o.indent_spaces); |
|
13494 IN1_param_value->accept(*this); |
|
13495 s4o.print("&\n" + s4o.indent_spaces); |
|
13496 IN2_param_value->accept(*this); |
|
13497 |
|
13498 int base_num = 3; |
|
13499 symbol_c *param_value = NULL; |
|
13500 do{ |
|
13501 char my_name[10]; |
|
13502 sprintf(my_name, "IN%d", base_num++); |
|
13503 identifier_c param_name(my_name); |
|
13504 |
|
13505 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13506 param_value = function_call_param_iterator.search(¶m_name); |
|
13507 |
|
13508 /* Get the value from a foo(<param_value>) style call */ |
|
13509 if (param_value == NULL) |
|
13510 param_value = function_call_param_iterator.next(); |
|
13511 if (param_value != NULL){ |
|
13512 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
13513 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
13514 |
|
13515 /*Function specific CODE */ |
|
13516 s4o.print("&\n" + s4o.indent_spaces); |
|
13517 param_value->accept(*this); |
|
13518 |
|
13519 } |
|
13520 |
|
13521 }while(param_value != NULL); |
|
13522 s4o.print(")"); |
|
13523 if (search_expression_type->is_bool_type(last_type_symbol)) { |
|
13524 s4o.print("&1"); |
|
13525 s4o.print(")"); |
|
13526 } |
|
13527 s4o.print(""); |
|
13528 s4o.indent_left(); |
|
13529 return NULL; |
|
13530 |
|
13531 |
|
13532 } |
|
13533 |
|
13534 ERROR; |
|
13535 } |
|
13536 |
|
13537 } |
|
13538 |
|
13539 ERROR; |
|
13540 } |
|
13541 |
|
13542 }/*function_and*/ |
|
13543 break; |
|
13544 |
|
13545 /**** |
|
13546 *OR |
|
13547 */ |
|
13548 case function_or : |
|
13549 { |
|
13550 symbol_c *last_type_symbol = NULL; |
|
13551 |
|
13552 { |
|
13553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13554 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13555 |
|
13556 symbol_c *IN1_type_symbol = param_data_type; |
|
13557 last_type_symbol = param_data_type; |
|
13558 |
|
13559 if(search_expression_type->is_binary_type(IN1_type_symbol)) |
|
13560 { |
|
13561 |
|
13562 { |
|
13563 identifier_c param_name("IN2"); |
|
13564 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13565 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13566 |
|
13567 /* Get the value from a foo(<param_value>) style call */ |
|
13568 if (IN2_param_value == NULL) |
|
13569 IN2_param_value = function_call_param_iterator.next(); |
|
13570 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13571 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 ; |
|
13572 |
|
13573 if(search_expression_type->is_binary_type(IN2_type_symbol)) |
|
13574 { |
|
13575 |
|
13576 symbol_c * return_type_symbol = last_type_symbol; |
|
13577 s4o.indent_right(); |
|
13578 s4o.print("("); |
|
13579 if (search_expression_type->is_bool_type(last_type_symbol)) |
|
13580 s4o.print("(\n" + s4o.indent_spaces); |
|
13581 IN1_param_value->accept(*this); |
|
13582 s4o.print("|\n" + s4o.indent_spaces); |
|
13583 IN2_param_value->accept(*this); |
|
13584 |
|
13585 int base_num = 3; |
|
13586 symbol_c *param_value = NULL; |
|
13587 do{ |
|
13588 char my_name[10]; |
|
13589 sprintf(my_name, "IN%d", base_num++); |
|
13590 identifier_c param_name(my_name); |
|
13591 |
|
13592 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13593 param_value = function_call_param_iterator.search(¶m_name); |
|
13594 |
|
13595 /* Get the value from a foo(<param_value>) style call */ |
|
13596 if (param_value == NULL) |
|
13597 param_value = function_call_param_iterator.next(); |
|
13598 if (param_value != NULL){ |
|
13599 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
13600 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
13601 |
|
13602 /*Function specific CODE */ |
|
13603 s4o.print("|\n" + s4o.indent_spaces); |
|
13604 param_value->accept(*this); |
|
13605 |
|
13606 } |
|
13607 |
|
13608 }while(param_value != NULL); |
|
13609 s4o.print(")"); |
|
13610 if (search_expression_type->is_bool_type(last_type_symbol)) { |
|
13611 s4o.print("&1"); |
|
13612 s4o.print(")"); |
|
13613 } |
|
13614 s4o.print(""); |
|
13615 s4o.indent_left(); |
|
13616 return NULL; |
|
13617 |
|
13618 |
|
13619 } |
|
13620 |
|
13621 ERROR; |
|
13622 } |
|
13623 |
|
13624 } |
|
13625 |
|
13626 ERROR; |
|
13627 } |
|
13628 |
|
13629 }/*function_or*/ |
|
13630 break; |
|
13631 |
|
13632 /**** |
|
13633 *XOR |
|
13634 */ |
|
13635 case function_xor : |
|
13636 { |
|
13637 symbol_c *last_type_symbol = NULL; |
|
13638 |
|
13639 { |
|
13640 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13641 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13642 |
|
13643 symbol_c *IN1_type_symbol = param_data_type; |
|
13644 last_type_symbol = param_data_type; |
|
13645 |
|
13646 if(search_expression_type->is_binary_type(IN1_type_symbol)) |
|
13647 { |
|
13648 |
|
13649 { |
|
13650 identifier_c param_name("IN2"); |
|
13651 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13652 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13653 |
|
13654 /* Get the value from a foo(<param_value>) style call */ |
|
13655 if (IN2_param_value == NULL) |
|
13656 IN2_param_value = function_call_param_iterator.next(); |
|
13657 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13658 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 ; |
|
13659 |
|
13660 if(search_expression_type->is_binary_type(IN2_type_symbol)) |
|
13661 { |
|
13662 |
|
13663 symbol_c * return_type_symbol = last_type_symbol; |
|
13664 s4o.indent_right(); |
|
13665 s4o.print("("); |
|
13666 if (search_expression_type->is_bool_type(last_type_symbol)) |
|
13667 s4o.print("(\n" + s4o.indent_spaces); |
|
13668 IN1_param_value->accept(*this); |
|
13669 s4o.print("^\n" + s4o.indent_spaces); |
|
13670 IN2_param_value->accept(*this); |
|
13671 |
|
13672 int base_num = 3; |
|
13673 symbol_c *param_value = NULL; |
|
13674 do{ |
|
13675 char my_name[10]; |
|
13676 sprintf(my_name, "IN%d", base_num++); |
|
13677 identifier_c param_name(my_name); |
|
13678 |
|
13679 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13680 param_value = function_call_param_iterator.search(¶m_name); |
|
13681 |
|
13682 /* Get the value from a foo(<param_value>) style call */ |
|
13683 if (param_value == NULL) |
|
13684 param_value = function_call_param_iterator.next(); |
|
13685 if (param_value != NULL){ |
|
13686 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
13687 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
13688 |
|
13689 /*Function specific CODE */ |
|
13690 s4o.print("^\n" + s4o.indent_spaces); |
|
13691 param_value->accept(*this); |
|
13692 |
|
13693 } |
|
13694 |
|
13695 }while(param_value != NULL); |
|
13696 s4o.print(")"); |
|
13697 if (search_expression_type->is_bool_type(last_type_symbol)) { |
|
13698 s4o.print("&1"); |
|
13699 s4o.print(")"); |
|
13700 } |
|
13701 s4o.print(""); |
|
13702 s4o.indent_left(); |
|
13703 return NULL; |
|
13704 |
|
13705 |
|
13706 } |
|
13707 |
|
13708 ERROR; |
|
13709 } |
|
13710 |
|
13711 } |
|
13712 |
|
13713 ERROR; |
|
13714 } |
|
13715 |
|
13716 }/*function_xor*/ |
|
13717 break; |
|
13718 |
|
13719 /**** |
|
13720 *NOT |
|
13721 */ |
|
13722 case function_not : |
|
13723 { |
|
13724 symbol_c *last_type_symbol = NULL; |
|
13725 |
|
13726 { |
|
13727 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13728 symbol_c *IN_param_value = &this->default_variable_name; |
|
13729 |
|
13730 symbol_c *IN_type_symbol = param_data_type; |
|
13731 last_type_symbol = param_data_type; |
|
13732 |
|
13733 if(search_expression_type->is_binary_type(IN_type_symbol)) |
|
13734 { |
|
13735 |
|
13736 symbol_c * return_type_symbol = IN_type_symbol; |
|
13737 s4o.print("~"); |
|
13738 IN_param_value->accept(*this); |
|
13739 return NULL; |
|
13740 |
|
13741 } |
|
13742 |
|
13743 ERROR; |
|
13744 } |
|
13745 |
|
13746 }/*function_not*/ |
|
13747 break; |
|
13748 |
|
13749 /**** |
|
13750 *SEL |
|
13751 */ |
|
13752 case function_sel : |
|
13753 { |
|
13754 symbol_c *last_type_symbol = NULL; |
|
13755 |
|
13756 { |
|
13757 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13758 symbol_c *G_param_value = &this->default_variable_name; |
|
13759 |
|
13760 symbol_c *G_type_symbol = param_data_type; |
|
13761 last_type_symbol = param_data_type; |
|
13762 |
|
13763 if(search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) |
|
13764 { |
|
13765 |
|
13766 { |
|
13767 identifier_c param_name("IN0"); |
|
13768 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13769 symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); |
|
13770 |
|
13771 /* Get the value from a foo(<param_value>) style call */ |
|
13772 if (IN0_param_value == NULL) |
|
13773 IN0_param_value = function_call_param_iterator.next(); |
|
13774 symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); |
|
13775 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 ; |
|
13776 |
|
13777 |
|
13778 { |
|
13779 |
|
13780 { |
|
13781 identifier_c param_name("IN1"); |
|
13782 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13783 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
13784 |
|
13785 /* Get the value from a foo(<param_value>) style call */ |
|
13786 if (IN1_param_value == NULL) |
|
13787 IN1_param_value = function_call_param_iterator.next(); |
|
13788 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
13789 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 ; |
|
13790 |
|
13791 |
|
13792 { |
|
13793 |
|
13794 symbol_c * return_type_symbol = last_type_symbol; |
|
13795 G_param_value->accept(*this); |
|
13796 s4o.print(" ? "); |
|
13797 IN1_param_value->accept(*this); |
|
13798 s4o.print(" : "); |
|
13799 IN0_param_value->accept(*this); |
|
13800 return NULL; |
|
13801 |
|
13802 } |
|
13803 |
|
13804 ERROR; |
|
13805 } |
|
13806 |
|
13807 } |
|
13808 |
|
13809 ERROR; |
|
13810 } |
|
13811 |
|
13812 } |
|
13813 |
|
13814 ERROR; |
|
13815 } |
|
13816 |
|
13817 }/*function_sel*/ |
|
13818 break; |
|
13819 |
|
13820 /**** |
|
13821 *MAX |
|
13822 */ |
|
13823 case function_max : |
|
13824 { |
|
13825 symbol_c *last_type_symbol = NULL; |
|
13826 |
|
13827 { |
|
13828 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13829 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13830 |
|
13831 symbol_c *IN1_type_symbol = param_data_type; |
|
13832 last_type_symbol = param_data_type; |
|
13833 |
|
13834 |
|
13835 { |
|
13836 |
|
13837 { |
|
13838 identifier_c param_name("IN2"); |
|
13839 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13840 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13841 |
|
13842 /* Get the value from a foo(<param_value>) style call */ |
|
13843 if (IN2_param_value == NULL) |
|
13844 IN2_param_value = function_call_param_iterator.next(); |
|
13845 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13846 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 ; |
|
13847 |
|
13848 |
|
13849 { |
|
13850 |
|
13851 symbol_c * return_type_symbol = last_type_symbol; |
|
13852 s4o.indent_right(); |
|
13853 s4o.print("__max_"); |
|
13854 return_type_symbol->accept(*this); |
|
13855 s4o.print("("); |
|
13856 s4o.print_integer(nb_param); |
|
13857 s4o.print(",\n" + s4o.indent_spaces); |
|
13858 IN1_param_value->accept(*this); |
|
13859 s4o.print(",\n" + s4o.indent_spaces); |
|
13860 IN2_param_value->accept(*this); |
|
13861 |
|
13862 int base_num = 3; |
|
13863 symbol_c *param_value = NULL; |
|
13864 do{ |
|
13865 char my_name[10]; |
|
13866 sprintf(my_name, "IN%d", base_num++); |
|
13867 identifier_c param_name(my_name); |
|
13868 |
|
13869 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13870 param_value = function_call_param_iterator.search(¶m_name); |
|
13871 |
|
13872 /* Get the value from a foo(<param_value>) style call */ |
|
13873 if (param_value == NULL) |
|
13874 param_value = function_call_param_iterator.next(); |
|
13875 if (param_value != NULL){ |
|
13876 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
13877 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
13878 |
|
13879 /*Function specific CODE */ |
|
13880 s4o.print(",\n" + s4o.indent_spaces); |
|
13881 param_value->accept(*this); |
|
13882 |
|
13883 } |
|
13884 |
|
13885 }while(param_value != NULL); |
|
13886 s4o.print(")"); |
|
13887 s4o.indent_left(); |
|
13888 return NULL; |
|
13889 |
|
13890 |
|
13891 } |
|
13892 |
|
13893 ERROR; |
|
13894 } |
|
13895 |
|
13896 } |
|
13897 |
|
13898 ERROR; |
|
13899 } |
|
13900 |
|
13901 }/*function_max*/ |
|
13902 break; |
|
13903 |
|
13904 /**** |
|
13905 *MIN |
|
13906 */ |
|
13907 case function_min : |
|
13908 { |
|
13909 symbol_c *last_type_symbol = NULL; |
|
13910 |
|
13911 { |
|
13912 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13913 symbol_c *IN1_param_value = &this->default_variable_name; |
|
13914 |
|
13915 symbol_c *IN1_type_symbol = param_data_type; |
|
13916 last_type_symbol = param_data_type; |
|
13917 |
|
13918 |
|
13919 { |
|
13920 |
|
13921 { |
|
13922 identifier_c param_name("IN2"); |
|
13923 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13924 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
13925 |
|
13926 /* Get the value from a foo(<param_value>) style call */ |
|
13927 if (IN2_param_value == NULL) |
|
13928 IN2_param_value = function_call_param_iterator.next(); |
|
13929 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
13930 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 ; |
|
13931 |
|
13932 |
|
13933 { |
|
13934 |
|
13935 symbol_c * return_type_symbol = last_type_symbol; |
|
13936 s4o.indent_right(); |
|
13937 s4o.print("__min_"); |
|
13938 return_type_symbol->accept(*this); |
|
13939 s4o.print("("); |
|
13940 s4o.print_integer(nb_param); |
|
13941 s4o.print(",\n" + s4o.indent_spaces); |
|
13942 IN1_param_value->accept(*this); |
|
13943 s4o.print(",\n" + s4o.indent_spaces); |
|
13944 IN2_param_value->accept(*this); |
|
13945 |
|
13946 int base_num = 3; |
|
13947 symbol_c *param_value = NULL; |
|
13948 do{ |
|
13949 char my_name[10]; |
|
13950 sprintf(my_name, "IN%d", base_num++); |
|
13951 identifier_c param_name(my_name); |
|
13952 |
|
13953 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13954 param_value = function_call_param_iterator.search(¶m_name); |
|
13955 |
|
13956 /* Get the value from a foo(<param_value>) style call */ |
|
13957 if (param_value == NULL) |
|
13958 param_value = function_call_param_iterator.next(); |
|
13959 if (param_value != NULL){ |
|
13960 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
13961 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
13962 |
|
13963 /*Function specific CODE */ |
|
13964 s4o.print(",\n" + s4o.indent_spaces); |
|
13965 param_value->accept(*this); |
|
13966 |
|
13967 } |
|
13968 |
|
13969 }while(param_value != NULL); |
|
13970 s4o.print(")"); |
|
13971 s4o.indent_left(); |
|
13972 return NULL; |
|
13973 |
|
13974 |
|
13975 } |
|
13976 |
|
13977 ERROR; |
|
13978 } |
|
13979 |
|
13980 } |
|
13981 |
|
13982 ERROR; |
|
13983 } |
|
13984 |
|
13985 }/*function_min*/ |
|
13986 break; |
|
13987 |
|
13988 /**** |
|
13989 *LIMIT |
|
13990 */ |
|
13991 case function_limit : |
|
13992 { |
|
13993 symbol_c *last_type_symbol = NULL; |
|
13994 |
|
13995 { |
|
13996 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
13997 symbol_c *MN_param_value = &this->default_variable_name; |
|
13998 |
|
13999 symbol_c *MN_type_symbol = param_data_type; |
|
14000 last_type_symbol = param_data_type; |
|
14001 |
|
14002 |
|
14003 { |
|
14004 |
|
14005 { |
|
14006 identifier_c param_name("IN"); |
|
14007 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14008 symbol_c *IN_param_value = function_call_param_iterator.search(¶m_name); |
|
14009 |
|
14010 /* Get the value from a foo(<param_value>) style call */ |
|
14011 if (IN_param_value == NULL) |
|
14012 IN_param_value = function_call_param_iterator.next(); |
|
14013 symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
14014 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
14015 |
|
14016 |
|
14017 { |
|
14018 |
|
14019 { |
|
14020 identifier_c param_name("MX"); |
|
14021 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14022 symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name); |
|
14023 |
|
14024 /* Get the value from a foo(<param_value>) style call */ |
|
14025 if (MX_param_value == NULL) |
|
14026 MX_param_value = function_call_param_iterator.next(); |
|
14027 symbol_c *MX_type_symbol = search_expression_type->get_type(MX_param_value); |
|
14028 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 ; |
|
14029 |
|
14030 |
|
14031 { |
|
14032 |
|
14033 symbol_c * return_type_symbol = IN_type_symbol; |
|
14034 s4o.print("__limit_"); |
|
14035 IN_type_symbol->accept(*this); |
|
14036 s4o.print("("); |
|
14037 MN_param_value->accept(*this); |
|
14038 s4o.print(", "); |
|
14039 IN_param_value->accept(*this); |
|
14040 s4o.print(", "); |
|
14041 MX_param_value->accept(*this); |
|
14042 s4o.print(")"); |
|
14043 return NULL; |
|
14044 |
|
14045 } |
|
14046 |
|
14047 ERROR; |
|
14048 } |
|
14049 |
|
14050 } |
|
14051 |
|
14052 ERROR; |
|
14053 } |
|
14054 |
|
14055 } |
|
14056 |
|
14057 ERROR; |
|
14058 } |
|
14059 |
|
14060 }/*function_limit*/ |
|
14061 break; |
|
14062 |
|
14063 /**** |
|
14064 *MUX |
|
14065 */ |
|
14066 case function_mux : |
|
14067 { |
|
14068 symbol_c *last_type_symbol = NULL; |
|
14069 |
|
14070 { |
|
14071 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14072 symbol_c *K_param_value = &this->default_variable_name; |
|
14073 |
|
14074 symbol_c *K_type_symbol = param_data_type; |
|
14075 last_type_symbol = param_data_type; |
|
14076 |
|
14077 if(search_expression_type->is_integer_type(K_type_symbol)) |
|
14078 { |
|
14079 |
|
14080 { |
|
14081 identifier_c param_name("IN0"); |
|
14082 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14083 symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name); |
|
14084 |
|
14085 /* Get the value from a foo(<param_value>) style call */ |
|
14086 if (IN0_param_value == NULL) |
|
14087 IN0_param_value = function_call_param_iterator.next(); |
|
14088 symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value); |
|
14089 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 ; |
|
14090 |
|
14091 |
|
14092 { |
|
14093 |
|
14094 { |
|
14095 identifier_c param_name("IN1"); |
|
14096 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14097 symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name); |
|
14098 |
|
14099 /* Get the value from a foo(<param_value>) style call */ |
|
14100 if (IN1_param_value == NULL) |
|
14101 IN1_param_value = function_call_param_iterator.next(); |
|
14102 symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value); |
|
14103 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 ; |
|
14104 |
|
14105 |
|
14106 { |
|
14107 |
|
14108 symbol_c * return_type_symbol = last_type_symbol; |
|
14109 s4o.indent_right(); |
|
14110 s4o.print("__mux_"); |
|
14111 return_type_symbol->accept(*this); |
|
14112 s4o.print("("); |
|
14113 s4o.print_integer(nb_param); |
|
14114 s4o.print(",\n" + s4o.indent_spaces); |
|
14115 K_param_value->accept(*this); |
|
14116 s4o.print(",\n" + s4o.indent_spaces); |
|
14117 IN0_param_value->accept(*this); |
|
14118 s4o.print(",\n" + s4o.indent_spaces); |
|
14119 IN1_param_value->accept(*this); |
|
14120 |
|
14121 int base_num = 2; |
|
14122 symbol_c *param_value = NULL; |
|
14123 do{ |
|
14124 char my_name[10]; |
|
14125 sprintf(my_name, "IN%d", base_num++); |
|
14126 identifier_c param_name(my_name); |
|
14127 |
|
14128 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14129 param_value = function_call_param_iterator.search(¶m_name); |
|
14130 |
|
14131 /* Get the value from a foo(<param_value>) style call */ |
|
14132 if (param_value == NULL) |
|
14133 param_value = function_call_param_iterator.next(); |
|
14134 if (param_value != NULL){ |
|
14135 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14136 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14137 |
|
14138 /*Function specific CODE */ |
|
14139 s4o.print(",\n" + s4o.indent_spaces); |
|
14140 param_value->accept(*this); |
|
14141 |
|
14142 } |
|
14143 |
|
14144 }while(param_value != NULL); |
|
14145 s4o.print(")"); |
|
14146 s4o.indent_left(); |
|
14147 return NULL; |
|
14148 |
|
14149 |
|
14150 } |
|
14151 |
|
14152 ERROR; |
|
14153 } |
|
14154 |
|
14155 } |
|
14156 |
|
14157 ERROR; |
|
14158 } |
|
14159 |
|
14160 } |
|
14161 |
|
14162 ERROR; |
|
14163 } |
|
14164 |
|
14165 }/*function_mux*/ |
|
14166 break; |
|
14167 |
|
14168 /**** |
|
14169 *GT |
|
14170 */ |
|
14171 case function_gt : |
|
14172 { |
|
14173 symbol_c *last_type_symbol = NULL; |
|
14174 |
|
14175 { |
|
14176 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14177 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14178 |
|
14179 symbol_c *IN1_type_symbol = param_data_type; |
|
14180 last_type_symbol = param_data_type; |
|
14181 |
|
14182 |
|
14183 { |
|
14184 |
|
14185 { |
|
14186 identifier_c param_name("IN2"); |
|
14187 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14188 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14189 |
|
14190 /* Get the value from a foo(<param_value>) style call */ |
|
14191 if (IN2_param_value == NULL) |
|
14192 IN2_param_value = function_call_param_iterator.next(); |
|
14193 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14194 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 ; |
|
14195 |
|
14196 |
|
14197 { |
|
14198 |
|
14199 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14200 s4o.indent_right(); |
|
14201 s4o.print("__gt_"); |
|
14202 last_type_symbol->accept(*this); |
|
14203 s4o.print("("); |
|
14204 s4o.print_integer(nb_param); |
|
14205 s4o.print(",\n" + s4o.indent_spaces); |
|
14206 IN1_param_value->accept(*this); |
|
14207 s4o.print(",\n" + s4o.indent_spaces); |
|
14208 IN2_param_value->accept(*this); |
|
14209 |
|
14210 int base_num = 3; |
|
14211 symbol_c *param_value = NULL; |
|
14212 do{ |
|
14213 char my_name[10]; |
|
14214 sprintf(my_name, "IN%d", base_num++); |
|
14215 identifier_c param_name(my_name); |
|
14216 |
|
14217 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14218 param_value = function_call_param_iterator.search(¶m_name); |
|
14219 |
|
14220 /* Get the value from a foo(<param_value>) style call */ |
|
14221 if (param_value == NULL) |
|
14222 param_value = function_call_param_iterator.next(); |
|
14223 if (param_value != NULL){ |
|
14224 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14225 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14226 |
|
14227 /*Function specific CODE */ |
|
14228 s4o.print(",\n" + s4o.indent_spaces); |
|
14229 param_value->accept(*this); |
|
14230 |
|
14231 } |
|
14232 |
|
14233 }while(param_value != NULL); |
|
14234 s4o.print(")"); |
|
14235 s4o.indent_left(); |
|
14236 return NULL; |
|
14237 |
|
14238 |
|
14239 } |
|
14240 |
|
14241 ERROR; |
|
14242 } |
|
14243 |
|
14244 } |
|
14245 |
|
14246 ERROR; |
|
14247 } |
|
14248 |
|
14249 }/*function_gt*/ |
|
14250 break; |
|
14251 |
|
14252 /**** |
|
14253 *GE |
|
14254 */ |
|
14255 case function_ge : |
|
14256 { |
|
14257 symbol_c *last_type_symbol = NULL; |
|
14258 |
|
14259 { |
|
14260 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14261 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14262 |
|
14263 symbol_c *IN1_type_symbol = param_data_type; |
|
14264 last_type_symbol = param_data_type; |
|
14265 |
|
14266 |
|
14267 { |
|
14268 |
|
14269 { |
|
14270 identifier_c param_name("IN2"); |
|
14271 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14272 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14273 |
|
14274 /* Get the value from a foo(<param_value>) style call */ |
|
14275 if (IN2_param_value == NULL) |
|
14276 IN2_param_value = function_call_param_iterator.next(); |
|
14277 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14278 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 ; |
|
14279 |
|
14280 |
|
14281 { |
|
14282 |
|
14283 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14284 s4o.indent_right(); |
|
14285 s4o.print("__ge_"); |
|
14286 last_type_symbol->accept(*this); |
|
14287 s4o.print("("); |
|
14288 s4o.print_integer(nb_param); |
|
14289 s4o.print(",\n" + s4o.indent_spaces); |
|
14290 IN1_param_value->accept(*this); |
|
14291 s4o.print(",\n" + s4o.indent_spaces); |
|
14292 IN2_param_value->accept(*this); |
|
14293 |
|
14294 int base_num = 3; |
|
14295 symbol_c *param_value = NULL; |
|
14296 do{ |
|
14297 char my_name[10]; |
|
14298 sprintf(my_name, "IN%d", base_num++); |
|
14299 identifier_c param_name(my_name); |
|
14300 |
|
14301 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14302 param_value = function_call_param_iterator.search(¶m_name); |
|
14303 |
|
14304 /* Get the value from a foo(<param_value>) style call */ |
|
14305 if (param_value == NULL) |
|
14306 param_value = function_call_param_iterator.next(); |
|
14307 if (param_value != NULL){ |
|
14308 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14309 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14310 |
|
14311 /*Function specific CODE */ |
|
14312 s4o.print(",\n" + s4o.indent_spaces); |
|
14313 param_value->accept(*this); |
|
14314 |
|
14315 } |
|
14316 |
|
14317 }while(param_value != NULL); |
|
14318 s4o.print(")"); |
|
14319 s4o.indent_left(); |
|
14320 return NULL; |
|
14321 |
|
14322 |
|
14323 } |
|
14324 |
|
14325 ERROR; |
|
14326 } |
|
14327 |
|
14328 } |
|
14329 |
|
14330 ERROR; |
|
14331 } |
|
14332 |
|
14333 }/*function_ge*/ |
|
14334 break; |
|
14335 |
|
14336 /**** |
|
14337 *EQ |
|
14338 */ |
|
14339 case function_eq : |
|
14340 { |
|
14341 symbol_c *last_type_symbol = NULL; |
|
14342 |
|
14343 { |
|
14344 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14345 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14346 |
|
14347 symbol_c *IN1_type_symbol = param_data_type; |
|
14348 last_type_symbol = param_data_type; |
|
14349 |
|
14350 |
|
14351 { |
|
14352 |
|
14353 { |
|
14354 identifier_c param_name("IN2"); |
|
14355 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14356 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14357 |
|
14358 /* Get the value from a foo(<param_value>) style call */ |
|
14359 if (IN2_param_value == NULL) |
|
14360 IN2_param_value = function_call_param_iterator.next(); |
|
14361 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14362 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 ; |
|
14363 |
|
14364 |
|
14365 { |
|
14366 |
|
14367 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14368 s4o.indent_right(); |
|
14369 s4o.print("__eq_"); |
|
14370 last_type_symbol->accept(*this); |
|
14371 s4o.print("("); |
|
14372 s4o.print_integer(nb_param); |
|
14373 s4o.print(",\n" + s4o.indent_spaces); |
|
14374 IN1_param_value->accept(*this); |
|
14375 s4o.print(",\n" + s4o.indent_spaces); |
|
14376 IN2_param_value->accept(*this); |
|
14377 |
|
14378 int base_num = 3; |
|
14379 symbol_c *param_value = NULL; |
|
14380 do{ |
|
14381 char my_name[10]; |
|
14382 sprintf(my_name, "IN%d", base_num++); |
|
14383 identifier_c param_name(my_name); |
|
14384 |
|
14385 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14386 param_value = function_call_param_iterator.search(¶m_name); |
|
14387 |
|
14388 /* Get the value from a foo(<param_value>) style call */ |
|
14389 if (param_value == NULL) |
|
14390 param_value = function_call_param_iterator.next(); |
|
14391 if (param_value != NULL){ |
|
14392 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14393 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14394 |
|
14395 /*Function specific CODE */ |
|
14396 s4o.print(",\n" + s4o.indent_spaces); |
|
14397 param_value->accept(*this); |
|
14398 |
|
14399 } |
|
14400 |
|
14401 }while(param_value != NULL); |
|
14402 s4o.print(")"); |
|
14403 s4o.indent_left(); |
|
14404 return NULL; |
|
14405 |
|
14406 |
|
14407 } |
|
14408 |
|
14409 ERROR; |
|
14410 } |
|
14411 |
|
14412 } |
|
14413 |
|
14414 ERROR; |
|
14415 } |
|
14416 |
|
14417 }/*function_eq*/ |
|
14418 break; |
|
14419 |
|
14420 /**** |
|
14421 *LT |
|
14422 */ |
|
14423 case function_lt : |
|
14424 { |
|
14425 symbol_c *last_type_symbol = NULL; |
|
14426 |
|
14427 { |
|
14428 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14429 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14430 |
|
14431 symbol_c *IN1_type_symbol = param_data_type; |
|
14432 last_type_symbol = param_data_type; |
|
14433 |
|
14434 |
|
14435 { |
|
14436 |
|
14437 { |
|
14438 identifier_c param_name("IN2"); |
|
14439 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14440 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14441 |
|
14442 /* Get the value from a foo(<param_value>) style call */ |
|
14443 if (IN2_param_value == NULL) |
|
14444 IN2_param_value = function_call_param_iterator.next(); |
|
14445 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14446 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 ; |
|
14447 |
|
14448 |
|
14449 { |
|
14450 |
|
14451 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14452 s4o.indent_right(); |
|
14453 s4o.print("__lt_"); |
|
14454 last_type_symbol->accept(*this); |
|
14455 s4o.print("("); |
|
14456 s4o.print_integer(nb_param); |
|
14457 s4o.print(",\n" + s4o.indent_spaces); |
|
14458 IN1_param_value->accept(*this); |
|
14459 s4o.print(",\n" + s4o.indent_spaces); |
|
14460 IN2_param_value->accept(*this); |
|
14461 |
|
14462 int base_num = 3; |
|
14463 symbol_c *param_value = NULL; |
|
14464 do{ |
|
14465 char my_name[10]; |
|
14466 sprintf(my_name, "IN%d", base_num++); |
|
14467 identifier_c param_name(my_name); |
|
14468 |
|
14469 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14470 param_value = function_call_param_iterator.search(¶m_name); |
|
14471 |
|
14472 /* Get the value from a foo(<param_value>) style call */ |
|
14473 if (param_value == NULL) |
|
14474 param_value = function_call_param_iterator.next(); |
|
14475 if (param_value != NULL){ |
|
14476 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14477 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14478 |
|
14479 /*Function specific CODE */ |
|
14480 s4o.print(",\n" + s4o.indent_spaces); |
|
14481 param_value->accept(*this); |
|
14482 |
|
14483 } |
|
14484 |
|
14485 }while(param_value != NULL); |
|
14486 s4o.print(")"); |
|
14487 s4o.indent_left(); |
|
14488 return NULL; |
|
14489 |
|
14490 |
|
14491 } |
|
14492 |
|
14493 ERROR; |
|
14494 } |
|
14495 |
|
14496 } |
|
14497 |
|
14498 ERROR; |
|
14499 } |
|
14500 |
|
14501 }/*function_lt*/ |
|
14502 break; |
|
14503 |
|
14504 /**** |
|
14505 *LE |
|
14506 */ |
|
14507 case function_le : |
|
14508 { |
|
14509 symbol_c *last_type_symbol = NULL; |
|
14510 |
|
14511 { |
|
14512 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14513 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14514 |
|
14515 symbol_c *IN1_type_symbol = param_data_type; |
|
14516 last_type_symbol = param_data_type; |
|
14517 |
|
14518 |
|
14519 { |
|
14520 |
|
14521 { |
|
14522 identifier_c param_name("IN2"); |
|
14523 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14524 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14525 |
|
14526 /* Get the value from a foo(<param_value>) style call */ |
|
14527 if (IN2_param_value == NULL) |
|
14528 IN2_param_value = function_call_param_iterator.next(); |
|
14529 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14530 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 ; |
|
14531 |
|
14532 |
|
14533 { |
|
14534 |
|
14535 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14536 s4o.indent_right(); |
|
14537 s4o.print("__le_"); |
|
14538 last_type_symbol->accept(*this); |
|
14539 s4o.print("("); |
|
14540 s4o.print_integer(nb_param); |
|
14541 s4o.print(",\n" + s4o.indent_spaces); |
|
14542 IN1_param_value->accept(*this); |
|
14543 s4o.print(",\n" + s4o.indent_spaces); |
|
14544 IN2_param_value->accept(*this); |
|
14545 |
|
14546 int base_num = 3; |
|
14547 symbol_c *param_value = NULL; |
|
14548 do{ |
|
14549 char my_name[10]; |
|
14550 sprintf(my_name, "IN%d", base_num++); |
|
14551 identifier_c param_name(my_name); |
|
14552 |
|
14553 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14554 param_value = function_call_param_iterator.search(¶m_name); |
|
14555 |
|
14556 /* Get the value from a foo(<param_value>) style call */ |
|
14557 if (param_value == NULL) |
|
14558 param_value = function_call_param_iterator.next(); |
|
14559 if (param_value != NULL){ |
|
14560 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14561 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14562 |
|
14563 /*Function specific CODE */ |
|
14564 s4o.print(",\n" + s4o.indent_spaces); |
|
14565 param_value->accept(*this); |
|
14566 |
|
14567 } |
|
14568 |
|
14569 }while(param_value != NULL); |
|
14570 s4o.print(")"); |
|
14571 s4o.indent_left(); |
|
14572 return NULL; |
|
14573 |
|
14574 |
|
14575 } |
|
14576 |
|
14577 ERROR; |
|
14578 } |
|
14579 |
|
14580 } |
|
14581 |
|
14582 ERROR; |
|
14583 } |
|
14584 |
|
14585 }/*function_le*/ |
|
14586 break; |
|
14587 |
|
14588 /**** |
|
14589 *NE |
|
14590 */ |
|
14591 case function_ne : |
|
14592 { |
|
14593 symbol_c *last_type_symbol = NULL; |
|
14594 |
|
14595 { |
|
14596 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14597 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14598 |
|
14599 symbol_c *IN1_type_symbol = param_data_type; |
|
14600 last_type_symbol = param_data_type; |
|
14601 |
|
14602 |
|
14603 { |
|
14604 |
|
14605 { |
|
14606 identifier_c param_name("IN2"); |
|
14607 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14608 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14609 |
|
14610 /* Get the value from a foo(<param_value>) style call */ |
|
14611 if (IN2_param_value == NULL) |
|
14612 IN2_param_value = function_call_param_iterator.next(); |
|
14613 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14614 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 ; |
|
14615 |
|
14616 |
|
14617 { |
|
14618 |
|
14619 symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
14620 s4o.indent_right(); |
|
14621 s4o.print("__ne_"); |
|
14622 last_type_symbol->accept(*this); |
|
14623 s4o.print("("); |
|
14624 s4o.print_integer(nb_param); |
|
14625 s4o.print(",\n" + s4o.indent_spaces); |
|
14626 IN1_param_value->accept(*this); |
|
14627 s4o.print(",\n" + s4o.indent_spaces); |
|
14628 IN2_param_value->accept(*this); |
|
14629 |
|
14630 int base_num = 3; |
|
14631 symbol_c *param_value = NULL; |
|
14632 do{ |
|
14633 char my_name[10]; |
|
14634 sprintf(my_name, "IN%d", base_num++); |
|
14635 identifier_c param_name(my_name); |
|
14636 |
|
14637 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14638 param_value = function_call_param_iterator.search(¶m_name); |
|
14639 |
|
14640 /* Get the value from a foo(<param_value>) style call */ |
|
14641 if (param_value == NULL) |
|
14642 param_value = function_call_param_iterator.next(); |
|
14643 if (param_value != NULL){ |
|
14644 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14645 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14646 |
|
14647 /*Function specific CODE */ |
|
14648 s4o.print(",\n" + s4o.indent_spaces); |
|
14649 param_value->accept(*this); |
|
14650 |
|
14651 } |
|
14652 |
|
14653 }while(param_value != NULL); |
|
14654 s4o.print(")"); |
|
14655 s4o.indent_left(); |
|
14656 return NULL; |
|
14657 |
|
14658 |
|
14659 } |
|
14660 |
|
14661 ERROR; |
|
14662 } |
|
14663 |
|
14664 } |
|
14665 |
|
14666 ERROR; |
|
14667 } |
|
14668 |
|
14669 }/*function_ne*/ |
|
14670 break; |
|
14671 |
|
14672 /**** |
|
14673 *LEN |
|
14674 */ |
|
14675 case function_len : |
|
14676 { |
|
14677 symbol_c *last_type_symbol = NULL; |
|
14678 |
|
14679 { |
|
14680 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14681 symbol_c *IN_param_value = &this->default_variable_name; |
|
14682 |
|
14683 symbol_c *IN_type_symbol = param_data_type; |
|
14684 last_type_symbol = param_data_type; |
|
14685 |
|
14686 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14687 { |
|
14688 |
|
14689 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
14690 s4o.print("__len("); |
|
14691 IN_param_value->accept(*this); |
|
14692 s4o.print(")"); |
|
14693 return NULL; |
|
14694 |
|
14695 } |
|
14696 |
|
14697 ERROR; |
|
14698 } |
|
14699 |
|
14700 }/*function_len*/ |
|
14701 break; |
|
14702 |
|
14703 /**** |
|
14704 *LEFT |
|
14705 */ |
|
14706 case function_left : |
|
14707 { |
|
14708 symbol_c *last_type_symbol = NULL; |
|
14709 |
|
14710 { |
|
14711 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14712 symbol_c *IN_param_value = &this->default_variable_name; |
|
14713 |
|
14714 symbol_c *IN_type_symbol = param_data_type; |
|
14715 last_type_symbol = param_data_type; |
|
14716 |
|
14717 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14718 { |
|
14719 |
|
14720 { |
|
14721 identifier_c param_name("L"); |
|
14722 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14723 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
14724 |
|
14725 /* Get the value from a foo(<param_value>) style call */ |
|
14726 if (L_param_value == NULL) |
|
14727 L_param_value = function_call_param_iterator.next(); |
|
14728 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
14729 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 ; |
|
14730 |
|
14731 if(search_expression_type->is_integer_type(L_type_symbol)) |
|
14732 { |
|
14733 |
|
14734 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
14735 s4o.print("__left("); |
|
14736 IN_param_value->accept(*this); |
|
14737 s4o.print(", "); |
|
14738 L_param_value->accept(*this); |
|
14739 s4o.print(")"); |
|
14740 return NULL; |
|
14741 |
|
14742 } |
|
14743 |
|
14744 ERROR; |
|
14745 } |
|
14746 |
|
14747 } |
|
14748 |
|
14749 ERROR; |
|
14750 } |
|
14751 |
|
14752 }/*function_left*/ |
|
14753 break; |
|
14754 |
|
14755 /**** |
|
14756 *RIGHT |
|
14757 */ |
|
14758 case function_right : |
|
14759 { |
|
14760 symbol_c *last_type_symbol = NULL; |
|
14761 |
|
14762 { |
|
14763 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14764 symbol_c *IN_param_value = &this->default_variable_name; |
|
14765 |
|
14766 symbol_c *IN_type_symbol = param_data_type; |
|
14767 last_type_symbol = param_data_type; |
|
14768 |
|
14769 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14770 { |
|
14771 |
|
14772 { |
|
14773 identifier_c param_name("L"); |
|
14774 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14775 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
14776 |
|
14777 /* Get the value from a foo(<param_value>) style call */ |
|
14778 if (L_param_value == NULL) |
|
14779 L_param_value = function_call_param_iterator.next(); |
|
14780 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
14781 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 ; |
|
14782 |
|
14783 if(search_expression_type->is_integer_type(L_type_symbol)) |
|
14784 { |
|
14785 |
|
14786 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
14787 s4o.print("__right("); |
|
14788 IN_param_value->accept(*this); |
|
14789 s4o.print(", "); |
|
14790 L_param_value->accept(*this); |
|
14791 s4o.print(")"); |
|
14792 return NULL; |
|
14793 |
|
14794 } |
|
14795 |
|
14796 ERROR; |
|
14797 } |
|
14798 |
|
14799 } |
|
14800 |
|
14801 ERROR; |
|
14802 } |
|
14803 |
|
14804 }/*function_right*/ |
|
14805 break; |
|
14806 |
|
14807 /**** |
|
14808 *MID |
|
14809 */ |
|
14810 case function_mid : |
|
14811 { |
|
14812 symbol_c *last_type_symbol = NULL; |
|
14813 |
|
14814 { |
|
14815 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14816 symbol_c *IN_param_value = &this->default_variable_name; |
|
14817 |
|
14818 symbol_c *IN_type_symbol = param_data_type; |
|
14819 last_type_symbol = param_data_type; |
|
14820 |
|
14821 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14822 { |
|
14823 |
|
14824 { |
|
14825 identifier_c param_name("L"); |
|
14826 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14827 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
14828 |
|
14829 /* Get the value from a foo(<param_value>) style call */ |
|
14830 if (L_param_value == NULL) |
|
14831 L_param_value = function_call_param_iterator.next(); |
|
14832 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
14833 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 ; |
|
14834 |
|
14835 if(search_expression_type->is_integer_type(L_type_symbol)) |
|
14836 { |
|
14837 |
|
14838 { |
|
14839 identifier_c param_name("P"); |
|
14840 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14841 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
14842 |
|
14843 /* Get the value from a foo(<param_value>) style call */ |
|
14844 if (P_param_value == NULL) |
|
14845 P_param_value = function_call_param_iterator.next(); |
|
14846 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
14847 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 ; |
|
14848 |
|
14849 if(search_expression_type->is_integer_type(P_type_symbol)) |
|
14850 { |
|
14851 |
|
14852 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
14853 s4o.print("__mid("); |
|
14854 IN_param_value->accept(*this); |
|
14855 s4o.print(", "); |
|
14856 L_param_value->accept(*this); |
|
14857 s4o.print(", "); |
|
14858 P_param_value->accept(*this); |
|
14859 s4o.print(")"); |
|
14860 return NULL; |
|
14861 |
|
14862 } |
|
14863 |
|
14864 ERROR; |
|
14865 } |
|
14866 |
|
14867 } |
|
14868 |
|
14869 ERROR; |
|
14870 } |
|
14871 |
|
14872 } |
|
14873 |
|
14874 ERROR; |
|
14875 } |
|
14876 |
|
14877 }/*function_mid*/ |
|
14878 break; |
|
14879 |
|
14880 /**** |
|
14881 *CONCAT |
|
14882 */ |
|
14883 case function_concat : |
|
14884 { |
|
14885 symbol_c *last_type_symbol = NULL; |
|
14886 |
|
14887 { |
|
14888 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14889 symbol_c *IN1_param_value = &this->default_variable_name; |
|
14890 |
|
14891 symbol_c *IN1_type_symbol = param_data_type; |
|
14892 last_type_symbol = param_data_type; |
|
14893 |
|
14894 if(search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) |
|
14895 { |
|
14896 |
|
14897 { |
|
14898 identifier_c param_name("IN2"); |
|
14899 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14900 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14901 |
|
14902 /* Get the value from a foo(<param_value>) style call */ |
|
14903 if (IN2_param_value == NULL) |
|
14904 IN2_param_value = function_call_param_iterator.next(); |
|
14905 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14906 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 ; |
|
14907 |
|
14908 if(search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) |
|
14909 { |
|
14910 |
|
14911 symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
14912 s4o.print("__time_add("); |
|
14913 IN1_param_value->accept(*this); |
|
14914 s4o.print(", "); |
|
14915 IN2_param_value->accept(*this); |
|
14916 s4o.print(")"); |
|
14917 return NULL; |
|
14918 |
|
14919 } |
|
14920 |
|
14921 ERROR; |
|
14922 } |
|
14923 |
|
14924 } |
|
14925 |
|
14926 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14927 { |
|
14928 |
|
14929 { |
|
14930 identifier_c param_name("IN2"); |
|
14931 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14932 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
14933 |
|
14934 /* Get the value from a foo(<param_value>) style call */ |
|
14935 if (IN2_param_value == NULL) |
|
14936 IN2_param_value = function_call_param_iterator.next(); |
|
14937 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
14938 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 ; |
|
14939 |
|
14940 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
14941 { |
|
14942 |
|
14943 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
14944 s4o.indent_right(); |
|
14945 s4o.print("__concat("); |
|
14946 s4o.print_integer(nb_param); |
|
14947 s4o.print(",\n" + s4o.indent_spaces); |
|
14948 IN1_param_value->accept(*this); |
|
14949 s4o.print(",\n" + s4o.indent_spaces); |
|
14950 IN2_param_value->accept(*this); |
|
14951 |
|
14952 int base_num = 3; |
|
14953 symbol_c *param_value = NULL; |
|
14954 do{ |
|
14955 char my_name[10]; |
|
14956 sprintf(my_name, "IN%d", base_num++); |
|
14957 identifier_c param_name(my_name); |
|
14958 |
|
14959 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
14960 param_value = function_call_param_iterator.search(¶m_name); |
|
14961 |
|
14962 /* Get the value from a foo(<param_value>) style call */ |
|
14963 if (param_value == NULL) |
|
14964 param_value = function_call_param_iterator.next(); |
|
14965 if (param_value != NULL){ |
|
14966 symbol_c *current_type_symbol = search_expression_type->get_type(param_value); |
|
14967 last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; |
|
14968 |
|
14969 /*Function specific CODE */ |
|
14970 s4o.print(",\n" + s4o.indent_spaces); |
|
14971 param_value->accept(*this); |
|
14972 |
|
14973 } |
|
14974 |
|
14975 }while(param_value != NULL); |
|
14976 s4o.print(")"); |
|
14977 s4o.indent_left(); |
|
14978 return NULL; |
|
14979 |
|
14980 |
|
14981 } |
|
14982 |
|
14983 ERROR; |
|
14984 } |
|
14985 |
|
14986 } |
|
14987 |
|
14988 ERROR; |
|
14989 } |
|
14990 |
|
14991 }/*function_concat*/ |
|
14992 break; |
|
14993 |
|
14994 /**** |
|
14995 *INSERT |
|
14996 */ |
|
14997 case function_insert : |
|
14998 { |
|
14999 symbol_c *last_type_symbol = NULL; |
|
15000 |
|
15001 { |
|
15002 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15003 symbol_c *IN1_param_value = &this->default_variable_name; |
|
15004 |
|
15005 symbol_c *IN1_type_symbol = param_data_type; |
|
15006 last_type_symbol = param_data_type; |
|
15007 |
|
15008 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15009 { |
|
15010 |
|
15011 { |
|
15012 identifier_c param_name("IN2"); |
|
15013 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15014 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15015 |
|
15016 /* Get the value from a foo(<param_value>) style call */ |
|
15017 if (IN2_param_value == NULL) |
|
15018 IN2_param_value = function_call_param_iterator.next(); |
|
15019 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15020 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 ; |
|
15021 |
|
15022 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15023 { |
|
15024 |
|
15025 { |
|
15026 identifier_c param_name("P"); |
|
15027 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15028 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
15029 |
|
15030 /* Get the value from a foo(<param_value>) style call */ |
|
15031 if (P_param_value == NULL) |
|
15032 P_param_value = function_call_param_iterator.next(); |
|
15033 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
15034 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 ; |
|
15035 |
|
15036 if(search_expression_type->is_integer_type(P_type_symbol)) |
|
15037 { |
|
15038 |
|
15039 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
15040 s4o.print("__insert("); |
|
15041 IN1_param_value->accept(*this); |
|
15042 s4o.print(", "); |
|
15043 IN2_param_value->accept(*this); |
|
15044 s4o.print(", "); |
|
15045 P_param_value->accept(*this); |
|
15046 s4o.print(")"); |
|
15047 return NULL; |
|
15048 |
|
15049 } |
|
15050 |
|
15051 ERROR; |
|
15052 } |
|
15053 |
|
15054 } |
|
15055 |
|
15056 ERROR; |
|
15057 } |
|
15058 |
|
15059 } |
|
15060 |
|
15061 ERROR; |
|
15062 } |
|
15063 |
|
15064 }/*function_insert*/ |
|
15065 break; |
|
15066 |
|
15067 /**** |
|
15068 *DELETE |
|
15069 */ |
|
15070 case function_delete : |
|
15071 { |
|
15072 symbol_c *last_type_symbol = NULL; |
|
15073 |
|
15074 { |
|
15075 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15076 symbol_c *IN_param_value = &this->default_variable_name; |
|
15077 |
|
15078 symbol_c *IN_type_symbol = param_data_type; |
|
15079 last_type_symbol = param_data_type; |
|
15080 |
|
15081 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15082 { |
|
15083 |
|
15084 { |
|
15085 identifier_c param_name("L"); |
|
15086 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15087 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
15088 |
|
15089 /* Get the value from a foo(<param_value>) style call */ |
|
15090 if (L_param_value == NULL) |
|
15091 L_param_value = function_call_param_iterator.next(); |
|
15092 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
15093 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 ; |
|
15094 |
|
15095 if(search_expression_type->is_integer_type(L_type_symbol)) |
|
15096 { |
|
15097 |
|
15098 { |
|
15099 identifier_c param_name("P"); |
|
15100 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15101 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
15102 |
|
15103 /* Get the value from a foo(<param_value>) style call */ |
|
15104 if (P_param_value == NULL) |
|
15105 P_param_value = function_call_param_iterator.next(); |
|
15106 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
15107 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 ; |
|
15108 |
|
15109 if(search_expression_type->is_integer_type(P_type_symbol)) |
|
15110 { |
|
15111 |
|
15112 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
15113 s4o.print("__delete("); |
|
15114 IN_param_value->accept(*this); |
|
15115 s4o.print(", "); |
|
15116 L_param_value->accept(*this); |
|
15117 s4o.print(", "); |
|
15118 P_param_value->accept(*this); |
|
15119 s4o.print(")"); |
|
15120 return NULL; |
|
15121 |
|
15122 } |
|
15123 |
|
15124 ERROR; |
|
15125 } |
|
15126 |
|
15127 } |
|
15128 |
|
15129 ERROR; |
|
15130 } |
|
15131 |
|
15132 } |
|
15133 |
|
15134 ERROR; |
|
15135 } |
|
15136 |
|
15137 }/*function_delete*/ |
|
15138 break; |
|
15139 |
|
15140 /**** |
|
15141 *REPLACE |
|
15142 */ |
|
15143 case function_replace : |
|
15144 { |
|
15145 symbol_c *last_type_symbol = NULL; |
|
15146 |
|
15147 { |
|
15148 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15149 symbol_c *IN1_param_value = &this->default_variable_name; |
|
15150 |
|
15151 symbol_c *IN1_type_symbol = param_data_type; |
|
15152 last_type_symbol = param_data_type; |
|
15153 |
|
15154 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15155 { |
|
15156 |
|
15157 { |
|
15158 identifier_c param_name("IN2"); |
|
15159 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15160 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15161 |
|
15162 /* Get the value from a foo(<param_value>) style call */ |
|
15163 if (IN2_param_value == NULL) |
|
15164 IN2_param_value = function_call_param_iterator.next(); |
|
15165 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15166 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 ; |
|
15167 |
|
15168 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15169 { |
|
15170 |
|
15171 { |
|
15172 identifier_c param_name("L"); |
|
15173 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15174 symbol_c *L_param_value = function_call_param_iterator.search(¶m_name); |
|
15175 |
|
15176 /* Get the value from a foo(<param_value>) style call */ |
|
15177 if (L_param_value == NULL) |
|
15178 L_param_value = function_call_param_iterator.next(); |
|
15179 symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value); |
|
15180 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 ; |
|
15181 |
|
15182 if(search_expression_type->is_integer_type(L_type_symbol)) |
|
15183 { |
|
15184 |
|
15185 { |
|
15186 identifier_c param_name("P"); |
|
15187 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15188 symbol_c *P_param_value = function_call_param_iterator.search(¶m_name); |
|
15189 |
|
15190 /* Get the value from a foo(<param_value>) style call */ |
|
15191 if (P_param_value == NULL) |
|
15192 P_param_value = function_call_param_iterator.next(); |
|
15193 symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value); |
|
15194 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 ; |
|
15195 |
|
15196 if(search_expression_type->is_integer_type(P_type_symbol)) |
|
15197 { |
|
15198 |
|
15199 symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
15200 s4o.print("__replace("); |
|
15201 IN1_param_value->accept(*this); |
|
15202 s4o.print(", "); |
|
15203 IN2_param_value->accept(*this); |
|
15204 s4o.print(", "); |
|
15205 L_param_value->accept(*this); |
|
15206 s4o.print(", "); |
|
15207 P_param_value->accept(*this); |
|
15208 s4o.print(")"); |
|
15209 return NULL; |
|
15210 |
|
15211 } |
|
15212 |
|
15213 ERROR; |
|
15214 } |
|
15215 |
|
15216 } |
|
15217 |
|
15218 ERROR; |
|
15219 } |
|
15220 |
|
15221 } |
|
15222 |
|
15223 ERROR; |
|
15224 } |
|
15225 |
|
15226 } |
|
15227 |
|
15228 ERROR; |
|
15229 } |
|
15230 |
|
15231 }/*function_replace*/ |
|
15232 break; |
|
15233 |
|
15234 /**** |
|
15235 *FIND |
|
15236 */ |
|
15237 case function_find : |
|
15238 { |
|
15239 symbol_c *last_type_symbol = NULL; |
|
15240 |
|
15241 { |
|
15242 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15243 symbol_c *IN1_param_value = &this->default_variable_name; |
|
15244 |
|
15245 symbol_c *IN1_type_symbol = param_data_type; |
|
15246 last_type_symbol = param_data_type; |
|
15247 |
|
15248 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15249 { |
|
15250 |
|
15251 { |
|
15252 identifier_c param_name("IN2"); |
|
15253 /* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
15254 symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name); |
|
15255 |
|
15256 /* Get the value from a foo(<param_value>) style call */ |
|
15257 if (IN2_param_value == NULL) |
|
15258 IN2_param_value = function_call_param_iterator.next(); |
|
15259 symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value); |
|
15260 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 ; |
|
15261 |
|
15262 if(search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) |
|
15263 { |
|
15264 |
|
15265 symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
15266 s4o.print("__find("); |
|
15267 IN1_param_value->accept(*this); |
|
15268 s4o.print(", "); |
|
15269 IN2_param_value->accept(*this); |
|
15270 s4o.print(")"); |
|
15271 return NULL; |
|
15272 |
|
15273 } |
|
15274 |
|
15275 ERROR; |
|
15276 } |
|
15277 |
|
15278 } |
|
15279 |
|
15280 ERROR; |
|
15281 } |
|
15282 |
|
15283 }/*function_find*/ |
|
15284 break; |
|
15285 |
|
15286 case function_none : |
|
15287 ERROR; |
|
15288 } |
|
15289 return NULL; |