201 symbol->step_name->accept(*this); |
201 symbol->step_name->accept(*this); |
202 s4o.print(" action associations\n"); |
202 s4o.print(" action associations\n"); |
203 current_step = symbol->step_name; |
203 current_step = symbol->step_name; |
204 s4o.print(s4o.indent_spaces + "{\n"); |
204 s4o.print(s4o.indent_spaces + "{\n"); |
205 s4o.indent_right(); |
205 s4o.indent_right(); |
206 s4o.print(s4o.indent_spaces + "char activated = "); |
206 s4o.print(s4o.indent_spaces + "char activated, desactivated, active;\n"); |
|
207 s4o.print(s4o.indent_spaces + "activated = "); |
207 s4o.print(GET_VAR); |
208 s4o.print(GET_VAR); |
208 s4o.print("("); |
209 s4o.print("("); |
209 print_step_argument(current_step, "state"); |
210 print_step_argument(current_step, "state"); |
210 s4o.print(") && !"); |
211 s4o.print(") && !"); |
211 print_step_argument(current_step, "prev_state"); |
212 print_step_argument(current_step, "prev_state"); |
212 s4o.print(";\n"); |
213 s4o.print(";\n"); |
213 s4o.print(s4o.indent_spaces + "char desactivated = !"); |
214 s4o.print(s4o.indent_spaces + "desactivated = !"); |
214 s4o.print(GET_VAR); |
215 s4o.print(GET_VAR); |
215 s4o.print("("); |
216 s4o.print("("); |
216 print_step_argument(current_step, "state"); |
217 print_step_argument(current_step, "state"); |
217 s4o.print(") && "); |
218 s4o.print(") && "); |
218 print_step_argument(current_step, "prev_state"); |
219 print_step_argument(current_step, "prev_state"); |
219 s4o.print(";\n"); |
220 s4o.print(";\n"); |
220 s4o.print(s4o.indent_spaces + "char active = "); |
221 s4o.print(s4o.indent_spaces + "active = "); |
221 s4o.print(GET_VAR); |
222 s4o.print(GET_VAR); |
222 s4o.print("("); |
223 s4o.print("("); |
223 print_step_argument(current_step, "state"); |
224 print_step_argument(current_step, "state"); |
224 s4o.print(");\n"); |
225 s4o.print(");\n"); |
225 symbol->action_association_list->accept(*this); |
226 symbol->action_association_list->accept(*this); |
574 print_variable_prefix(); |
575 print_variable_prefix(); |
575 s4o.print(","); |
576 s4o.print(","); |
576 current_action->accept(*this); |
577 current_action->accept(*this); |
577 s4o.print(",1);\n"); |
578 s4o.print(",1);\n"); |
578 s4o.indent_left(); |
579 s4o.indent_left(); |
579 s4o.print("}\n"); |
580 s4o.print(s4o.indent_spaces + "}\n"); |
580 s4o.print(s4o.indent_spaces + "else if (active) {\n"); |
581 s4o.print(s4o.indent_spaces + "else if (active) {\n"); |
581 s4o.indent_right(); |
582 s4o.indent_right(); |
|
583 s4o.print(s4o.indent_spaces); |
582 if (vartype == search_var_instance_decl_c::external_vt) |
584 if (vartype == search_var_instance_decl_c::external_vt) |
583 s4o.print(SET_EXTERNAL); |
585 s4o.print(SET_EXTERNAL); |
584 else if (vartype == search_var_instance_decl_c::located_vt) |
586 else if (vartype == search_var_instance_decl_c::located_vt) |
585 s4o.print(SET_LOCATED); |
587 s4o.print(SET_LOCATED); |
586 else |
588 else |
697 symbol->elements[i]->accept(*this); |
699 symbol->elements[i]->accept(*this); |
698 generate_c_sfc_elements->generate(symbol->elements[i], generate_c_sfc_elements_c::transitionlist_sg); |
700 generate_c_sfc_elements->generate(symbol->elements[i], generate_c_sfc_elements_c::transitionlist_sg); |
699 } |
701 } |
700 |
702 |
701 s4o.print(s4o.indent_spaces +"INT i;\n"); |
703 s4o.print(s4o.indent_spaces +"INT i;\n"); |
702 s4o.print(s4o.indent_spaces +"BOOL transition;\n"); |
|
703 s4o.print(s4o.indent_spaces +"TIME elapsed_time, current_time;\n\n"); |
704 s4o.print(s4o.indent_spaces +"TIME elapsed_time, current_time;\n\n"); |
704 |
705 |
705 /* generate elapsed_time initializations */ |
706 /* generate elapsed_time initializations */ |
706 s4o.print(s4o.indent_spaces + "// Calculate elapsed_time\n"); |
707 s4o.print(s4o.indent_spaces + "// Calculate elapsed_time\n"); |
707 s4o.print(s4o.indent_spaces +"current_time = __CURRENT_TIME;\n"); |
708 s4o.print(s4o.indent_spaces +"current_time = __CURRENT_TIME;\n"); |