statecharts
statecharts copied to clipboard
Code generators should support generation of model comments.
The code generators should transfer model comments into code. Especially those comments that are added to transitions, entry and exit actions, states, interfaces, and regions should be reflected in the source code.
First it has to be defined where the comments and the documentation should go.
There are already generated comments in the generated code, for example;
/* Entry action for state 'State_B'. */
static void testing_enact_main_region_State_B(Testing* handle)
{
/* Entry action for state 'State_B'. */
handle->ifaceUser.currentState = 2;
}
In my example state model (see below) I have put comments in both states.
Could the example code generated become;
/* Entry action for state 'State_B'. */
static void testing_enact_main_region_State_B(Testing* handle)
{
/* Entry action for state 'State_B'. */
handle->ifaceUser.currentState = 2; /* set state A=2 */
}