104 symbol_c *fbname; |
104 symbol_c *fbname; |
105 |
105 |
106 search_expression_type_c *search_expression_type; |
106 search_expression_type_c *search_expression_type; |
107 |
107 |
108 search_varfb_instance_type_c *search_varfb_instance_type; |
108 search_varfb_instance_type_c *search_varfb_instance_type; |
|
109 search_var_instance_decl_c *search_var_instance_decl; |
109 |
110 |
110 search_base_type_c search_base_type; |
111 search_base_type_c search_base_type; |
111 |
112 |
112 variablegeneration_t wanted_variablegeneration; |
113 variablegeneration_t wanted_variablegeneration; |
113 |
114 |
117 default_variable_name(IL_DEFVAR, NULL), |
118 default_variable_name(IL_DEFVAR, NULL), |
118 default_variable_back_name(IL_DEFVAR_BACK, NULL) |
119 default_variable_back_name(IL_DEFVAR_BACK, NULL) |
119 { |
120 { |
120 search_expression_type = new search_expression_type_c(scope); |
121 search_expression_type = new search_expression_type_c(scope); |
121 search_varfb_instance_type = new search_varfb_instance_type_c(scope); |
122 search_varfb_instance_type = new search_varfb_instance_type_c(scope); |
|
123 search_var_instance_decl = new search_var_instance_decl_c(scope); |
|
124 |
122 this->set_variable_prefix(variable_prefix); |
125 this->set_variable_prefix(variable_prefix); |
123 current_operand = NULL; |
126 current_operand = NULL; |
124 current_operand_type = NULL; |
127 current_operand_type = NULL; |
125 il_default_variable_init_value = NULL; |
128 il_default_variable_init_value = NULL; |
126 fcall_number = 0; |
129 fcall_number = 0; |
130 } |
133 } |
131 |
134 |
132 virtual ~generate_c_inlinefcall_c(void) { |
135 virtual ~generate_c_inlinefcall_c(void) { |
133 delete search_expression_type; |
136 delete search_expression_type; |
134 delete search_varfb_instance_type; |
137 delete search_varfb_instance_type; |
|
138 delete search_var_instance_decl; |
135 } |
139 } |
136 |
140 |
137 void print(symbol_c* symbol) { |
141 void print(symbol_c* symbol) { |
138 function_call_iterator_c fc_iterator(symbol); |
142 function_call_iterator_c fc_iterator(symbol); |
139 symbol_c* function_call; |
143 symbol_c* function_call; |
307 search_expression_type->is_literal_real_type(this->current_operand_type)) |
311 search_expression_type->is_literal_real_type(this->current_operand_type)) |
308 this->current_operand_type = this->default_variable_name.current_type; |
312 this->current_operand_type = this->default_variable_name.current_type; |
309 } |
313 } |
310 |
314 |
311 void *print_getter(symbol_c *symbol) { |
315 void *print_getter(symbol_c *symbol) { |
312 unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); |
316 unsigned int vartype = search_var_instance_decl->get_vartype(symbol); |
313 if (vartype == search_var_instance_decl_c::external_vt) |
317 if (vartype == search_var_instance_decl_c::external_vt) |
314 s4o.print(GET_EXTERNAL); |
318 s4o.print(GET_EXTERNAL); |
315 else if (vartype == search_var_instance_decl_c::located_vt) |
319 else if (vartype == search_var_instance_decl_c::located_vt) |
316 s4o.print(GET_LOCATED); |
320 s4o.print(GET_LOCATED); |
317 else |
321 else |
318 s4o.print(GET_VAR); |
322 s4o.print(GET_VAR); |
319 s4o.print("("); |
323 s4o.print("("); |
320 |
324 |
321 wanted_variablegeneration = complextype_base_vg; |
325 wanted_variablegeneration = complextype_base_vg; |
322 symbol->accept(*this); |
326 symbol->accept(*this); |
323 if (search_varfb_instance_type->type_is_complex()) |
327 if (search_varfb_instance_type->type_is_complex(symbol)) |
324 s4o.print(","); |
328 s4o.print(","); |
325 wanted_variablegeneration = complextype_suffix_vg; |
329 wanted_variablegeneration = complextype_suffix_vg; |
326 symbol->accept(*this); |
330 symbol->accept(*this); |
327 s4o.print(")"); |
331 s4o.print(")"); |
328 wanted_variablegeneration = expression_vg; |
332 wanted_variablegeneration = expression_vg; |
330 } |
334 } |
331 |
335 |
332 void *print_setter(symbol_c* symbol, |
336 void *print_setter(symbol_c* symbol, |
333 symbol_c* type, |
337 symbol_c* type, |
334 symbol_c* value) { |
338 symbol_c* value) { |
335 unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); |
339 unsigned int vartype = search_var_instance_decl->get_vartype(symbol); |
336 if (vartype == search_var_instance_decl_c::external_vt) |
340 if (vartype == search_var_instance_decl_c::external_vt) |
337 s4o.print(SET_EXTERNAL); |
341 s4o.print(SET_EXTERNAL); |
338 else if (vartype == search_var_instance_decl_c::located_vt) |
342 else if (vartype == search_var_instance_decl_c::located_vt) |
339 s4o.print(SET_LOCATED); |
343 s4o.print(SET_LOCATED); |
340 else |
344 else |
344 wanted_variablegeneration = complextype_base_vg; |
348 wanted_variablegeneration = complextype_base_vg; |
345 symbol->accept(*this); |
349 symbol->accept(*this); |
346 s4o.print(","); |
350 s4o.print(","); |
347 wanted_variablegeneration = expression_vg; |
351 wanted_variablegeneration = expression_vg; |
348 print_check_function(type, value, NULL, true); |
352 print_check_function(type, value, NULL, true); |
349 if (search_varfb_instance_type->type_is_complex()) { |
353 if (search_varfb_instance_type->type_is_complex(symbol)) { |
350 s4o.print(","); |
354 s4o.print(","); |
351 wanted_variablegeneration = complextype_suffix_vg; |
355 wanted_variablegeneration = complextype_suffix_vg; |
352 symbol->accept(*this); |
356 symbol->accept(*this); |
353 } |
357 } |
354 s4o.print(")"); |
358 s4o.print(")"); |