author | laurent |
Wed, 02 Sep 2009 18:23:40 +0200 | |
changeset 208 | c72748a12ae3 |
parent 181 | 38d6eb056260 |
child 210 | 8387cac2aba6 |
permissions | -rw-r--r-- |
181 | 1 |
/* |
2 |
* (c) 2008 Edouard TISSERANT |
|
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 |
* IEC 61131-3 standard function library |
|
27 |
* generated code, do not edit by hand |
|
28 |
*/ |
|
29 |
||
30 |
||
31 |
||
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
32 |
void *search_expression_type_c::compute_standard_function_default(function_invocation_c *st_symbol = NULL, il_formal_funct_call_c *il_symbol = NULL) { |
181 | 33 |
function_type_t current_function_type; |
34 |
function_call_param_iterator_c *tmp_function_call_param_iterator; |
|
35 |
if (st_symbol != NULL && il_symbol == NULL) { |
|
36 |
current_function_type = get_function_type((identifier_c *)st_symbol->function_name); |
|
37 |
tmp_function_call_param_iterator = new function_call_param_iterator_c(st_symbol); |
|
38 |
} |
|
39 |
else if (st_symbol == NULL && il_symbol != NULL) { |
|
40 |
current_function_type = get_function_type((identifier_c *)il_symbol->function_name); |
|
41 |
tmp_function_call_param_iterator = new function_call_param_iterator_c(il_symbol); |
|
42 |
} |
|
43 |
else |
|
44 |
ERROR; |
|
45 |
function_call_param_iterator_c function_call_param_iterator(*tmp_function_call_param_iterator); |
|
46 |
search_expression_type_c* search_expression_type = this; |
|
47 |
||
48 |
switch(current_function_type){ |
|
49 |
||
50 |
/**** |
|
51 |
*REAL_TO_SINT |
|
52 |
*/ |
|
53 |
case function_real_to_sint : |
|
54 |
{ |
|
55 |
symbol_c *last_type_symbol = NULL; |
|
56 |
||
57 |
{ |
|
58 |
identifier_c param_name("IN"); |
|
59 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
60 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
61 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
62 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
63 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
64 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
65 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 66 |
if (IN_param_value != NULL) { |
67 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
68 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
69 |
} |
|
70 |
||
71 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
72 |
{ |
|
73 |
||
74 |
symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
75 |
return return_type_symbol; |
|
76 |
||
77 |
} |
|
78 |
||
79 |
||
80 |
ERROR; |
|
81 |
} |
|
82 |
||
83 |
}/*function_real_to_sint*/ |
|
84 |
break; |
|
85 |
||
86 |
/**** |
|
87 |
*REAL_TO_LINT |
|
88 |
*/ |
|
89 |
case function_real_to_lint : |
|
90 |
{ |
|
91 |
symbol_c *last_type_symbol = NULL; |
|
92 |
||
93 |
{ |
|
94 |
identifier_c param_name("IN"); |
|
95 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
96 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
97 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
98 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
99 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
100 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
101 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 102 |
if (IN_param_value != NULL) { |
103 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
104 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
105 |
} |
|
106 |
||
107 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
108 |
{ |
|
109 |
||
110 |
symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
111 |
return return_type_symbol; |
|
112 |
||
113 |
} |
|
114 |
||
115 |
||
116 |
ERROR; |
|
117 |
} |
|
118 |
||
119 |
}/*function_real_to_lint*/ |
|
120 |
break; |
|
121 |
||
122 |
/**** |
|
123 |
*REAL_TO_DINT |
|
124 |
*/ |
|
125 |
case function_real_to_dint : |
|
126 |
{ |
|
127 |
symbol_c *last_type_symbol = NULL; |
|
128 |
||
129 |
{ |
|
130 |
identifier_c param_name("IN"); |
|
131 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
132 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
133 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
134 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
135 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
136 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
137 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 138 |
if (IN_param_value != NULL) { |
139 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
140 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
141 |
} |
|
142 |
||
143 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
144 |
{ |
|
145 |
||
146 |
symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
147 |
return return_type_symbol; |
|
148 |
||
149 |
} |
|
150 |
||
151 |
||
152 |
ERROR; |
|
153 |
} |
|
154 |
||
155 |
}/*function_real_to_dint*/ |
|
156 |
break; |
|
157 |
||
158 |
/**** |
|
159 |
*REAL_TO_DATE |
|
160 |
*/ |
|
161 |
case function_real_to_date : |
|
162 |
{ |
|
163 |
symbol_c *last_type_symbol = NULL; |
|
164 |
||
165 |
{ |
|
166 |
identifier_c param_name("IN"); |
|
167 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
168 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
169 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
170 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
171 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
172 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
173 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 174 |
if (IN_param_value != NULL) { |
175 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
176 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
177 |
} |
|
178 |
||
179 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
180 |
{ |
|
181 |
||
182 |
symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
183 |
return return_type_symbol; |
|
184 |
||
185 |
} |
|
186 |
||
187 |
||
188 |
ERROR; |
|
189 |
} |
|
190 |
||
191 |
}/*function_real_to_date*/ |
|
192 |
break; |
|
193 |
||
194 |
/**** |
|
195 |
*REAL_TO_DWORD |
|
196 |
*/ |
|
197 |
case function_real_to_dword : |
|
198 |
{ |
|
199 |
symbol_c *last_type_symbol = NULL; |
|
200 |
||
201 |
{ |
|
202 |
identifier_c param_name("IN"); |
|
203 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
204 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
205 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
206 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
207 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
208 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
209 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 210 |
if (IN_param_value != NULL) { |
211 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
212 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
213 |
} |
|
214 |
||
215 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
216 |
{ |
|
217 |
||
218 |
symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
219 |
return return_type_symbol; |
|
220 |
||
221 |
} |
|
222 |
||
223 |
||
224 |
ERROR; |
|
225 |
} |
|
226 |
||
227 |
}/*function_real_to_dword*/ |
|
228 |
break; |
|
229 |
||
230 |
/**** |
|
231 |
*REAL_TO_DT |
|
232 |
*/ |
|
233 |
case function_real_to_dt : |
|
234 |
{ |
|
235 |
symbol_c *last_type_symbol = NULL; |
|
236 |
||
237 |
{ |
|
238 |
identifier_c param_name("IN"); |
|
239 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
240 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
241 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
242 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
243 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
244 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
245 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 246 |
if (IN_param_value != NULL) { |
247 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
248 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
249 |
} |
|
250 |
||
251 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
252 |
{ |
|
253 |
||
254 |
symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
255 |
return return_type_symbol; |
|
256 |
||
257 |
} |
|
258 |
||
259 |
||
260 |
ERROR; |
|
261 |
} |
|
262 |
||
263 |
}/*function_real_to_dt*/ |
|
264 |
break; |
|
265 |
||
266 |
/**** |
|
267 |
*REAL_TO_TOD |
|
268 |
*/ |
|
269 |
case function_real_to_tod : |
|
270 |
{ |
|
271 |
symbol_c *last_type_symbol = NULL; |
|
272 |
||
273 |
{ |
|
274 |
identifier_c param_name("IN"); |
|
275 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
276 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
277 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
278 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
279 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
280 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
281 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 282 |
if (IN_param_value != NULL) { |
283 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
284 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
285 |
} |
|
286 |
||
287 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
288 |
{ |
|
289 |
||
290 |
symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
291 |
return return_type_symbol; |
|
292 |
||
293 |
} |
|
294 |
||
295 |
||
296 |
ERROR; |
|
297 |
} |
|
298 |
||
299 |
}/*function_real_to_tod*/ |
|
300 |
break; |
|
301 |
||
302 |
/**** |
|
303 |
*REAL_TO_UDINT |
|
304 |
*/ |
|
305 |
case function_real_to_udint : |
|
306 |
{ |
|
307 |
symbol_c *last_type_symbol = NULL; |
|
308 |
||
309 |
{ |
|
310 |
identifier_c param_name("IN"); |
|
311 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
312 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
313 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
314 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
315 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
316 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
317 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 318 |
if (IN_param_value != NULL) { |
319 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
320 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
321 |
} |
|
322 |
||
323 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
324 |
{ |
|
325 |
||
326 |
symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
327 |
return return_type_symbol; |
|
328 |
||
329 |
} |
|
330 |
||
331 |
||
332 |
ERROR; |
|
333 |
} |
|
334 |
||
335 |
}/*function_real_to_udint*/ |
|
336 |
break; |
|
337 |
||
338 |
/**** |
|
339 |
*REAL_TO_WORD |
|
340 |
*/ |
|
341 |
case function_real_to_word : |
|
342 |
{ |
|
343 |
symbol_c *last_type_symbol = NULL; |
|
344 |
||
345 |
{ |
|
346 |
identifier_c param_name("IN"); |
|
347 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
348 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
349 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
350 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
351 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
352 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
353 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 354 |
if (IN_param_value != NULL) { |
355 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
356 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
357 |
} |
|
358 |
||
359 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
360 |
{ |
|
361 |
||
362 |
symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
363 |
return return_type_symbol; |
|
364 |
||
365 |
} |
|
366 |
||
367 |
||
368 |
ERROR; |
|
369 |
} |
|
370 |
||
371 |
}/*function_real_to_word*/ |
|
372 |
break; |
|
373 |
||
374 |
/**** |
|
375 |
*REAL_TO_STRING |
|
376 |
*/ |
|
377 |
case function_real_to_string : |
|
378 |
{ |
|
379 |
symbol_c *last_type_symbol = NULL; |
|
380 |
||
381 |
{ |
|
382 |
identifier_c param_name("IN"); |
|
383 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
384 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
385 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
386 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
387 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
388 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
389 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 390 |
if (IN_param_value != NULL) { |
391 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
392 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
393 |
} |
|
394 |
||
395 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
396 |
{ |
|
397 |
||
398 |
symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
399 |
return return_type_symbol; |
|
400 |
||
401 |
} |
|
402 |
||
403 |
||
404 |
ERROR; |
|
405 |
} |
|
406 |
||
407 |
}/*function_real_to_string*/ |
|
408 |
break; |
|
409 |
||
410 |
/**** |
|
411 |
*REAL_TO_LWORD |
|
412 |
*/ |
|
413 |
case function_real_to_lword : |
|
414 |
{ |
|
415 |
symbol_c *last_type_symbol = NULL; |
|
416 |
||
417 |
{ |
|
418 |
identifier_c param_name("IN"); |
|
419 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
420 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
421 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
422 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
423 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
424 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
425 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 426 |
if (IN_param_value != NULL) { |
427 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
428 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
429 |
} |
|
430 |
||
431 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
432 |
{ |
|
433 |
||
434 |
symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
435 |
return return_type_symbol; |
|
436 |
||
437 |
} |
|
438 |
||
439 |
||
440 |
ERROR; |
|
441 |
} |
|
442 |
||
443 |
}/*function_real_to_lword*/ |
|
444 |
break; |
|
445 |
||
446 |
/**** |
|
447 |
*REAL_TO_UINT |
|
448 |
*/ |
|
449 |
case function_real_to_uint : |
|
450 |
{ |
|
451 |
symbol_c *last_type_symbol = NULL; |
|
452 |
||
453 |
{ |
|
454 |
identifier_c param_name("IN"); |
|
455 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
456 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
457 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
458 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
459 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
460 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
461 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 462 |
if (IN_param_value != NULL) { |
463 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
464 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
465 |
} |
|
466 |
||
467 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
468 |
{ |
|
469 |
||
470 |
symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
471 |
return return_type_symbol; |
|
472 |
||
473 |
} |
|
474 |
||
475 |
||
476 |
ERROR; |
|
477 |
} |
|
478 |
||
479 |
}/*function_real_to_uint*/ |
|
480 |
break; |
|
481 |
||
482 |
/**** |
|
483 |
*REAL_TO_LREAL |
|
484 |
*/ |
|
485 |
case function_real_to_lreal : |
|
486 |
{ |
|
487 |
symbol_c *last_type_symbol = NULL; |
|
488 |
||
489 |
{ |
|
490 |
identifier_c param_name("IN"); |
|
491 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
492 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
493 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
494 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
495 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
496 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
497 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 498 |
if (IN_param_value != NULL) { |
499 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
500 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
501 |
} |
|
502 |
||
503 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
504 |
{ |
|
505 |
||
506 |
symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
507 |
return return_type_symbol; |
|
508 |
||
509 |
} |
|
510 |
||
511 |
||
512 |
ERROR; |
|
513 |
} |
|
514 |
||
515 |
}/*function_real_to_lreal*/ |
|
516 |
break; |
|
517 |
||
518 |
/**** |
|
519 |
*REAL_TO_BYTE |
|
520 |
*/ |
|
521 |
case function_real_to_byte : |
|
522 |
{ |
|
523 |
symbol_c *last_type_symbol = NULL; |
|
524 |
||
525 |
{ |
|
526 |
identifier_c param_name("IN"); |
|
527 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
528 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
529 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
530 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
531 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
532 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
533 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 534 |
if (IN_param_value != NULL) { |
535 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
536 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
537 |
} |
|
538 |
||
539 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
540 |
{ |
|
541 |
||
542 |
symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
543 |
return return_type_symbol; |
|
544 |
||
545 |
} |
|
546 |
||
547 |
||
548 |
ERROR; |
|
549 |
} |
|
550 |
||
551 |
}/*function_real_to_byte*/ |
|
552 |
break; |
|
553 |
||
554 |
/**** |
|
555 |
*REAL_TO_USINT |
|
556 |
*/ |
|
557 |
case function_real_to_usint : |
|
558 |
{ |
|
559 |
symbol_c *last_type_symbol = NULL; |
|
560 |
||
561 |
{ |
|
562 |
identifier_c param_name("IN"); |
|
563 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
564 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
565 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
566 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
567 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
568 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
569 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 570 |
if (IN_param_value != NULL) { |
571 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
572 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
573 |
} |
|
574 |
||
575 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
576 |
{ |
|
577 |
||
578 |
symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
579 |
return return_type_symbol; |
|
580 |
||
581 |
} |
|
582 |
||
583 |
||
584 |
ERROR; |
|
585 |
} |
|
586 |
||
587 |
}/*function_real_to_usint*/ |
|
588 |
break; |
|
589 |
||
590 |
/**** |
|
591 |
*REAL_TO_ULINT |
|
592 |
*/ |
|
593 |
case function_real_to_ulint : |
|
594 |
{ |
|
595 |
symbol_c *last_type_symbol = NULL; |
|
596 |
||
597 |
{ |
|
598 |
identifier_c param_name("IN"); |
|
599 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
600 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
601 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
602 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
603 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
604 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
605 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 606 |
if (IN_param_value != NULL) { |
607 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
608 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
609 |
} |
|
610 |
||
611 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
612 |
{ |
|
613 |
||
614 |
symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
615 |
return return_type_symbol; |
|
616 |
||
617 |
} |
|
618 |
||
619 |
||
620 |
ERROR; |
|
621 |
} |
|
622 |
||
623 |
}/*function_real_to_ulint*/ |
|
624 |
break; |
|
625 |
||
626 |
/**** |
|
627 |
*REAL_TO_BOOL |
|
628 |
*/ |
|
629 |
case function_real_to_bool : |
|
630 |
{ |
|
631 |
symbol_c *last_type_symbol = NULL; |
|
632 |
||
633 |
{ |
|
634 |
identifier_c param_name("IN"); |
|
635 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
636 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
637 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
638 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
639 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
640 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
641 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 642 |
if (IN_param_value != NULL) { |
643 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
644 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
645 |
} |
|
646 |
||
647 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
648 |
{ |
|
649 |
||
650 |
symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
651 |
return return_type_symbol; |
|
652 |
||
653 |
} |
|
654 |
||
655 |
||
656 |
ERROR; |
|
657 |
} |
|
658 |
||
659 |
}/*function_real_to_bool*/ |
|
660 |
break; |
|
661 |
||
662 |
/**** |
|
663 |
*REAL_TO_TIME |
|
664 |
*/ |
|
665 |
case function_real_to_time : |
|
666 |
{ |
|
667 |
symbol_c *last_type_symbol = NULL; |
|
668 |
||
669 |
{ |
|
670 |
identifier_c param_name("IN"); |
|
671 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
672 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
673 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
674 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
675 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
676 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
677 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 678 |
if (IN_param_value != NULL) { |
679 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
680 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
681 |
} |
|
682 |
||
683 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
684 |
{ |
|
685 |
||
686 |
symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
687 |
return return_type_symbol; |
|
688 |
||
689 |
} |
|
690 |
||
691 |
||
692 |
ERROR; |
|
693 |
} |
|
694 |
||
695 |
}/*function_real_to_time*/ |
|
696 |
break; |
|
697 |
||
698 |
/**** |
|
699 |
*REAL_TO_INT |
|
700 |
*/ |
|
701 |
case function_real_to_int : |
|
702 |
{ |
|
703 |
symbol_c *last_type_symbol = NULL; |
|
704 |
||
705 |
{ |
|
706 |
identifier_c param_name("IN"); |
|
707 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
708 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
709 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
710 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
711 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
712 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
713 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 714 |
if (IN_param_value != NULL) { |
715 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
716 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
717 |
} |
|
718 |
||
719 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) |
|
720 |
{ |
|
721 |
||
722 |
symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
723 |
return return_type_symbol; |
|
724 |
||
725 |
} |
|
726 |
||
727 |
||
728 |
ERROR; |
|
729 |
} |
|
730 |
||
731 |
}/*function_real_to_int*/ |
|
732 |
break; |
|
733 |
||
734 |
/**** |
|
735 |
*SINT_TO_REAL |
|
736 |
*/ |
|
737 |
case function_sint_to_real : |
|
738 |
{ |
|
739 |
symbol_c *last_type_symbol = NULL; |
|
740 |
||
741 |
{ |
|
742 |
identifier_c param_name("IN"); |
|
743 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
744 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
745 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
746 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
747 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
748 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
749 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 750 |
if (IN_param_value != NULL) { |
751 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
752 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
753 |
} |
|
754 |
||
755 |
if(IN_type_symbol == NULL || 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::real_type_name; |
|
759 |
return return_type_symbol; |
|
760 |
||
761 |
} |
|
762 |
||
763 |
||
764 |
ERROR; |
|
765 |
} |
|
766 |
||
767 |
}/*function_sint_to_real*/ |
|
768 |
break; |
|
769 |
||
770 |
/**** |
|
771 |
*SINT_TO_LINT |
|
772 |
*/ |
|
773 |
case function_sint_to_lint : |
|
774 |
{ |
|
775 |
symbol_c *last_type_symbol = NULL; |
|
776 |
||
777 |
{ |
|
778 |
identifier_c param_name("IN"); |
|
779 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
780 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
781 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
782 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
783 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
784 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
785 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 786 |
if (IN_param_value != NULL) { |
787 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
788 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
789 |
} |
|
790 |
||
791 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
792 |
{ |
|
793 |
||
794 |
symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; |
|
795 |
return return_type_symbol; |
|
796 |
||
797 |
} |
|
798 |
||
799 |
||
800 |
ERROR; |
|
801 |
} |
|
802 |
||
803 |
}/*function_sint_to_lint*/ |
|
804 |
break; |
|
805 |
||
806 |
/**** |
|
807 |
*SINT_TO_DINT |
|
808 |
*/ |
|
809 |
case function_sint_to_dint : |
|
810 |
{ |
|
811 |
symbol_c *last_type_symbol = NULL; |
|
812 |
||
813 |
{ |
|
814 |
identifier_c param_name("IN"); |
|
815 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
816 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
817 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
818 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
819 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
820 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
821 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 822 |
if (IN_param_value != NULL) { |
823 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
824 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
825 |
} |
|
826 |
||
827 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
828 |
{ |
|
829 |
||
830 |
symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|
831 |
return return_type_symbol; |
|
832 |
||
833 |
} |
|
834 |
||
835 |
||
836 |
ERROR; |
|
837 |
} |
|
838 |
||
839 |
}/*function_sint_to_dint*/ |
|
840 |
break; |
|
841 |
||
842 |
/**** |
|
843 |
*SINT_TO_DATE |
|
844 |
*/ |
|
845 |
case function_sint_to_date : |
|
846 |
{ |
|
847 |
symbol_c *last_type_symbol = NULL; |
|
848 |
||
849 |
{ |
|
850 |
identifier_c param_name("IN"); |
|
851 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
852 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
853 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
854 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
855 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
856 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
857 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 858 |
if (IN_param_value != NULL) { |
859 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
860 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
861 |
} |
|
862 |
||
863 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
864 |
{ |
|
865 |
||
866 |
symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; |
|
867 |
return return_type_symbol; |
|
868 |
||
869 |
} |
|
870 |
||
871 |
||
872 |
ERROR; |
|
873 |
} |
|
874 |
||
875 |
}/*function_sint_to_date*/ |
|
876 |
break; |
|
877 |
||
878 |
/**** |
|
879 |
*SINT_TO_DWORD |
|
880 |
*/ |
|
881 |
case function_sint_to_dword : |
|
882 |
{ |
|
883 |
symbol_c *last_type_symbol = NULL; |
|
884 |
||
885 |
{ |
|
886 |
identifier_c param_name("IN"); |
|
887 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
888 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
889 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
890 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
891 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
892 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
893 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 894 |
if (IN_param_value != NULL) { |
895 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
896 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
897 |
} |
|
898 |
||
899 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
900 |
{ |
|
901 |
||
902 |
symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; |
|
903 |
return return_type_symbol; |
|
904 |
||
905 |
} |
|
906 |
||
907 |
||
908 |
ERROR; |
|
909 |
} |
|
910 |
||
911 |
}/*function_sint_to_dword*/ |
|
912 |
break; |
|
913 |
||
914 |
/**** |
|
915 |
*SINT_TO_DT |
|
916 |
*/ |
|
917 |
case function_sint_to_dt : |
|
918 |
{ |
|
919 |
symbol_c *last_type_symbol = NULL; |
|
920 |
||
921 |
{ |
|
922 |
identifier_c param_name("IN"); |
|
923 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
924 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
925 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
926 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
927 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
928 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
929 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 930 |
if (IN_param_value != NULL) { |
931 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
932 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
933 |
} |
|
934 |
||
935 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
936 |
{ |
|
937 |
||
938 |
symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; |
|
939 |
return return_type_symbol; |
|
940 |
||
941 |
} |
|
942 |
||
943 |
||
944 |
ERROR; |
|
945 |
} |
|
946 |
||
947 |
}/*function_sint_to_dt*/ |
|
948 |
break; |
|
949 |
||
950 |
/**** |
|
951 |
*SINT_TO_TOD |
|
952 |
*/ |
|
953 |
case function_sint_to_tod : |
|
954 |
{ |
|
955 |
symbol_c *last_type_symbol = NULL; |
|
956 |
||
957 |
{ |
|
958 |
identifier_c param_name("IN"); |
|
959 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
960 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
961 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
962 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
963 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
964 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
965 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 966 |
if (IN_param_value != NULL) { |
967 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
968 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
969 |
} |
|
970 |
||
971 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
972 |
{ |
|
973 |
||
974 |
symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; |
|
975 |
return return_type_symbol; |
|
976 |
||
977 |
} |
|
978 |
||
979 |
||
980 |
ERROR; |
|
981 |
} |
|
982 |
||
983 |
}/*function_sint_to_tod*/ |
|
984 |
break; |
|
985 |
||
986 |
/**** |
|
987 |
*SINT_TO_UDINT |
|
988 |
*/ |
|
989 |
case function_sint_to_udint : |
|
990 |
{ |
|
991 |
symbol_c *last_type_symbol = NULL; |
|
992 |
||
993 |
{ |
|
994 |
identifier_c param_name("IN"); |
|
995 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
996 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
997 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
998 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
999 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1000 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1001 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1002 |
if (IN_param_value != NULL) { |
1003 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1004 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1005 |
} |
|
1006 |
||
1007 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1008 |
{ |
|
1009 |
||
1010 |
symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; |
|
1011 |
return return_type_symbol; |
|
1012 |
||
1013 |
} |
|
1014 |
||
1015 |
||
1016 |
ERROR; |
|
1017 |
} |
|
1018 |
||
1019 |
}/*function_sint_to_udint*/ |
|
1020 |
break; |
|
1021 |
||
1022 |
/**** |
|
1023 |
*SINT_TO_WORD |
|
1024 |
*/ |
|
1025 |
case function_sint_to_word : |
|
1026 |
{ |
|
1027 |
symbol_c *last_type_symbol = NULL; |
|
1028 |
||
1029 |
{ |
|
1030 |
identifier_c param_name("IN"); |
|
1031 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1032 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1033 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1034 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1035 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1036 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1037 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1038 |
if (IN_param_value != NULL) { |
1039 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1040 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1041 |
} |
|
1042 |
||
1043 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1044 |
{ |
|
1045 |
||
1046 |
symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; |
|
1047 |
return return_type_symbol; |
|
1048 |
||
1049 |
} |
|
1050 |
||
1051 |
||
1052 |
ERROR; |
|
1053 |
} |
|
1054 |
||
1055 |
}/*function_sint_to_word*/ |
|
1056 |
break; |
|
1057 |
||
1058 |
/**** |
|
1059 |
*SINT_TO_STRING |
|
1060 |
*/ |
|
1061 |
case function_sint_to_string : |
|
1062 |
{ |
|
1063 |
symbol_c *last_type_symbol = NULL; |
|
1064 |
||
1065 |
{ |
|
1066 |
identifier_c param_name("IN"); |
|
1067 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1068 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1069 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1070 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1071 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1072 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1073 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1074 |
if (IN_param_value != NULL) { |
1075 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1076 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1077 |
} |
|
1078 |
||
1079 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1080 |
{ |
|
1081 |
||
1082 |
symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; |
|
1083 |
return return_type_symbol; |
|
1084 |
||
1085 |
} |
|
1086 |
||
1087 |
||
1088 |
ERROR; |
|
1089 |
} |
|
1090 |
||
1091 |
}/*function_sint_to_string*/ |
|
1092 |
break; |
|
1093 |
||
1094 |
/**** |
|
1095 |
*SINT_TO_LWORD |
|
1096 |
*/ |
|
1097 |
case function_sint_to_lword : |
|
1098 |
{ |
|
1099 |
symbol_c *last_type_symbol = NULL; |
|
1100 |
||
1101 |
{ |
|
1102 |
identifier_c param_name("IN"); |
|
1103 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1104 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1105 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1106 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1107 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1108 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1109 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1110 |
if (IN_param_value != NULL) { |
1111 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1112 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1113 |
} |
|
1114 |
||
1115 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1116 |
{ |
|
1117 |
||
1118 |
symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; |
|
1119 |
return return_type_symbol; |
|
1120 |
||
1121 |
} |
|
1122 |
||
1123 |
||
1124 |
ERROR; |
|
1125 |
} |
|
1126 |
||
1127 |
}/*function_sint_to_lword*/ |
|
1128 |
break; |
|
1129 |
||
1130 |
/**** |
|
1131 |
*SINT_TO_UINT |
|
1132 |
*/ |
|
1133 |
case function_sint_to_uint : |
|
1134 |
{ |
|
1135 |
symbol_c *last_type_symbol = NULL; |
|
1136 |
||
1137 |
{ |
|
1138 |
identifier_c param_name("IN"); |
|
1139 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1140 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1141 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1142 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1143 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1144 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1145 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1146 |
if (IN_param_value != NULL) { |
1147 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1148 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1149 |
} |
|
1150 |
||
1151 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1152 |
{ |
|
1153 |
||
1154 |
symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; |
|
1155 |
return return_type_symbol; |
|
1156 |
||
1157 |
} |
|
1158 |
||
1159 |
||
1160 |
ERROR; |
|
1161 |
} |
|
1162 |
||
1163 |
}/*function_sint_to_uint*/ |
|
1164 |
break; |
|
1165 |
||
1166 |
/**** |
|
1167 |
*SINT_TO_LREAL |
|
1168 |
*/ |
|
1169 |
case function_sint_to_lreal : |
|
1170 |
{ |
|
1171 |
symbol_c *last_type_symbol = NULL; |
|
1172 |
||
1173 |
{ |
|
1174 |
identifier_c param_name("IN"); |
|
1175 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1176 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1177 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1178 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1179 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1180 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1181 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1182 |
if (IN_param_value != NULL) { |
1183 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1184 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1185 |
} |
|
1186 |
||
1187 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1188 |
{ |
|
1189 |
||
1190 |
symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; |
|
1191 |
return return_type_symbol; |
|
1192 |
||
1193 |
} |
|
1194 |
||
1195 |
||
1196 |
ERROR; |
|
1197 |
} |
|
1198 |
||
1199 |
}/*function_sint_to_lreal*/ |
|
1200 |
break; |
|
1201 |
||
1202 |
/**** |
|
1203 |
*SINT_TO_BYTE |
|
1204 |
*/ |
|
1205 |
case function_sint_to_byte : |
|
1206 |
{ |
|
1207 |
symbol_c *last_type_symbol = NULL; |
|
1208 |
||
1209 |
{ |
|
1210 |
identifier_c param_name("IN"); |
|
1211 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1212 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1213 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1214 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1215 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1216 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1217 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1218 |
if (IN_param_value != NULL) { |
1219 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1220 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1221 |
} |
|
1222 |
||
1223 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1224 |
{ |
|
1225 |
||
1226 |
symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; |
|
1227 |
return return_type_symbol; |
|
1228 |
||
1229 |
} |
|
1230 |
||
1231 |
||
1232 |
ERROR; |
|
1233 |
} |
|
1234 |
||
1235 |
}/*function_sint_to_byte*/ |
|
1236 |
break; |
|
1237 |
||
1238 |
/**** |
|
1239 |
*SINT_TO_USINT |
|
1240 |
*/ |
|
1241 |
case function_sint_to_usint : |
|
1242 |
{ |
|
1243 |
symbol_c *last_type_symbol = NULL; |
|
1244 |
||
1245 |
{ |
|
1246 |
identifier_c param_name("IN"); |
|
1247 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1248 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1249 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1250 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1251 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1252 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1253 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1254 |
if (IN_param_value != NULL) { |
1255 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1256 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1257 |
} |
|
1258 |
||
1259 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1260 |
{ |
|
1261 |
||
1262 |
symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; |
|
1263 |
return return_type_symbol; |
|
1264 |
||
1265 |
} |
|
1266 |
||
1267 |
||
1268 |
ERROR; |
|
1269 |
} |
|
1270 |
||
1271 |
}/*function_sint_to_usint*/ |
|
1272 |
break; |
|
1273 |
||
1274 |
/**** |
|
1275 |
*SINT_TO_ULINT |
|
1276 |
*/ |
|
1277 |
case function_sint_to_ulint : |
|
1278 |
{ |
|
1279 |
symbol_c *last_type_symbol = NULL; |
|
1280 |
||
1281 |
{ |
|
1282 |
identifier_c param_name("IN"); |
|
1283 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1284 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1285 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1286 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1287 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1288 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1289 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1290 |
if (IN_param_value != NULL) { |
1291 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1292 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1293 |
} |
|
1294 |
||
1295 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1296 |
{ |
|
1297 |
||
1298 |
symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; |
|
1299 |
return return_type_symbol; |
|
1300 |
||
1301 |
} |
|
1302 |
||
1303 |
||
1304 |
ERROR; |
|
1305 |
} |
|
1306 |
||
1307 |
}/*function_sint_to_ulint*/ |
|
1308 |
break; |
|
1309 |
||
1310 |
/**** |
|
1311 |
*SINT_TO_BOOL |
|
1312 |
*/ |
|
1313 |
case function_sint_to_bool : |
|
1314 |
{ |
|
1315 |
symbol_c *last_type_symbol = NULL; |
|
1316 |
||
1317 |
{ |
|
1318 |
identifier_c param_name("IN"); |
|
1319 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1320 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1321 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1322 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1323 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1324 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1325 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1326 |
if (IN_param_value != NULL) { |
1327 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1328 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1329 |
} |
|
1330 |
||
1331 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1332 |
{ |
|
1333 |
||
1334 |
symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; |
|
1335 |
return return_type_symbol; |
|
1336 |
||
1337 |
} |
|
1338 |
||
1339 |
||
1340 |
ERROR; |
|
1341 |
} |
|
1342 |
||
1343 |
}/*function_sint_to_bool*/ |
|
1344 |
break; |
|
1345 |
||
1346 |
/**** |
|
1347 |
*SINT_TO_TIME |
|
1348 |
*/ |
|
1349 |
case function_sint_to_time : |
|
1350 |
{ |
|
1351 |
symbol_c *last_type_symbol = NULL; |
|
1352 |
||
1353 |
{ |
|
1354 |
identifier_c param_name("IN"); |
|
1355 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1356 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1357 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1358 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1359 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1360 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1361 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1362 |
if (IN_param_value != NULL) { |
1363 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1364 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1365 |
} |
|
1366 |
||
1367 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1368 |
{ |
|
1369 |
||
1370 |
symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; |
|
1371 |
return return_type_symbol; |
|
1372 |
||
1373 |
} |
|
1374 |
||
1375 |
||
1376 |
ERROR; |
|
1377 |
} |
|
1378 |
||
1379 |
}/*function_sint_to_time*/ |
|
1380 |
break; |
|
1381 |
||
1382 |
/**** |
|
1383 |
*SINT_TO_INT |
|
1384 |
*/ |
|
1385 |
case function_sint_to_int : |
|
1386 |
{ |
|
1387 |
symbol_c *last_type_symbol = NULL; |
|
1388 |
||
1389 |
{ |
|
1390 |
identifier_c param_name("IN"); |
|
1391 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1392 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1393 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1394 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1395 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1396 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1397 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1398 |
if (IN_param_value != NULL) { |
1399 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1400 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1401 |
} |
|
1402 |
||
1403 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) |
|
1404 |
{ |
|
1405 |
||
1406 |
symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; |
|
1407 |
return return_type_symbol; |
|
1408 |
||
1409 |
} |
|
1410 |
||
1411 |
||
1412 |
ERROR; |
|
1413 |
} |
|
1414 |
||
1415 |
}/*function_sint_to_int*/ |
|
1416 |
break; |
|
1417 |
||
1418 |
/**** |
|
1419 |
*LINT_TO_REAL |
|
1420 |
*/ |
|
1421 |
case function_lint_to_real : |
|
1422 |
{ |
|
1423 |
symbol_c *last_type_symbol = NULL; |
|
1424 |
||
1425 |
{ |
|
1426 |
identifier_c param_name("IN"); |
|
1427 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1428 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1429 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1430 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1431 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1432 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1433 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1434 |
if (IN_param_value != NULL) { |
1435 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1436 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1437 |
} |
|
1438 |
||
1439 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
1440 |
{ |
|
1441 |
||
1442 |
symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; |
|
1443 |
return return_type_symbol; |
|
1444 |
||
1445 |
} |
|
1446 |
||
1447 |
||
1448 |
ERROR; |
|
1449 |
} |
|
1450 |
||
1451 |
}/*function_lint_to_real*/ |
|
1452 |
break; |
|
1453 |
||
1454 |
/**** |
|
1455 |
*LINT_TO_SINT |
|
1456 |
*/ |
|
1457 |
case function_lint_to_sint : |
|
1458 |
{ |
|
1459 |
symbol_c *last_type_symbol = NULL; |
|
1460 |
||
1461 |
{ |
|
1462 |
identifier_c param_name("IN"); |
|
1463 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1464 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1465 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1466 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1467 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1468 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1469 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1470 |
if (IN_param_value != NULL) { |
1471 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1472 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1473 |
} |
|
1474 |
||
1475 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
1476 |
{ |
|
1477 |
||
1478 |
symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; |
|
1479 |
return return_type_symbol; |
|
1480 |
||
1481 |
} |
|
1482 |
||
1483 |
||
1484 |
ERROR; |
|
1485 |
} |
|
1486 |
||
1487 |
}/*function_lint_to_sint*/ |
|
1488 |
break; |
|
1489 |
||
1490 |
/**** |
|
1491 |
*LINT_TO_DINT |
|
1492 |
*/ |
|
1493 |
case function_lint_to_dint : |
|
1494 |
{ |
|
1495 |
symbol_c *last_type_symbol = NULL; |
|
1496 |
||
1497 |
{ |
|
1498 |
identifier_c param_name("IN"); |
|
1499 |
/* Get the value from a foo(<param_name> = <param_value>) style call */ |
|
208
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1500 |
symbol_c *IN_param_value = function_call_param_iterator.search_f(¶m_name); |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1501 |
symbol_c *IN_type_symbol = NULL; |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1502 |
|
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1503 |
/* Get the value from a foo(<param_value>) style call */ |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1504 |
if (IN_param_value == NULL) |
c72748a12ae3
Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents:
181
diff
changeset
|
1505 |
IN_param_value = function_call_param_iterator.next_nf(); |
181 | 1506 |
if (IN_param_value != NULL) { |
1507 |
IN_type_symbol = search_expression_type->get_type(IN_param_value); |
|
1508 |
last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; |
|
1509 |
} |
|
1510 |
||
1511 |
if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) |
|
1512 |
{ |
|
1513 |
||
1514 |
symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; |
|