ShallowHistory.c 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include "sc_types.h"
  4. #include "ShallowHistory.h"
  5. /*! \file Implementation of the state machine 'ShallowHistory'
  6. */
  7. /* prototypes of all internal functions */
  8. static sc_boolean shallowHistory_check_mainRegion_State1_tr0_tr0(const ShallowHistory* handle);
  9. static sc_boolean shallowHistory_check_mainRegion_State2_tr0_tr0(const ShallowHistory* handle);
  10. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State3_tr0_tr0(const ShallowHistory* handle);
  11. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4_tr0_tr0(const ShallowHistory* handle);
  12. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(const ShallowHistory* handle);
  13. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(const ShallowHistory* handle);
  14. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(const ShallowHistory* handle);
  15. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(const ShallowHistory* handle);
  16. static void shallowHistory_effect_mainRegion_State1_tr0(ShallowHistory* handle);
  17. static void shallowHistory_effect_mainRegion_State2_tr0(ShallowHistory* handle);
  18. static void shallowHistory_effect_mainRegion_State2__region0_State3_tr0(ShallowHistory* handle);
  19. static void shallowHistory_effect_mainRegion_State2__region0_State4_tr0(ShallowHistory* handle);
  20. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(ShallowHistory* handle);
  21. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(ShallowHistory* handle);
  22. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(ShallowHistory* handle);
  23. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(ShallowHistory* handle);
  24. static void shallowHistory_enseq_mainRegion_State1_default(ShallowHistory* handle);
  25. static void shallowHistory_enseq_mainRegion_State2_default(ShallowHistory* handle);
  26. static void shallowHistory_enseq_mainRegion_State2__region0_State3_default(ShallowHistory* handle);
  27. static void shallowHistory_enseq_mainRegion_State2__region0_State4_default(ShallowHistory* handle);
  28. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(ShallowHistory* handle);
  29. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(ShallowHistory* handle);
  30. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(ShallowHistory* handle);
  31. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(ShallowHistory* handle);
  32. static void shallowHistory_enseq_mainRegion_State2__region0_State5_default(ShallowHistory* handle);
  33. static void shallowHistory_enseq_mainRegion_default(ShallowHistory* handle);
  34. static void shallowHistory_enseq_mainRegion_State2__region0_default(ShallowHistory* handle);
  35. static void shallowHistory_shenseq_mainRegion_State2__region0(ShallowHistory* handle);
  36. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_default(ShallowHistory* handle);
  37. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(ShallowHistory* handle);
  38. static void shallowHistory_shenseq_mainRegion_State2__region0_State4__region0_State7__region0(ShallowHistory* handle);
  39. static void shallowHistory_exseq_mainRegion_State1(ShallowHistory* handle);
  40. static void shallowHistory_exseq_mainRegion_State2(ShallowHistory* handle);
  41. static void shallowHistory_exseq_mainRegion_State2__region0_State3(ShallowHistory* handle);
  42. static void shallowHistory_exseq_mainRegion_State2__region0_State4(ShallowHistory* handle);
  43. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(ShallowHistory* handle);
  44. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7(ShallowHistory* handle);
  45. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(ShallowHistory* handle);
  46. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(ShallowHistory* handle);
  47. static void shallowHistory_exseq_mainRegion_State2__region0_State5(ShallowHistory* handle);
  48. static void shallowHistory_exseq_mainRegion(ShallowHistory* handle);
  49. static void shallowHistory_exseq_mainRegion_State2__region0(ShallowHistory* handle);
  50. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0(ShallowHistory* handle);
  51. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(ShallowHistory* handle);
  52. static void shallowHistory_react_mainRegion_State1(ShallowHistory* handle);
  53. static void shallowHistory_react_mainRegion_State2__region0_State3(ShallowHistory* handle);
  54. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State6(ShallowHistory* handle);
  55. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(ShallowHistory* handle);
  56. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(ShallowHistory* handle);
  57. static void shallowHistory_react_mainRegion_State2__region0_State5(ShallowHistory* handle);
  58. static void shallowHistory_react_mainRegion__entry_Default(ShallowHistory* handle);
  59. static void shallowHistory_react_mainRegion_State2__region0__entry_Default(ShallowHistory* handle);
  60. static void shallowHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(ShallowHistory* handle);
  61. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(ShallowHistory* handle);
  62. static void shallowHistory_clearInEvents(ShallowHistory* handle);
  63. static void shallowHistory_clearOutEvents(ShallowHistory* handle);
  64. void shallowHistory_init(ShallowHistory* handle)
  65. {
  66. sc_integer i;
  67. for (i = 0; i < SHALLOWHISTORY_MAX_ORTHOGONAL_STATES; ++i)
  68. {
  69. handle->stateConfVector[i] = ShallowHistory_last_state;
  70. }
  71. for (i = 0; i < SHALLOWHISTORY_MAX_HISTORY_STATES; ++i)
  72. {
  73. handle->historyVector[i] = ShallowHistory_last_state;
  74. }
  75. handle->stateConfVectorPosition = 0;
  76. shallowHistory_clearInEvents(handle);
  77. shallowHistory_clearOutEvents(handle);
  78. }
  79. void shallowHistory_enter(ShallowHistory* handle)
  80. {
  81. /* Default enter sequence for statechart ShallowHistory */
  82. shallowHistory_enseq_mainRegion_default(handle);
  83. }
  84. void shallowHistory_exit(ShallowHistory* handle)
  85. {
  86. /* Default exit sequence for statechart ShallowHistory */
  87. shallowHistory_exseq_mainRegion(handle);
  88. }
  89. sc_boolean shallowHistory_isActive(const ShallowHistory* handle)
  90. {
  91. sc_boolean result = bool_false;
  92. int i;
  93. for(i = 0; i < SHALLOWHISTORY_MAX_ORTHOGONAL_STATES; i++)
  94. {
  95. result = result || handle->stateConfVector[i] != ShallowHistory_last_state;
  96. }
  97. return result;
  98. }
  99. /*
  100. * Always returns 'false' since this state machine can never become final.
  101. */
  102. sc_boolean shallowHistory_isFinal(const ShallowHistory* handle)
  103. {
  104. return bool_false;
  105. }
  106. static void shallowHistory_clearInEvents(ShallowHistory* handle)
  107. {
  108. handle->iface.event1_raised = bool_false;
  109. handle->iface.event2_raised = bool_false;
  110. handle->iface.event3_raised = bool_false;
  111. handle->iface.event4_raised = bool_false;
  112. handle->iface.event5_raised = bool_false;
  113. handle->iface.event6_raised = bool_false;
  114. handle->iface.event7_raised = bool_false;
  115. handle->iface.event8_raised = bool_false;
  116. }
  117. static void shallowHistory_clearOutEvents(ShallowHistory* handle)
  118. {
  119. }
  120. void shallowHistory_runCycle(ShallowHistory* handle)
  121. {
  122. shallowHistory_clearOutEvents(handle);
  123. for (handle->stateConfVectorPosition = 0;
  124. handle->stateConfVectorPosition < SHALLOWHISTORY_MAX_ORTHOGONAL_STATES;
  125. handle->stateConfVectorPosition++)
  126. {
  127. switch (handle->stateConfVector[handle->stateConfVectorPosition])
  128. {
  129. case ShallowHistory_mainRegion_State1 :
  130. {
  131. shallowHistory_react_mainRegion_State1(handle);
  132. break;
  133. }
  134. case ShallowHistory_mainRegion_State2__region0_State3 :
  135. {
  136. shallowHistory_react_mainRegion_State2__region0_State3(handle);
  137. break;
  138. }
  139. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  140. {
  141. shallowHistory_react_mainRegion_State2__region0_State4__region0_State6(handle);
  142. break;
  143. }
  144. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  145. {
  146. shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  147. break;
  148. }
  149. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  150. {
  151. shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  152. break;
  153. }
  154. case ShallowHistory_mainRegion_State2__region0_State5 :
  155. {
  156. shallowHistory_react_mainRegion_State2__region0_State5(handle);
  157. break;
  158. }
  159. default:
  160. break;
  161. }
  162. }
  163. shallowHistory_clearInEvents(handle);
  164. }
  165. sc_boolean shallowHistory_isStateActive(const ShallowHistory* handle, ShallowHistoryStates state)
  166. {
  167. sc_boolean result = bool_false;
  168. switch (state)
  169. {
  170. case ShallowHistory_mainRegion_State1 :
  171. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE1] == ShallowHistory_mainRegion_State1
  172. );
  173. break;
  174. case ShallowHistory_mainRegion_State2 :
  175. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2] >= ShallowHistory_mainRegion_State2
  176. && handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2] <= ShallowHistory_mainRegion_State2__region0_State5);
  177. break;
  178. case ShallowHistory_mainRegion_State2__region0_State3 :
  179. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE3] == ShallowHistory_mainRegion_State2__region0_State3
  180. );
  181. break;
  182. case ShallowHistory_mainRegion_State2__region0_State4 :
  183. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4] >= ShallowHistory_mainRegion_State2__region0_State4
  184. && handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4] <= ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9);
  185. break;
  186. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  187. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE6] == ShallowHistory_mainRegion_State2__region0_State4__region0_State6
  188. );
  189. break;
  190. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7 :
  191. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7] >= ShallowHistory_mainRegion_State2__region0_State4__region0_State7
  192. && handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7] <= ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9);
  193. break;
  194. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  195. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7__REGION0_STATE8] == ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8
  196. );
  197. break;
  198. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  199. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7__REGION0_STATE9] == ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9
  200. );
  201. break;
  202. case ShallowHistory_mainRegion_State2__region0_State5 :
  203. result = (sc_boolean) (handle->stateConfVector[SCVI_SHALLOWHISTORY_MAINREGION_STATE2__REGION0_STATE5] == ShallowHistory_mainRegion_State2__region0_State5
  204. );
  205. break;
  206. default:
  207. result = bool_false;
  208. break;
  209. }
  210. return result;
  211. }
  212. void shallowHistoryIface_raise_event1(ShallowHistory* handle)
  213. {
  214. handle->iface.event1_raised = bool_true;
  215. }
  216. void shallowHistoryIface_raise_event2(ShallowHistory* handle)
  217. {
  218. handle->iface.event2_raised = bool_true;
  219. }
  220. void shallowHistoryIface_raise_event3(ShallowHistory* handle)
  221. {
  222. handle->iface.event3_raised = bool_true;
  223. }
  224. void shallowHistoryIface_raise_event4(ShallowHistory* handle)
  225. {
  226. handle->iface.event4_raised = bool_true;
  227. }
  228. void shallowHistoryIface_raise_event5(ShallowHistory* handle)
  229. {
  230. handle->iface.event5_raised = bool_true;
  231. }
  232. void shallowHistoryIface_raise_event6(ShallowHistory* handle)
  233. {
  234. handle->iface.event6_raised = bool_true;
  235. }
  236. void shallowHistoryIface_raise_event7(ShallowHistory* handle)
  237. {
  238. handle->iface.event7_raised = bool_true;
  239. }
  240. void shallowHistoryIface_raise_event8(ShallowHistory* handle)
  241. {
  242. handle->iface.event8_raised = bool_true;
  243. }
  244. /* implementations of all internal functions */
  245. static sc_boolean shallowHistory_check_mainRegion_State1_tr0_tr0(const ShallowHistory* handle)
  246. {
  247. return handle->iface.event1_raised;
  248. }
  249. static sc_boolean shallowHistory_check_mainRegion_State2_tr0_tr0(const ShallowHistory* handle)
  250. {
  251. return handle->iface.event2_raised;
  252. }
  253. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State3_tr0_tr0(const ShallowHistory* handle)
  254. {
  255. return handle->iface.event3_raised;
  256. }
  257. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4_tr0_tr0(const ShallowHistory* handle)
  258. {
  259. return handle->iface.event4_raised;
  260. }
  261. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(const ShallowHistory* handle)
  262. {
  263. return handle->iface.event5_raised;
  264. }
  265. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(const ShallowHistory* handle)
  266. {
  267. return handle->iface.event6_raised;
  268. }
  269. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(const ShallowHistory* handle)
  270. {
  271. return handle->iface.event7_raised;
  272. }
  273. static sc_boolean shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(const ShallowHistory* handle)
  274. {
  275. return handle->iface.event8_raised;
  276. }
  277. static void shallowHistory_effect_mainRegion_State1_tr0(ShallowHistory* handle)
  278. {
  279. shallowHistory_exseq_mainRegion_State1(handle);
  280. shallowHistory_enseq_mainRegion_State2_default(handle);
  281. }
  282. static void shallowHistory_effect_mainRegion_State2_tr0(ShallowHistory* handle)
  283. {
  284. shallowHistory_exseq_mainRegion_State2(handle);
  285. shallowHistory_enseq_mainRegion_State1_default(handle);
  286. }
  287. static void shallowHistory_effect_mainRegion_State2__region0_State3_tr0(ShallowHistory* handle)
  288. {
  289. shallowHistory_exseq_mainRegion_State2__region0_State3(handle);
  290. shallowHistory_enseq_mainRegion_State2__region0_State4_default(handle);
  291. }
  292. static void shallowHistory_effect_mainRegion_State2__region0_State4_tr0(ShallowHistory* handle)
  293. {
  294. shallowHistory_exseq_mainRegion_State2__region0_State4(handle);
  295. shallowHistory_enseq_mainRegion_State2__region0_State5_default(handle);
  296. }
  297. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(ShallowHistory* handle)
  298. {
  299. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  300. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(handle);
  301. }
  302. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(ShallowHistory* handle)
  303. {
  304. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7(handle);
  305. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(handle);
  306. }
  307. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(ShallowHistory* handle)
  308. {
  309. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  310. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(handle);
  311. }
  312. static void shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(ShallowHistory* handle)
  313. {
  314. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  315. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  316. }
  317. /* 'default' enter sequence for state State1 */
  318. static void shallowHistory_enseq_mainRegion_State1_default(ShallowHistory* handle)
  319. {
  320. /* 'default' enter sequence for state State1 */
  321. handle->stateConfVector[0] = ShallowHistory_mainRegion_State1;
  322. handle->stateConfVectorPosition = 0;
  323. }
  324. /* 'default' enter sequence for state State2 */
  325. static void shallowHistory_enseq_mainRegion_State2_default(ShallowHistory* handle)
  326. {
  327. /* 'default' enter sequence for state State2 */
  328. shallowHistory_enseq_mainRegion_State2__region0_default(handle);
  329. }
  330. /* 'default' enter sequence for state State3 */
  331. static void shallowHistory_enseq_mainRegion_State2__region0_State3_default(ShallowHistory* handle)
  332. {
  333. /* 'default' enter sequence for state State3 */
  334. handle->stateConfVector[0] = ShallowHistory_mainRegion_State2__region0_State3;
  335. handle->stateConfVectorPosition = 0;
  336. handle->historyVector[0] = handle->stateConfVector[0];
  337. }
  338. /* 'default' enter sequence for state State4 */
  339. static void shallowHistory_enseq_mainRegion_State2__region0_State4_default(ShallowHistory* handle)
  340. {
  341. /* 'default' enter sequence for state State4 */
  342. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_default(handle);
  343. handle->historyVector[0] = handle->stateConfVector[0];
  344. }
  345. /* 'default' enter sequence for state State6 */
  346. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(ShallowHistory* handle)
  347. {
  348. /* 'default' enter sequence for state State6 */
  349. handle->stateConfVector[0] = ShallowHistory_mainRegion_State2__region0_State4__region0_State6;
  350. handle->stateConfVectorPosition = 0;
  351. }
  352. /* 'default' enter sequence for state State7 */
  353. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(ShallowHistory* handle)
  354. {
  355. /* 'default' enter sequence for state State7 */
  356. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(handle);
  357. }
  358. /* 'default' enter sequence for state State8 */
  359. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(ShallowHistory* handle)
  360. {
  361. /* 'default' enter sequence for state State8 */
  362. handle->stateConfVector[0] = ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8;
  363. handle->stateConfVectorPosition = 0;
  364. handle->historyVector[1] = handle->stateConfVector[0];
  365. }
  366. /* 'default' enter sequence for state State9 */
  367. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(ShallowHistory* handle)
  368. {
  369. /* 'default' enter sequence for state State9 */
  370. handle->stateConfVector[0] = ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9;
  371. handle->stateConfVectorPosition = 0;
  372. handle->historyVector[1] = handle->stateConfVector[0];
  373. }
  374. /* 'default' enter sequence for state State5 */
  375. static void shallowHistory_enseq_mainRegion_State2__region0_State5_default(ShallowHistory* handle)
  376. {
  377. /* 'default' enter sequence for state State5 */
  378. handle->stateConfVector[0] = ShallowHistory_mainRegion_State2__region0_State5;
  379. handle->stateConfVectorPosition = 0;
  380. handle->historyVector[0] = handle->stateConfVector[0];
  381. }
  382. /* 'default' enter sequence for region mainRegion */
  383. static void shallowHistory_enseq_mainRegion_default(ShallowHistory* handle)
  384. {
  385. /* 'default' enter sequence for region mainRegion */
  386. shallowHistory_react_mainRegion__entry_Default(handle);
  387. }
  388. /* 'default' enter sequence for region null */
  389. static void shallowHistory_enseq_mainRegion_State2__region0_default(ShallowHistory* handle)
  390. {
  391. /* 'default' enter sequence for region null */
  392. shallowHistory_react_mainRegion_State2__region0__entry_Default(handle);
  393. }
  394. /* shallow enterSequence with history in child null */
  395. static void shallowHistory_shenseq_mainRegion_State2__region0(ShallowHistory* handle)
  396. {
  397. /* shallow enterSequence with history in child null */
  398. /* Handle shallow history entry of null */
  399. switch(handle->historyVector[ 0 ])
  400. {
  401. case ShallowHistory_mainRegion_State2__region0_State3 :
  402. {
  403. shallowHistory_enseq_mainRegion_State2__region0_State3_default(handle);
  404. break;
  405. }
  406. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  407. {
  408. shallowHistory_enseq_mainRegion_State2__region0_State4_default(handle);
  409. break;
  410. }
  411. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  412. {
  413. shallowHistory_enseq_mainRegion_State2__region0_State4_default(handle);
  414. break;
  415. }
  416. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  417. {
  418. shallowHistory_enseq_mainRegion_State2__region0_State4_default(handle);
  419. break;
  420. }
  421. case ShallowHistory_mainRegion_State2__region0_State5 :
  422. {
  423. shallowHistory_enseq_mainRegion_State2__region0_State5_default(handle);
  424. break;
  425. }
  426. default: break;
  427. }
  428. }
  429. /* 'default' enter sequence for region null */
  430. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_default(ShallowHistory* handle)
  431. {
  432. /* 'default' enter sequence for region null */
  433. shallowHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(handle);
  434. }
  435. /* 'default' enter sequence for region null */
  436. static void shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(ShallowHistory* handle)
  437. {
  438. /* 'default' enter sequence for region null */
  439. shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(handle);
  440. }
  441. /* shallow enterSequence with history in child null */
  442. static void shallowHistory_shenseq_mainRegion_State2__region0_State4__region0_State7__region0(ShallowHistory* handle)
  443. {
  444. /* shallow enterSequence with history in child null */
  445. /* Handle shallow history entry of null */
  446. switch(handle->historyVector[ 1 ])
  447. {
  448. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  449. {
  450. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  451. break;
  452. }
  453. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  454. {
  455. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(handle);
  456. break;
  457. }
  458. default: break;
  459. }
  460. }
  461. /* Default exit sequence for state State1 */
  462. static void shallowHistory_exseq_mainRegion_State1(ShallowHistory* handle)
  463. {
  464. /* Default exit sequence for state State1 */
  465. handle->stateConfVector[0] = ShallowHistory_last_state;
  466. handle->stateConfVectorPosition = 0;
  467. }
  468. /* Default exit sequence for state State2 */
  469. static void shallowHistory_exseq_mainRegion_State2(ShallowHistory* handle)
  470. {
  471. /* Default exit sequence for state State2 */
  472. shallowHistory_exseq_mainRegion_State2__region0(handle);
  473. }
  474. /* Default exit sequence for state State3 */
  475. static void shallowHistory_exseq_mainRegion_State2__region0_State3(ShallowHistory* handle)
  476. {
  477. /* Default exit sequence for state State3 */
  478. handle->stateConfVector[0] = ShallowHistory_last_state;
  479. handle->stateConfVectorPosition = 0;
  480. }
  481. /* Default exit sequence for state State4 */
  482. static void shallowHistory_exseq_mainRegion_State2__region0_State4(ShallowHistory* handle)
  483. {
  484. /* Default exit sequence for state State4 */
  485. shallowHistory_exseq_mainRegion_State2__region0_State4__region0(handle);
  486. }
  487. /* Default exit sequence for state State6 */
  488. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(ShallowHistory* handle)
  489. {
  490. /* Default exit sequence for state State6 */
  491. handle->stateConfVector[0] = ShallowHistory_last_state;
  492. handle->stateConfVectorPosition = 0;
  493. }
  494. /* Default exit sequence for state State7 */
  495. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7(ShallowHistory* handle)
  496. {
  497. /* Default exit sequence for state State7 */
  498. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(handle);
  499. }
  500. /* Default exit sequence for state State8 */
  501. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(ShallowHistory* handle)
  502. {
  503. /* Default exit sequence for state State8 */
  504. handle->stateConfVector[0] = ShallowHistory_last_state;
  505. handle->stateConfVectorPosition = 0;
  506. }
  507. /* Default exit sequence for state State9 */
  508. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(ShallowHistory* handle)
  509. {
  510. /* Default exit sequence for state State9 */
  511. handle->stateConfVector[0] = ShallowHistory_last_state;
  512. handle->stateConfVectorPosition = 0;
  513. }
  514. /* Default exit sequence for state State5 */
  515. static void shallowHistory_exseq_mainRegion_State2__region0_State5(ShallowHistory* handle)
  516. {
  517. /* Default exit sequence for state State5 */
  518. handle->stateConfVector[0] = ShallowHistory_last_state;
  519. handle->stateConfVectorPosition = 0;
  520. }
  521. /* Default exit sequence for region mainRegion */
  522. static void shallowHistory_exseq_mainRegion(ShallowHistory* handle)
  523. {
  524. /* Default exit sequence for region mainRegion */
  525. /* Handle exit of all possible states (of ShallowHistory.mainRegion) at position 0... */
  526. switch(handle->stateConfVector[ 0 ])
  527. {
  528. case ShallowHistory_mainRegion_State1 :
  529. {
  530. shallowHistory_exseq_mainRegion_State1(handle);
  531. break;
  532. }
  533. case ShallowHistory_mainRegion_State2__region0_State3 :
  534. {
  535. shallowHistory_exseq_mainRegion_State2__region0_State3(handle);
  536. break;
  537. }
  538. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  539. {
  540. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  541. break;
  542. }
  543. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  544. {
  545. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  546. break;
  547. }
  548. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  549. {
  550. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  551. break;
  552. }
  553. case ShallowHistory_mainRegion_State2__region0_State5 :
  554. {
  555. shallowHistory_exseq_mainRegion_State2__region0_State5(handle);
  556. break;
  557. }
  558. default: break;
  559. }
  560. }
  561. /* Default exit sequence for region null */
  562. static void shallowHistory_exseq_mainRegion_State2__region0(ShallowHistory* handle)
  563. {
  564. /* Default exit sequence for region null */
  565. /* Handle exit of all possible states (of ShallowHistory.mainRegion.State2._region0) at position 0... */
  566. switch(handle->stateConfVector[ 0 ])
  567. {
  568. case ShallowHistory_mainRegion_State2__region0_State3 :
  569. {
  570. shallowHistory_exseq_mainRegion_State2__region0_State3(handle);
  571. break;
  572. }
  573. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  574. {
  575. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  576. break;
  577. }
  578. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  579. {
  580. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  581. break;
  582. }
  583. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  584. {
  585. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  586. break;
  587. }
  588. case ShallowHistory_mainRegion_State2__region0_State5 :
  589. {
  590. shallowHistory_exseq_mainRegion_State2__region0_State5(handle);
  591. break;
  592. }
  593. default: break;
  594. }
  595. }
  596. /* Default exit sequence for region null */
  597. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0(ShallowHistory* handle)
  598. {
  599. /* Default exit sequence for region null */
  600. /* Handle exit of all possible states (of ShallowHistory.mainRegion.State2._region0.State4._region0) at position 0... */
  601. switch(handle->stateConfVector[ 0 ])
  602. {
  603. case ShallowHistory_mainRegion_State2__region0_State4__region0_State6 :
  604. {
  605. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  606. break;
  607. }
  608. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  609. {
  610. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  611. break;
  612. }
  613. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  614. {
  615. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  616. break;
  617. }
  618. default: break;
  619. }
  620. }
  621. /* Default exit sequence for region null */
  622. static void shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(ShallowHistory* handle)
  623. {
  624. /* Default exit sequence for region null */
  625. /* Handle exit of all possible states (of ShallowHistory.mainRegion.State2._region0.State4._region0.State7._region0) at position 0... */
  626. switch(handle->stateConfVector[ 0 ])
  627. {
  628. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  629. {
  630. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  631. break;
  632. }
  633. case ShallowHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  634. {
  635. shallowHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  636. break;
  637. }
  638. default: break;
  639. }
  640. }
  641. /* The reactions of state State1. */
  642. static void shallowHistory_react_mainRegion_State1(ShallowHistory* handle)
  643. {
  644. /* The reactions of state State1. */
  645. if (shallowHistory_check_mainRegion_State1_tr0_tr0(handle) == bool_true)
  646. {
  647. shallowHistory_effect_mainRegion_State1_tr0(handle);
  648. }
  649. }
  650. /* The reactions of state State3. */
  651. static void shallowHistory_react_mainRegion_State2__region0_State3(ShallowHistory* handle)
  652. {
  653. /* The reactions of state State3. */
  654. if (shallowHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  655. {
  656. shallowHistory_effect_mainRegion_State2_tr0(handle);
  657. } else
  658. {
  659. if (shallowHistory_check_mainRegion_State2__region0_State3_tr0_tr0(handle) == bool_true)
  660. {
  661. shallowHistory_effect_mainRegion_State2__region0_State3_tr0(handle);
  662. }
  663. }
  664. }
  665. /* The reactions of state State6. */
  666. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State6(ShallowHistory* handle)
  667. {
  668. /* The reactions of state State6. */
  669. if (shallowHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  670. {
  671. shallowHistory_effect_mainRegion_State2_tr0(handle);
  672. } else
  673. {
  674. if (shallowHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  675. {
  676. shallowHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  677. } else
  678. {
  679. if (shallowHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(handle) == bool_true)
  680. {
  681. shallowHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(handle);
  682. }
  683. }
  684. }
  685. }
  686. /* The reactions of state State8. */
  687. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(ShallowHistory* handle)
  688. {
  689. /* The reactions of state State8. */
  690. if (shallowHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  691. {
  692. shallowHistory_effect_mainRegion_State2_tr0(handle);
  693. } else
  694. {
  695. if (shallowHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  696. {
  697. shallowHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  698. } else
  699. {
  700. if (shallowHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(handle) == bool_true)
  701. {
  702. shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(handle);
  703. } else
  704. {
  705. if (shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(handle) == bool_true)
  706. {
  707. shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(handle);
  708. }
  709. }
  710. }
  711. }
  712. }
  713. /* The reactions of state State9. */
  714. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(ShallowHistory* handle)
  715. {
  716. /* The reactions of state State9. */
  717. if (shallowHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  718. {
  719. shallowHistory_effect_mainRegion_State2_tr0(handle);
  720. } else
  721. {
  722. if (shallowHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  723. {
  724. shallowHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  725. } else
  726. {
  727. if (shallowHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(handle) == bool_true)
  728. {
  729. shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(handle);
  730. } else
  731. {
  732. if (shallowHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(handle) == bool_true)
  733. {
  734. shallowHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(handle);
  735. }
  736. }
  737. }
  738. }
  739. }
  740. /* The reactions of state State5. */
  741. static void shallowHistory_react_mainRegion_State2__region0_State5(ShallowHistory* handle)
  742. {
  743. /* The reactions of state State5. */
  744. if (shallowHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  745. {
  746. shallowHistory_effect_mainRegion_State2_tr0(handle);
  747. } else
  748. {
  749. }
  750. }
  751. /* Default react sequence for initial entry */
  752. static void shallowHistory_react_mainRegion__entry_Default(ShallowHistory* handle)
  753. {
  754. /* Default react sequence for initial entry */
  755. shallowHistory_enseq_mainRegion_State1_default(handle);
  756. }
  757. /* Default react sequence for shallow history entry */
  758. static void shallowHistory_react_mainRegion_State2__region0__entry_Default(ShallowHistory* handle)
  759. {
  760. /* Default react sequence for shallow history entry */
  761. /* Enter the region with shallow history */
  762. if (handle->historyVector[0] != ShallowHistory_last_state)
  763. {
  764. shallowHistory_shenseq_mainRegion_State2__region0(handle);
  765. } else
  766. {
  767. shallowHistory_enseq_mainRegion_State2__region0_State3_default(handle);
  768. }
  769. }
  770. /* Default react sequence for initial entry */
  771. static void shallowHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(ShallowHistory* handle)
  772. {
  773. /* Default react sequence for initial entry */
  774. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(handle);
  775. }
  776. /* Default react sequence for shallow history entry */
  777. static void shallowHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(ShallowHistory* handle)
  778. {
  779. /* Default react sequence for shallow history entry */
  780. /* Enter the region with shallow history */
  781. if (handle->historyVector[1] != ShallowHistory_last_state)
  782. {
  783. shallowHistory_shenseq_mainRegion_State2__region0_State4__region0_State7__region0(handle);
  784. } else
  785. {
  786. shallowHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  787. }
  788. }