Pārlūkot izejas kodu

deleted target files

Simon Van Mierlo 9 gadi atpakaļ
vecāks
revīzija
977163eefa
100 mainītis faili ar 164 papildinājumiem un 20270 dzēšanām
  1. 1 1
      .gitignore
  2. 0 427
      examples/HTTP_client/client.py
  3. 0 608
      examples/HTTP_server/server.py
  4. 0 818
      examples/bouncingballs/js/target_js/target.js
  5. 20 0
      examples/bouncingballs/python/runner_performance_cpu_time.py
  6. 143 0
      examples/bouncingballs/python/sccd_performance_cpu_time.xml
  7. 0 0
      examples/bouncingballs/python/target_py/__init__.py
  8. 0 718
      examples/bouncingballs/python/target_py/target.py
  9. 0 774
      examples/bouncingballs/python/target_py/target_performance.py
  10. 0 355
      examples/bouncingballs/python/target_py/target_performance_threads.py
  11. 0 1734
      examples/tanks/ai_controller.py
  12. 0 515
      examples/tanks/player_controller.py
  13. 0 0
      examples/timer-parallel/python/target_py/__init__.py
  14. 0 181
      examples/timer-parallel/python/target_py/target.py
  15. 0 0
      examples/timer-threads/python/target_py/__init__.py
  16. 0 128
      examples/timer-threads/python/target_py/target.py
  17. 0 190
      examples/timer/js/target_js/target.js
  18. 0 0
      examples/timer/python/target_py/__init__.py
  19. 0 137
      examples/timer/python/target_py/target.py
  20. 0 393
      examples/trafficlights/js/target_js/target.js
  21. 0 0
      examples/trafficlights/python/target_py/__init__.py
  22. 0 322
      examples/trafficlights/python/target_py/target.py
  23. 0 0
      examples/train/python/target_py/__init__.py
  24. 0 477
      examples/train/python/target_py/target.py
  25. 0 162
      test/target_js/big_step_maximality/00_take_one.js
  26. 0 162
      test/target_js/big_step_maximality/01_take_many.js
  27. 0 213
      test/target_js/big_step_maximality/10_orthogonal_take_one.js
  28. 0 213
      test/target_js/big_step_maximality/11_orthogonal_take_many.js
  29. 0 167
      test/target_js/event_lifeline/00_take_one_next_small_step.js
  30. 0 167
      test/target_js/event_lifeline/02_take_one_queue.js
  31. 0 167
      test/target_js/event_lifeline/10_take_many_next_small_step.js
  32. 0 167
      test/target_js/event_lifeline/11_take_many_next_combo_step.js
  33. 0 167
      test/target_js/event_lifeline/12_take_many_queue.js
  34. 0 216
      test/target_js/event_lifeline/20_orthogonal_take_one_next_small_step.js
  35. 0 214
      test/target_js/event_lifeline/21_orthogonal_take_one_queue.js
  36. 0 218
      test/target_js/event_lifeline/30_orthogonal_take_many_next_small_step.js
  37. 0 213
      test/target_js/event_lifeline/31_orthogonal_take_many_next_combo_step.js
  38. 0 214
      test/target_js/event_lifeline/32_orthogonal_take_many_queue.js
  39. 0 210
      test/target_js/no_statechart/00_no_statechart_js.js
  40. 0 172
      test/target_js/original_semantics/after.js
  41. 0 244
      test/target_js/original_semantics/after_0.js
  42. 0 227
      test/target_js/original_semantics/associate_event.js
  43. 0 149
      test/target_js/original_semantics/correct_duplicate_state_id.js
  44. 0 241
      test/target_js/original_semantics/enter_exit_hierarchy.js
  45. 0 172
      test/target_js/original_semantics/guard.js
  46. 0 176
      test/target_js/original_semantics/history.js
  47. 0 275
      test/target_js/original_semantics/history_deep.js
  48. 0 274
      test/target_js/original_semantics/history_parallel_deep.js
  49. 0 162
      test/target_js/original_semantics/inner_first.js
  50. 0 216
      test/target_js/original_semantics/instate.js
  51. 0 189
      test/target_js/original_semantics/multiple_target.js
  52. 0 225
      test/target_js/original_semantics/object_manager.js
  53. 0 162
      test/target_js/original_semantics/outer_first.js
  54. 0 195
      test/target_js/original_semantics/parallel.js
  55. 0 241
      test/target_js/original_semantics/parallel_history.js
  56. 0 246
      test/target_js/original_semantics/parallel_history_2.js
  57. 0 246
      test/target_js/original_semantics/parallel_history_3.js
  58. 0 172
      test/target_js/priority/00_source_parent.js
  59. 0 172
      test/target_js/priority/01_source_child.js
  60. 0 161
      test/target_js/priority/10_source_parent_history.js
  61. 0 161
      test/target_js/priority/11_source_child_history.js
  62. 0 159
      test/target_js/timing/00_rapid_js.js
  63. 0 0
      test/target_py/__init__.py
  64. 0 120
      test/target_py/big_step_maximality/00_take_one.py
  65. 0 120
      test/target_py/big_step_maximality/01_take_many.py
  66. 0 168
      test/target_py/big_step_maximality/10_orthogonal_take_one.py
  67. 0 168
      test/target_py/big_step_maximality/11_orthogonal_take_many.py
  68. 0 0
      test/target_py/big_step_maximality/__init__.py
  69. 0 124
      test/target_py/event_lifeline/00_take_one_next_small_step.py
  70. 0 124
      test/target_py/event_lifeline/02_take_one_queue.py
  71. 0 124
      test/target_py/event_lifeline/10_take_many_next_small_step.py
  72. 0 124
      test/target_py/event_lifeline/11_take_many_next_combo_step.py
  73. 0 124
      test/target_py/event_lifeline/12_take_many_queue.py
  74. 0 170
      test/target_py/event_lifeline/20_orthogonal_take_one_next_small_step.py
  75. 0 168
      test/target_py/event_lifeline/21_orthogonal_take_one_queue.py
  76. 0 172
      test/target_py/event_lifeline/30_orthogonal_take_many_next_small_step.py
  77. 0 167
      test/target_py/event_lifeline/31_orthogonal_take_many_next_combo_step.py
  78. 0 168
      test/target_py/event_lifeline/32_orthogonal_take_many_queue.py
  79. 0 0
      test/target_py/event_lifeline/__init__.py
  80. 0 158
      test/target_py/no_statechart/00_no_statechart_py.py
  81. 0 0
      test/target_py/no_statechart/__init__.py
  82. 0 0
      test/target_py/original_semantics/__init__.py
  83. 0 129
      test/target_py/original_semantics/after.py
  84. 0 187
      test/target_py/original_semantics/after_0.py
  85. 0 173
      test/target_py/original_semantics/associate_event.py
  86. 0 110
      test/target_py/original_semantics/correct_duplicate_state_id.py
  87. 0 190
      test/target_py/original_semantics/enter_exit_hierarchy.py
  88. 0 129
      test/target_py/original_semantics/guard.py
  89. 0 134
      test/target_py/original_semantics/history.py
  90. 0 229
      test/target_py/original_semantics/history_deep.py
  91. 0 228
      test/target_py/original_semantics/history_parallel_deep.py
  92. 0 121
      test/target_py/original_semantics/inner_first.py
  93. 0 171
      test/target_py/original_semantics/instate.py
  94. 0 145
      test/target_py/original_semantics/multiple_target.py
  95. 0 171
      test/target_py/original_semantics/object_manager.py
  96. 0 121
      test/target_py/original_semantics/outer_first.py
  97. 0 152
      test/target_py/original_semantics/parallel.py
  98. 0 196
      test/target_py/original_semantics/parallel_history.py
  99. 0 200
      test/target_py/original_semantics/parallel_history_2.py
  100. 0 0
      test/target_py/original_semantics/parallel_history_3.py

+ 1 - 1
.gitignore

@@ -8,4 +8,4 @@ RemoteSystemsTempFiles
 csharp_tests/test-results
 csharp_tests/bin
 src/build
-
+**/*target*

+ 0 - 427
examples/HTTP_client/client.py

@@ -1,427 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:35 2016
-
-Model author: Yentl Van Tendeloo
-Model name:   HTTP client
-Model description:
-HTTP client in SCCD
-"""
-
-from sccd.runtime.statecharts_core import *
-import time
-import os
-import urllib
-import sys
-import json
-
-# package "HTTP client"
-
-class Prompt(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Prompt.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.counter = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /init
-        self.states["/init"] = State(1, self)
-        self.states["/init"].setEnter(self._init_enter)
-        
-        # state /initializing
-        self.states["/initializing"] = State(2, self)
-        self.states["/initializing"].setEnter(self._initializing_enter)
-        self.states["/initializing"].setExit(self._initializing_exit)
-        
-        # state /send_request
-        self.states["/send_request"] = State(3, self)
-        self.states["/send_request"].setEnter(self._send_request_enter)
-        self.states["/send_request"].setExit(self._send_request_exit)
-        
-        # state /wait_reply
-        self.states["/wait_reply"] = State(4, self)
-        self.states["/wait_reply"].setEnter(self._wait_reply_enter)
-        self.states["/wait_reply"].setExit(self._wait_reply_exit)
-        
-        # add children
-        self.states[""].addChild(self.states["/init"])
-        self.states[""].addChild(self.states["/initializing"])
-        self.states[""].addChild(self.states["/send_request"])
-        self.states[""].addChild(self.states["/wait_reply"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/init"]
-        
-        # transition /init
-        _init_0 = Transition(self, self.states["/init"], [self.states["/initializing"]])
-        _init_0.setAction(self._init_0_exec)
-        _init_0.setTrigger(Event("instance_created", None))
-        self.states["/init"].addTransition(_init_0)
-        
-        # transition /initializing
-        _initializing_0 = Transition(self, self.states["/initializing"], [self.states["/initializing"]])
-        _initializing_0.setTrigger(Event("_0after"))
-        self.states["/initializing"].addTransition(_initializing_0)
-        _initializing_1 = Transition(self, self.states["/initializing"], [self.states["/send_request"]])
-        _initializing_1.setTrigger(Event("http_client_ready", None))
-        self.states["/initializing"].addTransition(_initializing_1)
-        
-        # transition /send_request
-        _send_request_0 = Transition(self, self.states["/send_request"], [self.states["/wait_reply"]])
-        _send_request_0.setAction(self._send_request_0_exec)
-        _send_request_0.setTrigger(Event("_1after"))
-        self.states["/send_request"].addTransition(_send_request_0)
-        
-        # transition /wait_reply
-        _wait_reply_0 = Transition(self, self.states["/wait_reply"], [self.states["/wait_reply"]])
-        _wait_reply_0.setTrigger(Event("_2after"))
-        self.states["/wait_reply"].addTransition(_wait_reply_0)
-        _wait_reply_1 = Transition(self, self.states["/wait_reply"], [self.states["/send_request"]])
-        _wait_reply_1.setAction(self._wait_reply_1_exec)
-        _wait_reply_1.setTrigger(Event("HTTP_output", None))
-        self.states["/wait_reply"].addTransition(_wait_reply_1)
-    
-    def _init_enter(self):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'to_server', 'HTTPClient', '127.0.0.1', 8080]))
-    
-    def _initializing_enter(self):
-        self.addTimer(0, 1.0)
-    
-    def _initializing_exit(self):
-        self.removeTimer(0)
-    
-    def _send_request_enter(self):
-        self.addTimer(1, 1)
-    
-    def _send_request_exit(self):
-        self.removeTimer(1)
-    
-    def _wait_reply_enter(self):
-        self.addTimer(2, 1.0)
-    
-    def _wait_reply_exit(self):
-        self.removeTimer(2)
-    
-    def _init_0_exec(self, parameters):
-        instancename = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, instancename]))
-    
-    def _send_request_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'to_server', Event("HTTP_input", None, [str(self.counter), 'parent'])]))
-        print("Sending request: %s" % self.counter)
-        self.counter += 1
-    
-    def _wait_reply_1_exec(self, parameters):
-        data = parameters[0]
-        print("Got response: %s" % data)
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/init"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class HTTPClient(RuntimeClassBase):
-    def __init__(self, controller, hostname, port):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        HTTPClient.user_defined_constructor(self, hostname, port)
-    
-    def user_defined_constructor(self, hostname, port):
-        self.socket = None
-        self.destination = (hostname, port)
-        self.received_data = ""
-        self.send_data = ""
-        self.queue = []
-        self.destinations = []
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /init
-        self.states["/init"] = State(1, self)
-        self.states["/init"].setEnter(self._init_enter)
-        
-        # state /connecting
-        self.states["/connecting"] = State(2, self)
-        self.states["/connecting"].setEnter(self._connecting_enter)
-        
-        # state /connected
-        self.states["/connected"] = ParallelState(3, self)
-        
-        # state /connected/listening
-        self.states["/connected/listening"] = State(4, self)
-        
-        # state /connected/listening/listen
-        self.states["/connected/listening/listen"] = State(5, self)
-        self.states["/connected/listening/listen"].setEnter(self._connected_listening_listen_enter)
-        
-        # state /connected/listening/close
-        self.states["/connected/listening/close"] = State(6, self)
-        
-        # state /connected/sending
-        self.states["/connected/sending"] = State(7, self)
-        
-        # state /connected/sending/waiting_for_data
-        self.states["/connected/sending/waiting_for_data"] = State(8, self)
-        
-        # state /connected/sending/transferring
-        self.states["/connected/sending/transferring"] = State(9, self)
-        
-        # state /connected/queueing
-        self.states["/connected/queueing"] = State(10, self)
-        
-        # state /connected/queueing/queueing
-        self.states["/connected/queueing/queueing"] = State(11, self)
-        self.states["/connected/queueing/queueing"].setEnter(self._connected_queueing_queueing_enter)
-        
-        # state /connected/parsing
-        self.states["/connected/parsing"] = State(12, self)
-        
-        # state /connected/parsing/wait_for_header
-        self.states["/connected/parsing/wait_for_header"] = State(13, self)
-        
-        # state /connected/parsing/wait_for_payload
-        self.states["/connected/parsing/wait_for_payload"] = State(14, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/init"])
-        self.states[""].addChild(self.states["/connecting"])
-        self.states[""].addChild(self.states["/connected"])
-        self.states["/connected"].addChild(self.states["/connected/listening"])
-        self.states["/connected"].addChild(self.states["/connected/sending"])
-        self.states["/connected"].addChild(self.states["/connected/queueing"])
-        self.states["/connected"].addChild(self.states["/connected/parsing"])
-        self.states["/connected/listening"].addChild(self.states["/connected/listening/listen"])
-        self.states["/connected/listening"].addChild(self.states["/connected/listening/close"])
-        self.states["/connected/sending"].addChild(self.states["/connected/sending/waiting_for_data"])
-        self.states["/connected/sending"].addChild(self.states["/connected/sending/transferring"])
-        self.states["/connected/queueing"].addChild(self.states["/connected/queueing/queueing"])
-        self.states["/connected/parsing"].addChild(self.states["/connected/parsing/wait_for_header"])
-        self.states["/connected/parsing"].addChild(self.states["/connected/parsing/wait_for_payload"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/init"]
-        self.states["/connected/listening"].default_state = self.states["/connected/listening/listen"]
-        self.states["/connected/sending"].default_state = self.states["/connected/sending/waiting_for_data"]
-        self.states["/connected/queueing"].default_state = self.states["/connected/queueing/queueing"]
-        self.states["/connected/parsing"].default_state = self.states["/connected/parsing/wait_for_header"]
-        
-        # transition /init
-        _init_0 = Transition(self, self.states["/init"], [self.states["/connecting"]])
-        _init_0.setAction(self._init_0_exec)
-        _init_0.setTrigger(Event("created_socket", "socket_in"))
-        self.states["/init"].addTransition(_init_0)
-        
-        # transition /connecting
-        _connecting_0 = Transition(self, self.states["/connecting"], [self.states["/connected"]])
-        _connecting_0.setAction(self._connecting_0_exec)
-        _connecting_0.setTrigger(Event("connected_socket", "socket_in"))
-        _connecting_0.setGuard(self._connecting_0_guard)
-        self.states["/connecting"].addTransition(_connecting_0)
-        
-        # transition /connected/listening/listen
-        _connected_listening_listen_0 = Transition(self, self.states["/connected/listening/listen"], [self.states["/connected/listening/listen"]])
-        _connected_listening_listen_0.setAction(self._connected_listening_listen_0_exec)
-        _connected_listening_listen_0.setTrigger(Event("received_socket", "socket_in"))
-        _connected_listening_listen_0.setGuard(self._connected_listening_listen_0_guard)
-        self.states["/connected/listening/listen"].addTransition(_connected_listening_listen_0)
-        _connected_listening_listen_1 = Transition(self, self.states["/connected/listening/listen"], [self.states["/connected/listening/close"]])
-        _connected_listening_listen_1.setTrigger(Event("received_socket", "socket_in"))
-        _connected_listening_listen_1.setGuard(self._connected_listening_listen_1_guard)
-        self.states["/connected/listening/listen"].addTransition(_connected_listening_listen_1)
-        
-        # transition /connected/sending/waiting_for_data
-        _connected_sending_waiting_for_data_0 = Transition(self, self.states["/connected/sending/waiting_for_data"], [self.states["/connected/sending/transferring"]])
-        _connected_sending_waiting_for_data_0.setAction(self._connected_sending_waiting_for_data_0_exec)
-        _connected_sending_waiting_for_data_0.setTrigger(None)
-        _connected_sending_waiting_for_data_0.setGuard(self._connected_sending_waiting_for_data_0_guard)
-        self.states["/connected/sending/waiting_for_data"].addTransition(_connected_sending_waiting_for_data_0)
-        
-        # transition /connected/sending/transferring
-        _connected_sending_transferring_0 = Transition(self, self.states["/connected/sending/transferring"], [self.states["/connected/sending/waiting_for_data"]])
-        _connected_sending_transferring_0.setAction(self._connected_sending_transferring_0_exec)
-        _connected_sending_transferring_0.setTrigger(Event("sent_socket", "socket_in"))
-        _connected_sending_transferring_0.setGuard(self._connected_sending_transferring_0_guard)
-        self.states["/connected/sending/transferring"].addTransition(_connected_sending_transferring_0)
-        
-        # transition /connected/queueing/queueing
-        _connected_queueing_queueing_0 = Transition(self, self.states["/connected/queueing/queueing"], [self.states["/connected/queueing/queueing"]])
-        _connected_queueing_queueing_0.setAction(self._connected_queueing_queueing_0_exec)
-        _connected_queueing_queueing_0.setTrigger(Event("HTTP_input", None))
-        self.states["/connected/queueing/queueing"].addTransition(_connected_queueing_queueing_0)
-        
-        # transition /connected/parsing/wait_for_header
-        _connected_parsing_wait_for_header_0 = Transition(self, self.states["/connected/parsing/wait_for_header"], [self.states["/connected/parsing/wait_for_payload"]])
-        _connected_parsing_wait_for_header_0.setAction(self._connected_parsing_wait_for_header_0_exec)
-        _connected_parsing_wait_for_header_0.setTrigger(None)
-        _connected_parsing_wait_for_header_0.setGuard(self._connected_parsing_wait_for_header_0_guard)
-        self.states["/connected/parsing/wait_for_header"].addTransition(_connected_parsing_wait_for_header_0)
-        
-        # transition /connected/parsing/wait_for_payload
-        _connected_parsing_wait_for_payload_0 = Transition(self, self.states["/connected/parsing/wait_for_payload"], [self.states["/connected/parsing/wait_for_header"]])
-        _connected_parsing_wait_for_payload_0.setAction(self._connected_parsing_wait_for_payload_0_exec)
-        _connected_parsing_wait_for_payload_0.setTrigger(None)
-        _connected_parsing_wait_for_payload_0.setGuard(self._connected_parsing_wait_for_payload_0_guard)
-        self.states["/connected/parsing/wait_for_payload"].addTransition(_connected_parsing_wait_for_payload_0)
-    
-    def _init_enter(self):
-        self.big_step.outputEvent(Event("create_socket", "", []))
-    
-    def _connecting_enter(self):
-        self.big_step.outputEvent(Event("connect_socket", "", [self.socket, self.destination]))
-    
-    def _connected_listening_listen_enter(self):
-        self.big_step.outputEvent(Event("recv_socket", "socket_out", [self.socket]))
-    
-    def _connected_queueing_queueing_enter(self):
-        pass
-    
-    def _init_0_exec(self, parameters):
-        socket = parameters[0]
-        self.socket = socket
-    
-    def _connecting_0_exec(self, parameters):
-        socket = parameters[0]
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("http_client_ready", None, [])]))
-    
-    def _connecting_0_guard(self, parameters):
-        socket = parameters[0]
-        return self.socket == socket
-    
-    def _connected_listening_listen_0_exec(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        self.received_data += data
-    
-    def _connected_listening_listen_0_guard(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        return (self.socket == socket) and (len(data) > 0)
-    
-    def _connected_listening_listen_1_guard(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        return (self.socket == socket) and (len(data) == 0)
-    
-    def _connected_sending_waiting_for_data_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("send_socket", "socket_out", [self.socket, self.send_data]))
-    
-    def _connected_sending_waiting_for_data_0_guard(self, parameters):
-        return len(self.send_data) > 0
-    
-    def _connected_sending_transferring_0_exec(self, parameters):
-        socket = parameters[0]
-        sent_bytes = parameters[1]
-        self.send_data = self.send_data[sent_bytes:]
-    
-    def _connected_sending_transferring_0_guard(self, parameters):
-        socket = parameters[0]
-        sent_bytes = parameters[1]
-        return self.socket == socket
-    
-    def _connected_queueing_queueing_0_exec(self, parameters):
-        data = parameters[0]
-        destination = parameters[1]
-        self.send_data += "POST / HTTP/1.0\r\n"
-        self.send_data += "Content-Length: %i\r\n" % len(str(data))
-        self.send_data += "\r\n"
-        self.send_data += data
-        self.destinations.append(destination)
-    
-    def _connected_parsing_wait_for_header_0_exec(self, parameters):
-        header, self.received_data = self.received_data.split("\r\n\r\n", 1)
-        header = header.lower()
-        if "content-length" in header:
-            _, after = header.split("content-length:", 1)
-            after, _ = after.split("\r\n", 1)
-            after = after.strip()
-            self.length = int(after)
-        else:
-            self.length = float('inf')
-    
-    def _connected_parsing_wait_for_header_0_guard(self, parameters):
-        return '\r\n\r\n' in self.received_data
-    
-    def _connected_parsing_wait_for_payload_0_exec(self, parameters):
-        data = self.received_data[:self.length]
-        self.received_data = self.received_data[self.length:]
-        #params = dict([p.split('=') for p in data.split('&')])
-        #data = {k: urllib.unquote_plus(v) for k, v in params.iteritems()}
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.destinations.pop(0), Event("HTTP_output", None, [data])]))
-    
-    def _connected_parsing_wait_for_payload_0_guard(self, parameters):
-        return len(self.received_data) >= self.length
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/init"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Prompt":
-            instance = Prompt(self.controller)
-            instance.associations = {}
-            instance.associations["to_server"] = Association("HTTPClient", 1, 1)
-        elif class_name == "HTTPClient":
-            instance = HTTPClient(self.controller, construct_params[0], construct_params[1])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Prompt", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None):
-        if keep_running == None: keep_running = True
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running)
-        self.addInputPort("socket_in")
-        self.addOutputPort("socket_out")
-        self.object_manager.createInstance("Prompt", [])

+ 0 - 608
examples/HTTP_server/server.py

@@ -1,608 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:35 2016
-
-Model author: Yentl Van Tendeloo
-Model name:   HTTP Server
-Model description:
-Example HTTP echo server.
-"""
-
-from sccd.runtime.statecharts_core import *
-import time
-import os
-import urllib
-import sys
-import json
-
-import sys
-
-# package "HTTP Server"
-
-class Echo(RuntimeClassBase):
-    def __init__(self, controller, params):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Echo.user_defined_constructor(self, params)
-    
-    def user_defined_constructor(self, params):
-        self.source = None
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /init_server
-        self.states["/init_server"] = State(1, self)
-        self.states["/init_server"].setEnter(self._init_server_enter)
-        
-        # state /wait_for_requests
-        self.states["/wait_for_requests"] = State(2, self)
-        
-        # state /wait_for_requests/wait
-        self.states["/wait_for_requests/wait"] = State(3, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/init_server"])
-        self.states[""].addChild(self.states["/wait_for_requests"])
-        self.states["/wait_for_requests"].addChild(self.states["/wait_for_requests/wait"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/init_server"]
-        self.states["/wait_for_requests"].default_state = self.states["/wait_for_requests/wait"]
-        
-        # transition /init_server
-        _init_server_0 = Transition(self, self.states["/init_server"], [self.states["/wait_for_requests"]])
-        _init_server_0.setAction(self._init_server_0_exec)
-        _init_server_0.setTrigger(Event("instance_created", None))
-        self.states["/init_server"].addTransition(_init_server_0)
-        
-        # transition /wait_for_requests/wait
-        _wait_for_requests_wait_0 = Transition(self, self.states["/wait_for_requests/wait"], [self.states["/wait_for_requests/wait"]])
-        _wait_for_requests_wait_0.setAction(self._wait_for_requests_wait_0_exec)
-        _wait_for_requests_wait_0.setTrigger(Event("HTTP_output", None))
-        self.states["/wait_for_requests/wait"].addTransition(_wait_for_requests_wait_0)
-    
-    def _init_server_enter(self):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'to_server', 'Server', '', 8080]))
-    
-    def _init_server_0_exec(self, parameters):
-        instancename = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, instancename]))
-    
-    def _wait_for_requests_wait_0_exec(self, parameters):
-        source = parameters[0]
-        data = parameters[1]
-        print("Got input: " + str(data))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'to_server/%s' % source, Event("HTTP_input", None, [data])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/init_server"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class Server(RuntimeClassBase):
-    def __init__(self, controller, address, port):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Server.user_defined_constructor(self, address, port)
-    
-    def user_defined_constructor(self, address, port):
-        self.socket = None
-        self.address = address
-        self.port = port
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /main
-        self.states["/main"] = ParallelState(1, self)
-        
-        # state /main/forward
-        self.states["/main/forward"] = State(2, self)
-        
-        # state /main/forward/forward
-        self.states["/main/forward/forward"] = State(3, self)
-        
-        # state /main/server
-        self.states["/main/server"] = State(4, self)
-        
-        # state /main/server/init
-        self.states["/main/server/init"] = State(5, self)
-        self.states["/main/server/init"].setEnter(self._main_server_init_enter)
-        
-        # state /main/server/binding
-        self.states["/main/server/binding"] = State(6, self)
-        self.states["/main/server/binding"].setEnter(self._main_server_binding_enter)
-        
-        # state /main/server/listening
-        self.states["/main/server/listening"] = State(7, self)
-        self.states["/main/server/listening"].setEnter(self._main_server_listening_enter)
-        
-        # state /main/server/accepting
-        self.states["/main/server/accepting"] = State(8, self)
-        self.states["/main/server/accepting"].setEnter(self._main_server_accepting_enter)
-        self.states["/main/server/accepting"].setExit(self._main_server_accepting_exit)
-        
-        # state /main/close_socket
-        self.states["/main/close_socket"] = State(9, self)
-        
-        # state /main/close_socket/close
-        self.states["/main/close_socket/close"] = State(10, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/main"])
-        self.states["/main"].addChild(self.states["/main/forward"])
-        self.states["/main"].addChild(self.states["/main/server"])
-        self.states["/main"].addChild(self.states["/main/close_socket"])
-        self.states["/main/forward"].addChild(self.states["/main/forward/forward"])
-        self.states["/main/server"].addChild(self.states["/main/server/init"])
-        self.states["/main/server"].addChild(self.states["/main/server/binding"])
-        self.states["/main/server"].addChild(self.states["/main/server/listening"])
-        self.states["/main/server"].addChild(self.states["/main/server/accepting"])
-        self.states["/main/close_socket"].addChild(self.states["/main/close_socket/close"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/main"]
-        self.states["/main/forward"].default_state = self.states["/main/forward/forward"]
-        self.states["/main/server"].default_state = self.states["/main/server/init"]
-        self.states["/main/close_socket"].default_state = self.states["/main/close_socket/close"]
-        
-        # transition /main/forward/forward
-        _main_forward_forward_0 = Transition(self, self.states["/main/forward/forward"], [self.states["/main/forward/forward"]])
-        _main_forward_forward_0.setAction(self._main_forward_forward_0_exec)
-        _main_forward_forward_0.setTrigger(Event("HTTP_output", None))
-        self.states["/main/forward/forward"].addTransition(_main_forward_forward_0)
-        
-        # transition /main/server/init
-        _main_server_init_0 = Transition(self, self.states["/main/server/init"], [self.states["/main/server/binding"]])
-        _main_server_init_0.setAction(self._main_server_init_0_exec)
-        _main_server_init_0.setTrigger(Event("created_socket", "socket_in"))
-        self.states["/main/server/init"].addTransition(_main_server_init_0)
-        
-        # transition /main/server/binding
-        _main_server_binding_0 = Transition(self, self.states["/main/server/binding"], [self.states["/main/server/listening"]])
-        _main_server_binding_0.setTrigger(Event("bound_socket", "socket_in"))
-        _main_server_binding_0.setGuard(self._main_server_binding_0_guard)
-        self.states["/main/server/binding"].addTransition(_main_server_binding_0)
-        
-        # transition /main/server/listening
-        _main_server_listening_0 = Transition(self, self.states["/main/server/listening"], [self.states["/main/server/accepting"]])
-        _main_server_listening_0.setAction(self._main_server_listening_0_exec)
-        _main_server_listening_0.setTrigger(Event("listened_socket", "socket_in"))
-        _main_server_listening_0.setGuard(self._main_server_listening_0_guard)
-        self.states["/main/server/listening"].addTransition(_main_server_listening_0)
-        
-        # transition /main/server/accepting
-        _main_server_accepting_0 = Transition(self, self.states["/main/server/accepting"], [self.states["/main/server/accepting"]])
-        _main_server_accepting_0.setAction(self._main_server_accepting_0_exec)
-        _main_server_accepting_0.setTrigger(Event("accepted_socket", "socket_in"))
-        self.states["/main/server/accepting"].addTransition(_main_server_accepting_0)
-        _main_server_accepting_1 = Transition(self, self.states["/main/server/accepting"], [self.states["/main/server/accepting"]])
-        _main_server_accepting_1.setAction(self._main_server_accepting_1_exec)
-        _main_server_accepting_1.setTrigger(Event("instance_created", None))
-        self.states["/main/server/accepting"].addTransition(_main_server_accepting_1)
-        _main_server_accepting_2 = Transition(self, self.states["/main/server/accepting"], [self.states["/main/server/accepting"]])
-        _main_server_accepting_2.setTrigger(Event("_0after"))
-        self.states["/main/server/accepting"].addTransition(_main_server_accepting_2)
-        
-        # transition /main/close_socket/close
-        _main_close_socket_close_0 = Transition(self, self.states["/main/close_socket/close"], [self.states["/main/close_socket/close"]])
-        _main_close_socket_close_0.setAction(self._main_close_socket_close_0_exec)
-        _main_close_socket_close_0.setTrigger(Event("close_socket", None))
-        self.states["/main/close_socket/close"].addTransition(_main_close_socket_close_0)
-    
-    def _main_server_init_enter(self):
-        self.big_step.outputEvent(Event("create_socket", "socket_out", []))
-    
-    def _main_server_binding_enter(self):
-        self.big_step.outputEvent(Event("bind_socket", "socket_out", [self.socket, (self.address, self.port)]))
-    
-    def _main_server_listening_enter(self):
-        self.big_step.outputEvent(Event("listen_socket", "socket_out", [self.socket]))
-    
-    def _main_server_accepting_enter(self):
-        self.addTimer(0, 1.0)
-    
-    def _main_server_accepting_exit(self):
-        self.removeTimer(0)
-    
-    def _main_forward_forward_0_exec(self, parameters):
-        association_name = parameters[0]
-        data = parameters[1]
-        print("Forward")
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("HTTP_output", None, [association_name, data])]))
-    
-    def _main_server_init_0_exec(self, parameters):
-        socket = parameters[0]
-        self.socket = socket
-    
-    def _main_server_binding_0_guard(self, parameters):
-        socket = parameters[0]
-        return self.socket == socket
-    
-    def _main_server_listening_0_exec(self, parameters):
-        socket = parameters[0]
-        self.big_step.outputEvent(Event("accept_socket", "socket_out", [self.socket]))
-    
-    def _main_server_listening_0_guard(self, parameters):
-        socket = parameters[0]
-        return self.socket == socket
-    
-    def _main_server_accepting_0_exec(self, parameters):
-        socket = parameters[0]
-        connected_socket = parameters[1]
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'sockets', 'Socket', connected_socket]))
-        self.big_step.outputEvent(Event("accept_socket", "socket_out", [self.socket]))
-    
-    def _main_server_accepting_1_exec(self, parameters):
-        instancename = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, instancename]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, instancename, Event("set_association_name", None, [instancename])]))
-    
-    def _main_close_socket_close_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, association_name]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/main"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class Socket(RuntimeClassBase):
-    def __init__(self, controller, my_socket):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Socket.user_defined_constructor(self, my_socket)
-    
-    def user_defined_constructor(self, my_socket):
-        self.socket = my_socket
-        self.received_data = ""
-        self.send_data = ""
-        self.closed = False
-        self.association_name = None
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /init
-        self.states["/init"] = State(1, self)
-        
-        # state /connected
-        self.states["/connected"] = ParallelState(2, self)
-        
-        # state /connected/listening
-        self.states["/connected/listening"] = State(3, self)
-        
-        # state /connected/listening/listen
-        self.states["/connected/listening/listen"] = State(4, self)
-        self.states["/connected/listening/listen"].setEnter(self._connected_listening_listen_enter)
-        
-        # state /connected/listening/closed
-        self.states["/connected/listening/closed"] = State(5, self)
-        self.states["/connected/listening/closed"].setEnter(self._connected_listening_closed_enter)
-        
-        # state /connected/sending
-        self.states["/connected/sending"] = State(6, self)
-        
-        # state /connected/sending/waiting_for_data
-        self.states["/connected/sending/waiting_for_data"] = State(7, self)
-        
-        # state /connected/sending/transferring
-        self.states["/connected/sending/transferring"] = State(8, self)
-        
-        # state /connected/queueing
-        self.states["/connected/queueing"] = State(9, self)
-        
-        # state /connected/queueing/queueing
-        self.states["/connected/queueing/queueing"] = State(10, self)
-        
-        # state /connected/parsing
-        self.states["/connected/parsing"] = State(11, self)
-        
-        # state /connected/parsing/wait_for_header
-        self.states["/connected/parsing/wait_for_header"] = State(12, self)
-        
-        # state /connected/parsing/closing
-        self.states["/connected/parsing/closing"] = State(13, self)
-        self.states["/connected/parsing/closing"].setEnter(self._connected_parsing_closing_enter)
-        self.states["/connected/parsing/closing"].setExit(self._connected_parsing_closing_exit)
-        
-        # state /connected/parsing/wait_for_payload
-        self.states["/connected/parsing/wait_for_payload"] = State(14, self)
-        
-        # state /close
-        self.states["/close"] = State(15, self)
-        self.states["/close"].setEnter(self._close_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/init"])
-        self.states[""].addChild(self.states["/connected"])
-        self.states[""].addChild(self.states["/close"])
-        self.states["/connected"].addChild(self.states["/connected/listening"])
-        self.states["/connected"].addChild(self.states["/connected/sending"])
-        self.states["/connected"].addChild(self.states["/connected/queueing"])
-        self.states["/connected"].addChild(self.states["/connected/parsing"])
-        self.states["/connected/listening"].addChild(self.states["/connected/listening/listen"])
-        self.states["/connected/listening"].addChild(self.states["/connected/listening/closed"])
-        self.states["/connected/sending"].addChild(self.states["/connected/sending/waiting_for_data"])
-        self.states["/connected/sending"].addChild(self.states["/connected/sending/transferring"])
-        self.states["/connected/queueing"].addChild(self.states["/connected/queueing/queueing"])
-        self.states["/connected/parsing"].addChild(self.states["/connected/parsing/wait_for_header"])
-        self.states["/connected/parsing"].addChild(self.states["/connected/parsing/closing"])
-        self.states["/connected/parsing"].addChild(self.states["/connected/parsing/wait_for_payload"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/init"]
-        self.states["/connected/listening"].default_state = self.states["/connected/listening/listen"]
-        self.states["/connected/sending"].default_state = self.states["/connected/sending/waiting_for_data"]
-        self.states["/connected/queueing"].default_state = self.states["/connected/queueing/queueing"]
-        self.states["/connected/parsing"].default_state = self.states["/connected/parsing/wait_for_header"]
-        
-        # transition /init
-        _init_0 = Transition(self, self.states["/init"], [self.states["/connected"]])
-        _init_0.setAction(self._init_0_exec)
-        _init_0.setTrigger(Event("set_association_name", None))
-        self.states["/init"].addTransition(_init_0)
-        
-        # transition /connected/listening/listen
-        _connected_listening_listen_0 = Transition(self, self.states["/connected/listening/listen"], [self.states["/connected/listening/listen"]])
-        _connected_listening_listen_0.setAction(self._connected_listening_listen_0_exec)
-        _connected_listening_listen_0.setTrigger(Event("received_socket", "socket_in"))
-        _connected_listening_listen_0.setGuard(self._connected_listening_listen_0_guard)
-        self.states["/connected/listening/listen"].addTransition(_connected_listening_listen_0)
-        _connected_listening_listen_1 = Transition(self, self.states["/connected/listening/listen"], [self.states["/connected/listening/closed"]])
-        _connected_listening_listen_1.setAction(self._connected_listening_listen_1_exec)
-        _connected_listening_listen_1.setTrigger(Event("received_socket", "socket_in"))
-        _connected_listening_listen_1.setGuard(self._connected_listening_listen_1_guard)
-        self.states["/connected/listening/listen"].addTransition(_connected_listening_listen_1)
-        
-        # transition /connected/sending/waiting_for_data
-        _connected_sending_waiting_for_data_0 = Transition(self, self.states["/connected/sending/waiting_for_data"], [self.states["/connected/sending/transferring"]])
-        _connected_sending_waiting_for_data_0.setAction(self._connected_sending_waiting_for_data_0_exec)
-        _connected_sending_waiting_for_data_0.setTrigger(None)
-        _connected_sending_waiting_for_data_0.setGuard(self._connected_sending_waiting_for_data_0_guard)
-        self.states["/connected/sending/waiting_for_data"].addTransition(_connected_sending_waiting_for_data_0)
-        
-        # transition /connected/sending/transferring
-        _connected_sending_transferring_0 = Transition(self, self.states["/connected/sending/transferring"], [self.states["/connected/sending/waiting_for_data"]])
-        _connected_sending_transferring_0.setAction(self._connected_sending_transferring_0_exec)
-        _connected_sending_transferring_0.setTrigger(Event("sent_socket", "socket_in"))
-        _connected_sending_transferring_0.setGuard(self._connected_sending_transferring_0_guard)
-        self.states["/connected/sending/transferring"].addTransition(_connected_sending_transferring_0)
-        
-        # transition /connected/queueing/queueing
-        _connected_queueing_queueing_0 = Transition(self, self.states["/connected/queueing/queueing"], [self.states["/connected/queueing/queueing"]])
-        _connected_queueing_queueing_0.setAction(self._connected_queueing_queueing_0_exec)
-        _connected_queueing_queueing_0.setTrigger(Event("HTTP_input", None))
-        self.states["/connected/queueing/queueing"].addTransition(_connected_queueing_queueing_0)
-        
-        # transition /connected/parsing/wait_for_header
-        _connected_parsing_wait_for_header_0 = Transition(self, self.states["/connected/parsing/wait_for_header"], [self.states["/connected/parsing/wait_for_payload"]])
-        _connected_parsing_wait_for_header_0.setAction(self._connected_parsing_wait_for_header_0_exec)
-        _connected_parsing_wait_for_header_0.setTrigger(None)
-        _connected_parsing_wait_for_header_0.setGuard(self._connected_parsing_wait_for_header_0_guard)
-        self.states["/connected/parsing/wait_for_header"].addTransition(_connected_parsing_wait_for_header_0)
-        _connected_parsing_wait_for_header_1 = Transition(self, self.states["/connected/parsing/wait_for_header"], [self.states["/connected/parsing/closing"]])
-        _connected_parsing_wait_for_header_1.setTrigger(None)
-        _connected_parsing_wait_for_header_1.setGuard(self._connected_parsing_wait_for_header_1_guard)
-        self.states["/connected/parsing/wait_for_header"].addTransition(_connected_parsing_wait_for_header_1)
-        
-        # transition /connected/parsing/closing
-        _connected_parsing_closing_0 = Transition(self, self.states["/connected/parsing/closing"], [self.states["/connected/parsing/closing"]])
-        _connected_parsing_closing_0.setAction(self._connected_parsing_closing_0_exec)
-        _connected_parsing_closing_0.setTrigger(Event("_0after"))
-        self.states["/connected/parsing/closing"].addTransition(_connected_parsing_closing_0)
-        
-        # transition /connected/parsing/wait_for_payload
-        _connected_parsing_wait_for_payload_0 = Transition(self, self.states["/connected/parsing/wait_for_payload"], [self.states["/connected/parsing/wait_for_header"]])
-        _connected_parsing_wait_for_payload_0.setAction(self._connected_parsing_wait_for_payload_0_exec)
-        _connected_parsing_wait_for_payload_0.setTrigger(None)
-        _connected_parsing_wait_for_payload_0.setGuard(self._connected_parsing_wait_for_payload_0_guard)
-        self.states["/connected/parsing/wait_for_payload"].addTransition(_connected_parsing_wait_for_payload_0)
-        
-        # transition /connected
-        _connected_0 = Transition(self, self.states["/connected"], [self.states["/close"]])
-        _connected_0.setTrigger(Event("close", None))
-        self.states["/connected"].addTransition(_connected_0)
-    
-    def _connected_listening_listen_enter(self):
-        self.big_step.outputEvent(Event("recv_socket", "socket_out", [self.socket]))
-    
-    def _connected_listening_closed_enter(self):
-        self.closed = True
-    
-    def _connected_parsing_closing_enter(self):
-        self.addTimer(0, 0.0)
-    
-    def _connected_parsing_closing_exit(self):
-        self.removeTimer(0)
-    
-    def _close_enter(self):
-        self.big_step.outputEvent(Event("close_socket", "socket_out", [self.socket]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("close_socket", None, [self.association_name])]))
-    
-    def _init_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.association_name = association_name
-    
-    def _connected_listening_listen_0_exec(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        self.received_data += data
-        self.raiseInternalEvent(Event("received_data", None, []))
-    
-    def _connected_listening_listen_0_guard(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        return (self.socket == socket) and (len(data) > 0)
-    
-    def _connected_listening_listen_1_exec(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        self.raiseInternalEvent(Event("received_data", None, []))
-    
-    def _connected_listening_listen_1_guard(self, parameters):
-        socket = parameters[0]
-        data = parameters[1]
-        return (self.socket == socket) and (len(data) == 0)
-    
-    def _connected_sending_waiting_for_data_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("send_socket", "socket_out", [self.socket, self.send_data]))
-    
-    def _connected_sending_waiting_for_data_0_guard(self, parameters):
-        return len(self.send_data) > 0
-    
-    def _connected_sending_transferring_0_exec(self, parameters):
-        socket = parameters[0]
-        sent_bytes = parameters[1]
-        self.send_data = self.send_data[sent_bytes:]
-    
-    def _connected_sending_transferring_0_guard(self, parameters):
-        socket = parameters[0]
-        sent_bytes = parameters[1]
-        return self.socket == socket
-    
-    def _connected_queueing_queueing_0_exec(self, parameters):
-        data = parameters[0]
-        #post_data = "&".join(["%s=%s" % (urllib.quote(k), urllib.quote(v)) for k, v in data.iteritems()])
-        #post_data = "&".join(["%s=%s" % (k, v) for k, v in data.iteritems()])
-        post_data = data
-        self.send_data += "HTTP/1.0 200 OK\r\n"
-        self.send_data += "Content-Length: %s\r\n" % len(post_data)
-        self.send_data += "Content-Type: %s; charset=UTF-8\r\n" % "text/plain"
-        self.send_data += "\r\n"
-        self.send_data += str(post_data)
-    
-    def _connected_parsing_wait_for_header_0_exec(self, parameters):
-        header, self.received_data = self.received_data.split("\r\n\r\n", 1)
-        header = header.lower()
-        if "content-length" in header:
-            _, after = header.split("content-length:", 1)
-            after = after.split("\r\n", 1)[0]
-            after = after.strip()
-            self.length = int(after)
-        else:
-            self.length = float('inf')
-    
-    def _connected_parsing_wait_for_header_0_guard(self, parameters):
-        return '\r\n\r\n' in self.received_data and self.received_data.startswith('POST')
-    
-    def _connected_parsing_wait_for_header_1_guard(self, parameters):
-        return self.closed and len(self.received_data) == 0
-    
-    def _connected_parsing_closing_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("close", None, []))
-    
-    def _connected_parsing_wait_for_payload_0_exec(self, parameters):
-        if self.length == float('inf'):
-            data = self.received_data
-            self.received_data = ""
-        else:
-            data = self.received_data[:self.length]
-            self.received_data = self.received_data[self.length:]
-        
-        print("Got data: " + str(data))
-        
-        # We support POST data only, so everything is in the data
-        #try:
-        #    params = dict([p.split('=') for p in data.split('&')])
-        #    data = {k: urllib.unquote_plus(v) for k, v in params.iteritems()}
-        #except:
-        #    data = {}
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("HTTP_output", None, [self.association_name, data])]))
-    
-    def _connected_parsing_wait_for_payload_0_guard(self, parameters):
-        return len(self.received_data) >= self.length or self.closed
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/init"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Echo":
-            instance = Echo(self.controller, construct_params[0])
-            instance.associations = {}
-            instance.associations["to_server"] = Association("Server", 1, 1)
-        elif class_name == "Server":
-            instance = Server(self.controller, construct_params[0], construct_params[1])
-            instance.associations = {}
-            instance.associations["sockets"] = Association("Socket", 0, -1)
-            instance.associations["parent"] = Association("Echo", 1, 1)
-        elif class_name == "Socket":
-            instance = Socket(self.controller, construct_params[0])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Server", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, params, keep_running = None):
-        if keep_running == None: keep_running = True
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running)
-        self.addInputPort("socket_in")
-        self.addOutputPort("socket_out")
-        self.object_manager.createInstance("Echo", [params])

+ 0 - 818
examples/bouncingballs/js/target_js/target.js

@@ -1,818 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Mon Aug 08 16:30:17 2016
-
-Model author: Joeri Exelmans+Raphael Mannadiar+Simon Van Mierlo
-Model name:   Bouncing_Balls_JavaScript_Version
-Model description:
-SVG canvas with bouncing balls in it.*/
-
-
-// package "Bouncing_Balls_JavaScript_Version"
-var Bouncing_Balls_JavaScript_Version = {};
-(function() {
-
-var MainApp = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    MainApp.prototype.user_defined_constructor.call(this);
-};
-MainApp.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        MainApp.prototype[prop] = proto[prop];
-    }
-})();
-
-MainApp.prototype.user_defined_constructor = function() {
-    this.nr_of_fields = 0;
-};
-
-MainApp.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-MainApp.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /running
-    this.states["/running"] = new State(1, this);
-    
-    // state /running/root
-    this.states["/running/root"] = new ParallelState(2, this);
-    
-    // state /running/root/main_behaviour
-    this.states["/running/root/main_behaviour"] = new State(3, this);
-    
-    // state /running/root/main_behaviour/initializing
-    this.states["/running/root/main_behaviour/initializing"] = new State(4, this);
-    
-    // state /running/root/main_behaviour/running
-    this.states["/running/root/main_behaviour/running"] = new State(5, this);
-    
-    // state /running/root/cd_behaviour
-    this.states["/running/root/cd_behaviour"] = new State(6, this);
-    
-    // state /running/root/cd_behaviour/waiting
-    this.states["/running/root/cd_behaviour/waiting"] = new State(7, this);
-    
-    // state /running/root/cd_behaviour/creating
-    this.states["/running/root/cd_behaviour/creating"] = new State(8, this);
-    
-    // state /running/root/cd_behaviour/check_nr_of_fields
-    this.states["/running/root/cd_behaviour/check_nr_of_fields"] = new State(9, this);
-    
-    // state /running/stopped
-    this.states["/running/stopped"] = new State(10, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/running"]);
-    this.states["/running"].addChild(this.states["/running/root"]);
-    this.states["/running"].addChild(this.states["/running/stopped"]);
-    this.states["/running/root"].addChild(this.states["/running/root/main_behaviour"]);
-    this.states["/running/root"].addChild(this.states["/running/root/cd_behaviour"]);
-    this.states["/running/root/main_behaviour"].addChild(this.states["/running/root/main_behaviour/initializing"]);
-    this.states["/running/root/main_behaviour"].addChild(this.states["/running/root/main_behaviour/running"]);
-    this.states["/running/root/cd_behaviour"].addChild(this.states["/running/root/cd_behaviour/waiting"]);
-    this.states["/running/root/cd_behaviour"].addChild(this.states["/running/root/cd_behaviour/creating"]);
-    this.states["/running/root/cd_behaviour"].addChild(this.states["/running/root/cd_behaviour/check_nr_of_fields"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/running"];
-    this.states["/running"].default_state = this.states["/running/root"];
-    this.states["/running/root/main_behaviour"].default_state = this.states["/running/root/main_behaviour/initializing"];
-    this.states["/running/root/cd_behaviour"].default_state = this.states["/running/root/cd_behaviour/waiting"];
-    
-    // transition /running/root/main_behaviour/initializing
-    var _running_root_main_behaviour_initializing_0 = new Transition(this, this.states["/running/root/main_behaviour/initializing"], [this.states["/running/root/main_behaviour/running"]]);
-    _running_root_main_behaviour_initializing_0.setAction(this._running_root_main_behaviour_initializing_0_exec);
-    _running_root_main_behaviour_initializing_0.setTrigger(null);
-    this.states["/running/root/main_behaviour/initializing"].addTransition(_running_root_main_behaviour_initializing_0);
-    
-    // transition /running/root/main_behaviour/running
-    var _running_root_main_behaviour_running_0 = new Transition(this, this.states["/running/root/main_behaviour/running"], [this.states["/running/root/main_behaviour/running"]]);
-    _running_root_main_behaviour_running_0.setAction(this._running_root_main_behaviour_running_0_exec);
-    _running_root_main_behaviour_running_0.setTrigger(new Event("button_pressed", null));
-    _running_root_main_behaviour_running_0.setGuard(this._running_root_main_behaviour_running_0_guard);
-    this.states["/running/root/main_behaviour/running"].addTransition(_running_root_main_behaviour_running_0);
-    
-    // transition /running/root/cd_behaviour/waiting
-    var _running_root_cd_behaviour_waiting_0 = new Transition(this, this.states["/running/root/cd_behaviour/waiting"], [this.states["/running/root/cd_behaviour/creating"]]);
-    _running_root_cd_behaviour_waiting_0.setAction(this._running_root_cd_behaviour_waiting_0_exec);
-    _running_root_cd_behaviour_waiting_0.setTrigger(new Event("create_field", null));
-    this.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_0);
-    var _running_root_cd_behaviour_waiting_1 = new Transition(this, this.states["/running/root/cd_behaviour/waiting"], [this.states["/running/root/cd_behaviour/check_nr_of_fields"]]);
-    _running_root_cd_behaviour_waiting_1.setAction(this._running_root_cd_behaviour_waiting_1_exec);
-    _running_root_cd_behaviour_waiting_1.setTrigger(new Event("delete_field", null));
-    this.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_1);
-    
-    // transition /running/root/cd_behaviour/creating
-    var _running_root_cd_behaviour_creating_0 = new Transition(this, this.states["/running/root/cd_behaviour/creating"], [this.states["/running/root/cd_behaviour/waiting"]]);
-    _running_root_cd_behaviour_creating_0.setAction(this._running_root_cd_behaviour_creating_0_exec);
-    _running_root_cd_behaviour_creating_0.setTrigger(new Event("instance_created", null));
-    this.states["/running/root/cd_behaviour/creating"].addTransition(_running_root_cd_behaviour_creating_0);
-    
-    // transition /running/root/cd_behaviour/check_nr_of_fields
-    var _running_root_cd_behaviour_check_nr_of_fields_0 = new Transition(this, this.states["/running/root/cd_behaviour/check_nr_of_fields"], [this.states["/running/stopped"]]);
-    _running_root_cd_behaviour_check_nr_of_fields_0.setAction(this._running_root_cd_behaviour_check_nr_of_fields_0_exec);
-    _running_root_cd_behaviour_check_nr_of_fields_0.setTrigger(null);
-    _running_root_cd_behaviour_check_nr_of_fields_0.setGuard(this._running_root_cd_behaviour_check_nr_of_fields_0_guard);
-    this.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_0);
-    var _running_root_cd_behaviour_check_nr_of_fields_1 = new Transition(this, this.states["/running/root/cd_behaviour/check_nr_of_fields"], [this.states["/running/root/cd_behaviour/waiting"]]);
-    _running_root_cd_behaviour_check_nr_of_fields_1.setTrigger(null);
-    _running_root_cd_behaviour_check_nr_of_fields_1.setGuard(this._running_root_cd_behaviour_check_nr_of_fields_1_guard);
-    this.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_1);
-};
-
-MainApp.prototype._running_root_main_behaviour_initializing_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("create_field", null, new Array()));
-};
-
-MainApp.prototype._running_root_main_behaviour_running_0_exec = function(parameters) {
-    var event_name = parameters[0];
-    this.raiseInternalEvent(new Event("create_field", null, new Array()));
-};
-
-MainApp.prototype._running_root_main_behaviour_running_0_guard = function(parameters) {
-    var event_name = parameters[0];
-    return event_name == "create_new_field";
-};
-
-MainApp.prototype._running_root_cd_behaviour_waiting_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "fields"]));
-};
-
-MainApp.prototype._running_root_cd_behaviour_waiting_1_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("delete_instance", null, [this, association_name]));
-    this.nr_of_fields -= 1
-};
-
-MainApp.prototype._running_root_cd_behaviour_creating_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, association_name]));
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, association_name, new Event("set_association_name", null, [association_name])]));
-    this.nr_of_fields += 1
-};
-
-MainApp.prototype._running_root_cd_behaviour_check_nr_of_fields_0_exec = function(parameters) {
-    //NOTE: ideally, this should be ui.close_window(ui.window). we can't do this though 
-    //		  due to a security measure preventing scripts from closing pages they didn't
-    //		  open themselves
-    ui.println('refresh to play again');
-};
-
-MainApp.prototype._running_root_cd_behaviour_check_nr_of_fields_0_guard = function(parameters) {
-    return this.nr_of_fields == 0;
-};
-
-MainApp.prototype._running_root_cd_behaviour_check_nr_of_fields_1_guard = function(parameters) {
-    return this.nr_of_fields != 0;
-};
-
-MainApp.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/running"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'MainApp' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.MainApp = MainApp;
-
-var Field = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    this.inports["field_ui"] = controller.addInputPort("field_ui", this);
-    
-    // user defined attributes
-    this.canvas = null;
-    this.field_window = null;
-    
-    // call user defined constructor
-    Field.prototype.user_defined_constructor.call(this);
-};
-Field.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Field.prototype[prop] = proto[prop];
-    }
-})();
-
-Field.prototype.user_defined_constructor = function() {
-    this.field_window = ui.new_window(400,450);
-    this.canvas	= ui.append_canvas(this.field_window,400,400,{'background':'#eee'});
-    ui.bind_event(this.field_window, ui.EVENTS.WINDOW_CLOSE, this.controller, 'window_close', this.inports['field_ui']);
-    ui.bind_event(this.field_window, ui.EVENTS.KEY_PRESS, this.controller, 'key_press', this.inports['field_ui']);
-    ui.bind_event(this.canvas.element, ui.EVENTS.MOUSE_RIGHT_CLICK, this.controller, 'right_click', this.inports['field_ui']);
-    ui.bind_event(this.canvas.element, ui.EVENTS.MOUSE_MOVE, this.controller, 'mouse_move');
-    ui.bind_event(this.canvas.element, ui.EVENTS.MOUSE_RELEASE, this.controller, 'mouse_release');
-};
-
-Field.prototype.user_defined_destructor = function() {
-    ui.close_window(this.field_window);
-};
-
-
-// builds Statechart structure
-Field.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /root
-    this.states["/root"] = new State(1, this);
-    
-    // state /root/waiting
-    this.states["/root/waiting"] = new State(2, this);
-    
-    // state /root/initializing
-    this.states["/root/initializing"] = new State(3, this);
-    
-    // state /root/creating
-    this.states["/root/creating"] = new State(4, this);
-    
-    // state /root/packing
-    this.states["/root/packing"] = new State(5, this);
-    
-    // state /root/running
-    this.states["/root/running"] = new ParallelState(6, this);
-    
-    // state /root/running/main_behaviour
-    this.states["/root/running/main_behaviour"] = new State(7, this);
-    
-    // state /root/running/main_behaviour/running
-    this.states["/root/running/main_behaviour/running"] = new State(8, this);
-    
-    // state /root/running/main_behaviour/creating
-    this.states["/root/running/main_behaviour/creating"] = new State(9, this);
-    
-    // state /root/running/deleting_behaviour
-    this.states["/root/running/deleting_behaviour"] = new State(10, this);
-    
-    // state /root/running/deleting_behaviour/running
-    this.states["/root/running/deleting_behaviour/running"] = new State(11, this);
-    
-    // state /root/running/child_behaviour
-    this.states["/root/running/child_behaviour"] = new State(12, this);
-    
-    // state /root/running/child_behaviour/listening
-    this.states["/root/running/child_behaviour/listening"] = new State(13, this);
-    
-    // state /root/running/deleting_balls_behaviour
-    this.states["/root/running/deleting_balls_behaviour"] = new State(14, this);
-    
-    // state /root/running/deleting_balls_behaviour/listening
-    this.states["/root/running/deleting_balls_behaviour/listening"] = new State(15, this);
-    
-    // state /root/deleting
-    this.states["/root/deleting"] = new State(16, this);
-    
-    // state /root/deleted
-    this.states["/root/deleted"] = new State(17, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/root"]);
-    this.states["/root"].addChild(this.states["/root/waiting"]);
-    this.states["/root"].addChild(this.states["/root/initializing"]);
-    this.states["/root"].addChild(this.states["/root/creating"]);
-    this.states["/root"].addChild(this.states["/root/packing"]);
-    this.states["/root"].addChild(this.states["/root/running"]);
-    this.states["/root"].addChild(this.states["/root/deleting"]);
-    this.states["/root"].addChild(this.states["/root/deleted"]);
-    this.states["/root/running"].addChild(this.states["/root/running/main_behaviour"]);
-    this.states["/root/running"].addChild(this.states["/root/running/deleting_behaviour"]);
-    this.states["/root/running"].addChild(this.states["/root/running/child_behaviour"]);
-    this.states["/root/running"].addChild(this.states["/root/running/deleting_balls_behaviour"]);
-    this.states["/root/running/main_behaviour"].addChild(this.states["/root/running/main_behaviour/running"]);
-    this.states["/root/running/main_behaviour"].addChild(this.states["/root/running/main_behaviour/creating"]);
-    this.states["/root/running/deleting_behaviour"].addChild(this.states["/root/running/deleting_behaviour/running"]);
-    this.states["/root/running/child_behaviour"].addChild(this.states["/root/running/child_behaviour/listening"]);
-    this.states["/root/running/deleting_balls_behaviour"].addChild(this.states["/root/running/deleting_balls_behaviour/listening"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/root"];
-    this.states["/root"].default_state = this.states["/root/waiting"];
-    this.states["/root/running/main_behaviour"].default_state = this.states["/root/running/main_behaviour/running"];
-    this.states["/root/running/deleting_behaviour"].default_state = this.states["/root/running/deleting_behaviour/running"];
-    this.states["/root/running/child_behaviour"].default_state = this.states["/root/running/child_behaviour/listening"];
-    this.states["/root/running/deleting_balls_behaviour"].default_state = this.states["/root/running/deleting_balls_behaviour/listening"];
-    
-    // transition /root/waiting
-    var _root_waiting_0 = new Transition(this, this.states["/root/waiting"], [this.states["/root/initializing"]]);
-    _root_waiting_0.setAction(this._root_waiting_0_exec);
-    _root_waiting_0.setTrigger(new Event("set_association_name", null));
-    this.states["/root/waiting"].addTransition(_root_waiting_0);
-    
-    // transition /root/initializing
-    var _root_initializing_0 = new Transition(this, this.states["/root/initializing"], [this.states["/root/creating"]]);
-    _root_initializing_0.setAction(this._root_initializing_0_exec);
-    _root_initializing_0.setTrigger(null);
-    this.states["/root/initializing"].addTransition(_root_initializing_0);
-    
-    // transition /root/creating
-    var _root_creating_0 = new Transition(this, this.states["/root/creating"], [this.states["/root/packing"]]);
-    _root_creating_0.setAction(this._root_creating_0_exec);
-    _root_creating_0.setTrigger(new Event("instance_created", null));
-    this.states["/root/creating"].addTransition(_root_creating_0);
-    
-    // transition /root/packing
-    var _root_packing_0 = new Transition(this, this.states["/root/packing"], [this.states["/root/running"]]);
-    _root_packing_0.setTrigger(new Event("button_created", null));
-    this.states["/root/packing"].addTransition(_root_packing_0);
-    
-    // transition /root/running/main_behaviour/running
-    var _root_running_main_behaviour_running_0 = new Transition(this, this.states["/root/running/main_behaviour/running"], [this.states["/root/running/main_behaviour/creating"]]);
-    _root_running_main_behaviour_running_0.setAction(this._root_running_main_behaviour_running_0_exec);
-    _root_running_main_behaviour_running_0.setTrigger(new Event("right_click", "field_ui"));
-    this.states["/root/running/main_behaviour/running"].addTransition(_root_running_main_behaviour_running_0);
-    
-    // transition /root/running/main_behaviour/creating
-    var _root_running_main_behaviour_creating_0 = new Transition(this, this.states["/root/running/main_behaviour/creating"], [this.states["/root/running/main_behaviour/running"]]);
-    _root_running_main_behaviour_creating_0.setAction(this._root_running_main_behaviour_creating_0_exec);
-    _root_running_main_behaviour_creating_0.setTrigger(new Event("instance_created", null));
-    this.states["/root/running/main_behaviour/creating"].addTransition(_root_running_main_behaviour_creating_0);
-    
-    // transition /root/running/deleting_behaviour/running
-    var _root_running_deleting_behaviour_running_0 = new Transition(this, this.states["/root/running/deleting_behaviour/running"], [this.states["/root/running/deleting_behaviour/running"]]);
-    _root_running_deleting_behaviour_running_0.setAction(this._root_running_deleting_behaviour_running_0_exec);
-    _root_running_deleting_behaviour_running_0.setTrigger(new Event("delete_ball", null));
-    this.states["/root/running/deleting_behaviour/running"].addTransition(_root_running_deleting_behaviour_running_0);
-    
-    // transition /root/running/child_behaviour/listening
-    var _root_running_child_behaviour_listening_0 = new Transition(this, this.states["/root/running/child_behaviour/listening"], [this.states["/root/running/child_behaviour/listening"]]);
-    _root_running_child_behaviour_listening_0.setAction(this._root_running_child_behaviour_listening_0_exec);
-    _root_running_child_behaviour_listening_0.setTrigger(new Event("button_pressed", null));
-    this.states["/root/running/child_behaviour/listening"].addTransition(_root_running_child_behaviour_listening_0);
-    
-    // transition /root/running/deleting_balls_behaviour/listening
-    var _root_running_deleting_balls_behaviour_listening_0 = new Transition(this, this.states["/root/running/deleting_balls_behaviour/listening"], [this.states["/root/running/deleting_balls_behaviour/listening"]]);
-    _root_running_deleting_balls_behaviour_listening_0.setAction(this._root_running_deleting_balls_behaviour_listening_0_exec);
-    _root_running_deleting_balls_behaviour_listening_0.setTrigger(new Event("key_press", "field_ui"));
-    _root_running_deleting_balls_behaviour_listening_0.setGuard(this._root_running_deleting_balls_behaviour_listening_0_guard);
-    this.states["/root/running/deleting_balls_behaviour/listening"].addTransition(_root_running_deleting_balls_behaviour_listening_0);
-    
-    // transition /root/deleting
-    var _root_deleting_0 = new Transition(this, this.states["/root/deleting"], [this.states["/root/deleted"]]);
-    _root_deleting_0.setAction(this._root_deleting_0_exec);
-    _root_deleting_0.setTrigger(null);
-    this.states["/root/deleting"].addTransition(_root_deleting_0);
-    
-    // transition /root/running
-    var _root_running_0 = new Transition(this, this.states["/root/running"], [this.states["/root/deleting"]]);
-    _root_running_0.setAction(this._root_running_0_exec);
-    _root_running_0.setTrigger(new Event("window_close", "field_ui"));
-    this.states["/root/running"].addTransition(_root_running_0);
-};
-
-Field.prototype._root_running_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("delete_instance", null, [this, "buttons"]));
-    this.big_step.outputEventOM(new Event("delete_instance", null, [this, "balls"]));
-};
-
-Field.prototype._root_waiting_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.association_name = association_name
-};
-
-Field.prototype._root_initializing_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "buttons", "Button", this, 'create_new_field', 'Spawn New Window']));
-};
-
-Field.prototype._root_creating_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, association_name]));
-};
-
-Field.prototype._root_running_main_behaviour_running_0_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "balls", "Ball", this.canvas, x, y]));
-};
-
-Field.prototype._root_running_main_behaviour_creating_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, association_name]));
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, association_name, new Event("set_association_name", null, [association_name])]));
-};
-
-Field.prototype._root_running_deleting_behaviour_running_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("delete_instance", null, [this, association_name]));
-};
-
-Field.prototype._root_running_child_behaviour_listening_0_exec = function(parameters) {
-    var event_name = parameters[0];
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'parent', new Event("button_pressed", null, [event_name])]));
-};
-
-Field.prototype._root_running_deleting_balls_behaviour_listening_0_exec = function(parameters) {
-    var key = parameters[0];
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'balls', new Event("delete_self", null, new Array())]));
-};
-
-Field.prototype._root_running_deleting_balls_behaviour_listening_0_guard = function(parameters) {
-    var key = parameters[0];
-    return key == ui.KEYCODES.DELETE;
-};
-
-Field.prototype._root_deleting_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'parent', new Event("delete_field", null, [this.association_name])]));
-};
-
-Field.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/root"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Field' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.Field = Field;
-
-var Button = function(controller, parent, event_name, button_text) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    this.inports["button_ui"] = controller.addInputPort("button_ui", this);
-    
-    // call user defined constructor
-    Button.prototype.user_defined_constructor.call(this, parent, event_name, button_text);
-};
-Button.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Button.prototype[prop] = proto[prop];
-    }
-})();
-
-Button.prototype.user_defined_constructor = function(parent, event_name, button_text) {
-    this.event_name = event_name;
-    var button = ui.append_button(parent.field_window, event_name);
-    ui.bind_event(button.element, ui.EVENTS.MOUSE_CLICK, this.controller, 'mouse_click', this.inports["button_ui"]);
-};
-
-Button.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Button.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /initializing
-    this.states["/initializing"] = new State(1, this);
-    
-    // state /running
-    this.states["/running"] = new State(2, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/initializing"]);
-    this.states[""].addChild(this.states["/running"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/initializing"];
-    
-    // transition /initializing
-    var _initializing_0 = new Transition(this, this.states["/initializing"], [this.states["/running"]]);
-    _initializing_0.setAction(this._initializing_0_exec);
-    _initializing_0.setTrigger(null);
-    this.states["/initializing"].addTransition(_initializing_0);
-    
-    // transition /running
-    var _running_0 = new Transition(this, this.states["/running"], [this.states["/running"]]);
-    _running_0.setAction(this._running_0_exec);
-    _running_0.setTrigger(new Event("mouse_click", "button_ui"));
-    _running_0.setGuard(this._running_0_guard);
-    this.states["/running"].addTransition(_running_0);
-};
-
-Button.prototype._initializing_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'parent', new Event("button_created", null, new Array())]));
-};
-
-Button.prototype._running_0_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'parent', new Event("button_pressed", null, [this.event_name])]));
-};
-
-Button.prototype._running_0_guard = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    return button == ui.MOUSE_BUTTONS.LEFT;
-};
-
-Button.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/initializing"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Button' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.Button = Button;
-
-var Ball = function(controller, canvas, x, y) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    this.inports["ball_ui"] = controller.addInputPort("ball_ui", this);
-    
-    // user defined attributes
-    this.canvas = null;
-    
-    // call user defined constructor
-    Ball.prototype.user_defined_constructor.call(this, canvas, x, y);
-};
-Ball.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Ball.prototype[prop] = proto[prop];
-    }
-})();
-
-Ball.prototype.user_defined_constructor = function(canvas, x, y) {
-    this.canvas 		= canvas;
-    this.r 				= 20.0;
-    this.vel 			= {'x': utils.random() * 3.0, 'y': utils.random() * 3.0};
-    this.mouse_pos		= {};
-    this.smooth 		= 0.4; // value between 0 and 1
-    
-    var circle = this.canvas.add_circle(x, y, this.r, {'fill':'#000'});
-    ui.bind_event(circle, ui.EVENTS.MOUSE_PRESS, this.controller, 'mouse_press', this.inports["ball_ui"]);
-    this.element = circle;
-};
-
-Ball.prototype.user_defined_destructor = function() {
-    this.canvas.remove_element(this.element);
-};
-
-
-// builds Statechart structure
-Ball.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /main_behaviour
-    this.states["/main_behaviour"] = new State(1, this);
-    
-    // state /main_behaviour/initializing
-    this.states["/main_behaviour/initializing"] = new State(2, this);
-    
-    // state /main_behaviour/bouncing
-    this.states["/main_behaviour/bouncing"] = new State(3, this);
-    this.states["/main_behaviour/bouncing"].setEnter(this._main_behaviour_bouncing_enter);
-    this.states["/main_behaviour/bouncing"].setExit(this._main_behaviour_bouncing_exit);
-    
-    // state /main_behaviour/dragging
-    this.states["/main_behaviour/dragging"] = new State(4, this);
-    
-    // state /main_behaviour/selected
-    this.states["/main_behaviour/selected"] = new State(5, this);
-    
-    // state /deleted
-    this.states["/deleted"] = new State(6, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/main_behaviour"]);
-    this.states[""].addChild(this.states["/deleted"]);
-    this.states["/main_behaviour"].addChild(this.states["/main_behaviour/initializing"]);
-    this.states["/main_behaviour"].addChild(this.states["/main_behaviour/bouncing"]);
-    this.states["/main_behaviour"].addChild(this.states["/main_behaviour/dragging"]);
-    this.states["/main_behaviour"].addChild(this.states["/main_behaviour/selected"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/main_behaviour"];
-    this.states["/main_behaviour"].default_state = this.states["/main_behaviour/initializing"];
-    
-    // transition /main_behaviour/initializing
-    var _main_behaviour_initializing_0 = new Transition(this, this.states["/main_behaviour/initializing"], [this.states["/main_behaviour/bouncing"]]);
-    _main_behaviour_initializing_0.setAction(this._main_behaviour_initializing_0_exec);
-    _main_behaviour_initializing_0.setTrigger(new Event("set_association_name", null));
-    this.states["/main_behaviour/initializing"].addTransition(_main_behaviour_initializing_0);
-    
-    // transition /main_behaviour/bouncing
-    var _main_behaviour_bouncing_0 = new Transition(this, this.states["/main_behaviour/bouncing"], [this.states["/main_behaviour/bouncing"]]);
-    _main_behaviour_bouncing_0.setAction(this._main_behaviour_bouncing_0_exec);
-    _main_behaviour_bouncing_0.setTrigger(new Event("_0after"));
-    this.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_0);
-    var _main_behaviour_bouncing_1 = new Transition(this, this.states["/main_behaviour/bouncing"], [this.states["/main_behaviour/selected"]]);
-    _main_behaviour_bouncing_1.setAction(this._main_behaviour_bouncing_1_exec);
-    _main_behaviour_bouncing_1.setTrigger(new Event("mouse_press", "ball_ui"));
-    _main_behaviour_bouncing_1.setGuard(this._main_behaviour_bouncing_1_guard);
-    this.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_1);
-    
-    // transition /main_behaviour/dragging
-    var _main_behaviour_dragging_0 = new Transition(this, this.states["/main_behaviour/dragging"], [this.states["/main_behaviour/dragging"]]);
-    _main_behaviour_dragging_0.setAction(this._main_behaviour_dragging_0_exec);
-    _main_behaviour_dragging_0.setTrigger(new Event("mouse_move", "ui"));
-    this.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_0);
-    var _main_behaviour_dragging_1 = new Transition(this, this.states["/main_behaviour/dragging"], [this.states["/main_behaviour/bouncing"]]);
-    _main_behaviour_dragging_1.setAction(this._main_behaviour_dragging_1_exec);
-    _main_behaviour_dragging_1.setTrigger(new Event("mouse_release", "ui"));
-    this.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_1);
-    
-    // transition /main_behaviour/selected
-    var _main_behaviour_selected_0 = new Transition(this, this.states["/main_behaviour/selected"], [this.states["/main_behaviour/dragging"]]);
-    _main_behaviour_selected_0.setAction(this._main_behaviour_selected_0_exec);
-    _main_behaviour_selected_0.setTrigger(new Event("mouse_press", "ball_ui"));
-    _main_behaviour_selected_0.setGuard(this._main_behaviour_selected_0_guard);
-    this.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_0);
-    var _main_behaviour_selected_1 = new Transition(this, this.states["/main_behaviour/selected"], [this.states["/deleted"]]);
-    _main_behaviour_selected_1.setAction(this._main_behaviour_selected_1_exec);
-    _main_behaviour_selected_1.setTrigger(new Event("delete_self", null));
-    this.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_1);
-};
-
-Ball.prototype._main_behaviour_bouncing_enter = function() {
-    this.addTimer(0, 0.05);
-};
-
-Ball.prototype._main_behaviour_bouncing_exit = function() {
-    this.removeTimer(0);
-};
-
-Ball.prototype._main_behaviour_initializing_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.association_name = association_name;
-};
-
-Ball.prototype._main_behaviour_bouncing_0_exec = function(parameters) {
-    var pos = this.element.get_position();	
-    if (pos.x-this.r <= 0 || pos.x+this.r >= this.canvas.width) 
-    	this.vel.x = -this.vel.x;
-    if (pos.y-this.r <= 0 || pos.y+this.r >= this.canvas.height) 
-    	this.vel.y = -this.vel.y;
-    this.element.move(this.vel.x, this.vel.y);
-};
-
-Ball.prototype._main_behaviour_bouncing_1_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    this.element.set_color("#ff0");
-};
-
-Ball.prototype._main_behaviour_bouncing_1_guard = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    return button == ui.MOUSE_BUTTONS.LEFT;
-};
-
-Ball.prototype._main_behaviour_dragging_0_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    var dx = x - this.mouse_pos.x;
-    var dy = y - this.mouse_pos.y;
-    
-    this.element.move(dx, dy);
-    
-    // keep ball within boundaries
-    var pos = this.element.get_position();
-    if (pos.x-this.r <= 0) 
-    	pos.x = this.r + 1;
-    else if (pos.x+this.r >= this.canvas.width) 
-    	pos.x = this.canvas.width-this.r-1;
-    if (pos.y-this.r <= 0) 
-    	pos.y = this.r + 1;
-    else if (pos.y+this.r >= this.canvas.height) 
-    	pos.y = this.canvas.height-this.r-1;
-    this.element.set_position(pos.x, pos.y);
-    this.mouse_pos = {'x':x, 'y':y};
-    this.vel = {
-    	'x': (1-this.smooth)*dx + this.smooth*this.vel.x,
-    	'y': (1-this.smooth)*dy + this.smooth*this.vel.y
-    };
-};
-
-Ball.prototype._main_behaviour_dragging_1_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    this.element.set_color("#f00");
-};
-
-Ball.prototype._main_behaviour_selected_0_exec = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    this.mouse_pos = {'x':x, 'y':y};
-};
-
-Ball.prototype._main_behaviour_selected_0_guard = function(parameters) {
-    var x = parameters[0];
-    var y = parameters[1];
-    var button = parameters[2];
-    return button == ui.MOUSE_BUTTONS.LEFT;
-};
-
-Ball.prototype._main_behaviour_selected_1_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, 'parent', new Event("delete_ball", null, [this.association_name])]));
-};
-
-Ball.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/main_behaviour"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Ball' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.Ball = Ball;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "MainApp") {
-        var instance = new MainApp(this.controller);
-        instance.associations = new Object();
-        instance.associations["fields"] = new Association("Field", 0, -1);
-    } else if (class_name === "Field") {
-        var instance = new Field(this.controller);
-        instance.associations = new Object();
-        instance.associations["balls"] = new Association("Ball", 0, -1);
-        instance.associations["buttons"] = new Association("Button", 0, -1);
-        instance.associations["parent"] = new Association("MainApp", 1, 1);
-    } else if (class_name === "Button") {
-        var instance = new Button(this.controller, construct_params[0], construct_params[1], construct_params[2]);
-        instance.associations = new Object();
-        instance.associations["parent"] = new Association("Field", 1, 1);
-    } else if (class_name === "Ball") {
-        var instance = new Ball(this.controller, construct_params[0], construct_params[1], construct_params[2]);
-        instance.associations = new Object();
-        instance.associations["parent"] = new Association("Field", 1, 1);
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("ui");
-    this.object_manager.createInstance("MainApp", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'Bouncing_Balls_JavaScript_Version'
-Bouncing_Balls_JavaScript_Version.Controller = Controller;
-})();

+ 20 - 0
examples/bouncingballs/python/runner_performance_cpu_time.py

@@ -0,0 +1,20 @@
+'''
+Created on 27-jul.-2014
+
+@author: Simon
+'''
+
+import Tkinter as tk
+import target_py.target_performance_threads as target
+import sys
+from sccd.runtime.statecharts_core import Event
+
+if __name__ == '__main__':
+    def callback(ctrl, behind_schedule):
+        if behind_schedule > 2000:
+            print len(ctrl.object_manager.instances)
+            ctrl.stop()
+            sys.exit()
+    controller = target.Controller(behind_schedule_callback=callback)
+    controller.start()
+    ui.window.mainloop()

+ 143 - 0
examples/bouncingballs/python/sccd_performance_cpu_time.xml

@@ -0,0 +1,143 @@
+<?xml version="1.1" ?>
+<diagram author="Simon Van Mierlo+Raphael Mannadiar" name="Bouncing_Balls_Python_Version">
+    <description>
+        Tkinter frame with bouncing balls in it.
+    </description>
+    <top>
+        import random, sys
+    </top>
+    <class name="MainApp" default="true">
+        <relationships>
+            <association name="fields" class="Field" />
+        </relationships>
+        <constructor>
+            <body>
+                <![CDATA[
+                self.nr_of_fields = 0
+                ]]>
+            </body>
+        </constructor>
+        <scxml initial="running">
+            <state id="running" initial="root">
+                <parallel id="root">
+                    <state id="cd_behaviour" initial="waiting">
+                        <state id="waiting">
+                            <transition event="create_field" target="../creating">
+                                <raise scope="cd" event="create_instance">
+                                    <parameter expr='"fields"' />
+                                </raise>
+                            </transition>
+                        </state>
+                        <state id="creating">
+                            <transition event="instance_created" target="../waiting">
+                                <parameter name="association_name" type="string"/>
+                                <raise scope="cd" event="start_instance">
+                                    <parameter expr="association_name" />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="spawn_windows" initial="spawning">
+                        <state id="spawning">
+                            <transition target="." after="(1000 - self.getSimulatedTime() % 1000) / 1000.0" cond="self.nr_of_fields &lt; 10">
+                                <raise event="create_field" />
+                            </transition>
+                        </state>
+                    </state>
+                </parallel>
+                <state id="stopped" />
+            </state>
+        </scxml>
+    </class>
+
+    <class name="Field">
+        <relationships>
+            <association name="balls" class="Ball" />
+            <association name="parent" class="MainApp" min="1" max="1" />
+        </relationships>
+        <scxml initial="root">
+            <state id="root" initial="running">
+                <parallel id="running">
+                    <state id="main_behaviour" initial="running">
+                        <state id="running">
+                            <transition event="spawn_ball" target="../creating">
+                                <parameter name="x" />
+                                <parameter name="y" />
+                                <raise scope="cd" event="create_instance">
+                                    <parameter expr='"balls"' />
+                                    <parameter expr='"Ball"' />
+                                    <parameter expr="x" />
+                                    <parameter expr="y" />
+                                </raise>
+                            </transition>
+                        </state>
+                        <state id="creating">
+                            <transition event="instance_created" target="../running">
+                                <parameter name="association_name" type="string"/>
+                                <raise scope="cd" event="start_instance">
+                                    <parameter expr="association_name" />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="spawn_balls" initial="spawning">
+                        <state id="spawning">
+                            <transition target="." after="(50 - self.getSimulatedTime() % 50) / 1000.0">
+                                <raise event="spawn_ball">
+                                    <parameter expr="150" />
+                                    <parameter expr="150" />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                </parallel>
+                <state id="deleting">
+                    <transition target="../deleted">
+                        <raise event="delete_field" scope="narrow" target="'parent'">
+                            <parameter expr='self.association_name' />
+                        </raise>
+                    </transition>
+                </state>
+                <state id="deleted" />
+            </state>
+        </scxml>
+    </class>
+    
+    <class name="Ball">
+        <relationships>
+            <association name="parent" class="Field" min="1" max="1" />
+        </relationships>
+        <constructor>
+            <parameter name="x" />
+            <parameter name="y" />
+            <body>
+                <![CDATA[
+                self.r = 20.0;
+                self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
+                self.mouse_pos = {};
+                self.smooth = 0.4; # value between 0 and 1
+                self.pos = {'x': x, 'y': y}
+                ]]>
+            </body>
+        </constructor>
+        <scxml initial="main_behaviour">
+            <state id="main_behaviour" initial="bouncing">
+                <state id="bouncing">
+                    <transition after="(20 - self.getSimulatedTime() % 20) / 1000.0" target=".">
+                        <script>
+                            <![CDATA[
+                            self.pos
+                            if self.pos['x'] - self.r <= 0 or self.pos['x'] + self.r >= 800 :
+                                self.vel['x'] = -self.vel['x'];
+                            if self.pos['y'] - self.r <= 0 or self.pos['y'] + self.r >= 600 :
+                                self.vel['y'] = -self.vel['y'];
+                            self.pos['x'] += self.vel['x']
+                            self.pos['y'] += self.vel['y']
+                            ]]>                            
+                        </script>
+                    </transition>
+                </state>
+            </state>
+        </scxml>
+    </class>
+</diagram>

+ 0 - 0
examples/bouncingballs/python/target_py/__init__.py


+ 0 - 718
examples/bouncingballs/python/target_py/target.py

@@ -1,718 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:51:00 2016
-
-Model author: Simon Van Mierlo+Raphael Mannadiar
-Model name:   Bouncing_Balls_Python_Version
-Model description:
-Tkinter frame with bouncing balls in it.
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.libs.ui import ui
-from sccd.runtime.libs.utils import utils
-import random
-
-# package "Bouncing_Balls_Python_Version"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.nr_of_fields = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = State(1, self)
-        
-        # state /running/root
-        self.states["/running/root"] = ParallelState(2, self)
-        
-        # state /running/root/main_behaviour
-        self.states["/running/root/main_behaviour"] = State(3, self)
-        
-        # state /running/root/main_behaviour/initializing
-        self.states["/running/root/main_behaviour/initializing"] = State(4, self)
-        
-        # state /running/root/main_behaviour/running
-        self.states["/running/root/main_behaviour/running"] = State(5, self)
-        
-        # state /running/root/cd_behaviour
-        self.states["/running/root/cd_behaviour"] = State(6, self)
-        
-        # state /running/root/cd_behaviour/waiting
-        self.states["/running/root/cd_behaviour/waiting"] = State(7, self)
-        
-        # state /running/root/cd_behaviour/creating
-        self.states["/running/root/cd_behaviour/creating"] = State(8, self)
-        
-        # state /running/root/cd_behaviour/check_nr_of_fields
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"] = State(9, self)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].setEnter(self._running_root_cd_behaviour_check_nr_of_fields_enter)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].setExit(self._running_root_cd_behaviour_check_nr_of_fields_exit)
-        
-        # state /running/stopped
-        self.states["/running/stopped"] = State(10, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states["/running"].addChild(self.states["/running/root"])
-        self.states["/running"].addChild(self.states["/running/stopped"])
-        self.states["/running/root"].addChild(self.states["/running/root/main_behaviour"])
-        self.states["/running/root"].addChild(self.states["/running/root/cd_behaviour"])
-        self.states["/running/root/main_behaviour"].addChild(self.states["/running/root/main_behaviour/initializing"])
-        self.states["/running/root/main_behaviour"].addChild(self.states["/running/root/main_behaviour/running"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/waiting"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/creating"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/check_nr_of_fields"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        self.states["/running"].default_state = self.states["/running/root"]
-        self.states["/running/root/main_behaviour"].default_state = self.states["/running/root/main_behaviour/initializing"]
-        self.states["/running/root/cd_behaviour"].default_state = self.states["/running/root/cd_behaviour/waiting"]
-        
-        # transition /running/root/main_behaviour/initializing
-        _running_root_main_behaviour_initializing_0 = Transition(self, self.states["/running/root/main_behaviour/initializing"], [self.states["/running/root/main_behaviour/running"]])
-        _running_root_main_behaviour_initializing_0.setAction(self._running_root_main_behaviour_initializing_0_exec)
-        _running_root_main_behaviour_initializing_0.setTrigger(None)
-        self.states["/running/root/main_behaviour/initializing"].addTransition(_running_root_main_behaviour_initializing_0)
-        
-        # transition /running/root/main_behaviour/running
-        _running_root_main_behaviour_running_0 = Transition(self, self.states["/running/root/main_behaviour/running"], [self.states["/running/root/main_behaviour/running"]])
-        _running_root_main_behaviour_running_0.setAction(self._running_root_main_behaviour_running_0_exec)
-        _running_root_main_behaviour_running_0.setTrigger(Event("button_pressed", None))
-        _running_root_main_behaviour_running_0.setGuard(self._running_root_main_behaviour_running_0_guard)
-        self.states["/running/root/main_behaviour/running"].addTransition(_running_root_main_behaviour_running_0)
-        
-        # transition /running/root/cd_behaviour/waiting
-        _running_root_cd_behaviour_waiting_0 = Transition(self, self.states["/running/root/cd_behaviour/waiting"], [self.states["/running/root/cd_behaviour/creating"]])
-        _running_root_cd_behaviour_waiting_0.setAction(self._running_root_cd_behaviour_waiting_0_exec)
-        _running_root_cd_behaviour_waiting_0.setTrigger(Event("create_field", None))
-        self.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_0)
-        _running_root_cd_behaviour_waiting_1 = Transition(self, self.states["/running/root/cd_behaviour/waiting"], [self.states["/running/root/cd_behaviour/check_nr_of_fields"]])
-        _running_root_cd_behaviour_waiting_1.setAction(self._running_root_cd_behaviour_waiting_1_exec)
-        _running_root_cd_behaviour_waiting_1.setTrigger(Event("delete_field", None))
-        self.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_1)
-        
-        # transition /running/root/cd_behaviour/creating
-        _running_root_cd_behaviour_creating_0 = Transition(self, self.states["/running/root/cd_behaviour/creating"], [self.states["/running/root/cd_behaviour/waiting"]])
-        _running_root_cd_behaviour_creating_0.setAction(self._running_root_cd_behaviour_creating_0_exec)
-        _running_root_cd_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/running/root/cd_behaviour/creating"].addTransition(_running_root_cd_behaviour_creating_0)
-        
-        # transition /running/root/cd_behaviour/check_nr_of_fields
-        _running_root_cd_behaviour_check_nr_of_fields_0 = Transition(self, self.states["/running/root/cd_behaviour/check_nr_of_fields"], [self.states["/running/root/cd_behaviour/waiting"]])
-        _running_root_cd_behaviour_check_nr_of_fields_0.setTrigger(None)
-        _running_root_cd_behaviour_check_nr_of_fields_0.setGuard(self._running_root_cd_behaviour_check_nr_of_fields_0_guard)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_0)
-        _running_root_cd_behaviour_check_nr_of_fields_1 = Transition(self, self.states["/running/root/cd_behaviour/check_nr_of_fields"], [self.states["/running/stopped"]])
-        _running_root_cd_behaviour_check_nr_of_fields_1.setAction(self._running_root_cd_behaviour_check_nr_of_fields_1_exec)
-        _running_root_cd_behaviour_check_nr_of_fields_1.setTrigger(Event("_0after"))
-        _running_root_cd_behaviour_check_nr_of_fields_1.setGuard(self._running_root_cd_behaviour_check_nr_of_fields_1_guard)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_1)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_exit(self):
-        self.removeTimer(0)
-    
-    def _running_root_main_behaviour_initializing_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("create_field", None, []))
-    
-    def _running_root_main_behaviour_running_0_exec(self, parameters):
-        event_name = parameters[0]
-        self.raiseInternalEvent(Event("create_field", None, []))
-    
-    def _running_root_main_behaviour_running_0_guard(self, parameters):
-        event_name = parameters[0]
-        return event_name == "create_new_field"
-    
-    def _running_root_cd_behaviour_waiting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "fields"]))
-    
-    def _running_root_cd_behaviour_waiting_1_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, association_name]))
-        self.nr_of_fields -= 1
-    
-    def _running_root_cd_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, association_name, Event("set_association_name", None, [association_name])]))
-        self.nr_of_fields += 1
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_0_guard(self, parameters):
-        return self.nr_of_fields != 0
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_1_exec(self, parameters):
-        ui.close_window(ui.window)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_1_guard(self, parameters):
-        return self.nr_of_fields == 0
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/running"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Field(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["field_ui"] = controller.addInputPort("field_ui", self)
-        
-        # user defined attributes
-        self.canvas = None
-        self.field_window = None
-        
-        # call user defined constructor
-        Field.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.field_window = ui.new_window(400,450);
-        self.canvas = ui.append_canvas(self.field_window,400,400,{'background':'#eee'});
-        ui.bind_event(self.field_window, ui.EVENTS.WINDOW_CLOSE, self.controller, 'window_close', self.inports['field_ui']);
-        ui.bind_event(self.field_window, ui.EVENTS.KEY_PRESS, self.controller, 'key_press', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_RIGHT_CLICK,    self.controller, 'right_click', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_MOVE, self.controller, 'mouse_move', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_RELEASE, self.controller, 'mouse_release', self.inports['field_ui']);
-    
-    def user_defined_destructor(self):
-        ui.close_window(self.field_window);
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /root
-        self.states["/root"] = State(1, self)
-        
-        # state /root/waiting
-        self.states["/root/waiting"] = State(2, self)
-        
-        # state /root/initializing
-        self.states["/root/initializing"] = State(3, self)
-        
-        # state /root/creating
-        self.states["/root/creating"] = State(4, self)
-        
-        # state /root/packing
-        self.states["/root/packing"] = State(5, self)
-        
-        # state /root/running
-        self.states["/root/running"] = ParallelState(6, self)
-        
-        # state /root/running/main_behaviour
-        self.states["/root/running/main_behaviour"] = State(7, self)
-        
-        # state /root/running/main_behaviour/running
-        self.states["/root/running/main_behaviour/running"] = State(8, self)
-        
-        # state /root/running/main_behaviour/creating
-        self.states["/root/running/main_behaviour/creating"] = State(9, self)
-        
-        # state /root/running/deleting_behaviour
-        self.states["/root/running/deleting_behaviour"] = State(10, self)
-        
-        # state /root/running/deleting_behaviour/running
-        self.states["/root/running/deleting_behaviour/running"] = State(11, self)
-        
-        # state /root/running/child_behaviour
-        self.states["/root/running/child_behaviour"] = State(12, self)
-        
-        # state /root/running/child_behaviour/listening
-        self.states["/root/running/child_behaviour/listening"] = State(13, self)
-        
-        # state /root/running/deleting_balls_behaviour
-        self.states["/root/running/deleting_balls_behaviour"] = State(14, self)
-        
-        # state /root/running/deleting_balls_behaviour/listening
-        self.states["/root/running/deleting_balls_behaviour/listening"] = State(15, self)
-        
-        # state /root/deleting
-        self.states["/root/deleting"] = State(16, self)
-        
-        # state /root/deleted
-        self.states["/root/deleted"] = State(17, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/root"])
-        self.states["/root"].addChild(self.states["/root/waiting"])
-        self.states["/root"].addChild(self.states["/root/initializing"])
-        self.states["/root"].addChild(self.states["/root/creating"])
-        self.states["/root"].addChild(self.states["/root/packing"])
-        self.states["/root"].addChild(self.states["/root/running"])
-        self.states["/root"].addChild(self.states["/root/deleting"])
-        self.states["/root"].addChild(self.states["/root/deleted"])
-        self.states["/root/running"].addChild(self.states["/root/running/main_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/deleting_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/child_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/deleting_balls_behaviour"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/running"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/creating"])
-        self.states["/root/running/deleting_behaviour"].addChild(self.states["/root/running/deleting_behaviour/running"])
-        self.states["/root/running/child_behaviour"].addChild(self.states["/root/running/child_behaviour/listening"])
-        self.states["/root/running/deleting_balls_behaviour"].addChild(self.states["/root/running/deleting_balls_behaviour/listening"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/root"]
-        self.states["/root"].default_state = self.states["/root/waiting"]
-        self.states["/root/running/main_behaviour"].default_state = self.states["/root/running/main_behaviour/running"]
-        self.states["/root/running/deleting_behaviour"].default_state = self.states["/root/running/deleting_behaviour/running"]
-        self.states["/root/running/child_behaviour"].default_state = self.states["/root/running/child_behaviour/listening"]
-        self.states["/root/running/deleting_balls_behaviour"].default_state = self.states["/root/running/deleting_balls_behaviour/listening"]
-        
-        # transition /root/waiting
-        _root_waiting_0 = Transition(self, self.states["/root/waiting"], [self.states["/root/initializing"]])
-        _root_waiting_0.setAction(self._root_waiting_0_exec)
-        _root_waiting_0.setTrigger(Event("set_association_name", None))
-        self.states["/root/waiting"].addTransition(_root_waiting_0)
-        
-        # transition /root/initializing
-        _root_initializing_0 = Transition(self, self.states["/root/initializing"], [self.states["/root/creating"]])
-        _root_initializing_0.setAction(self._root_initializing_0_exec)
-        _root_initializing_0.setTrigger(None)
-        self.states["/root/initializing"].addTransition(_root_initializing_0)
-        
-        # transition /root/creating
-        _root_creating_0 = Transition(self, self.states["/root/creating"], [self.states["/root/packing"]])
-        _root_creating_0.setAction(self._root_creating_0_exec)
-        _root_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/root/creating"].addTransition(_root_creating_0)
-        
-        # transition /root/packing
-        _root_packing_0 = Transition(self, self.states["/root/packing"], [self.states["/root/running"]])
-        _root_packing_0.setTrigger(Event("button_created", None))
-        self.states["/root/packing"].addTransition(_root_packing_0)
-        
-        # transition /root/running/main_behaviour/running
-        _root_running_main_behaviour_running_0 = Transition(self, self.states["/root/running/main_behaviour/running"], [self.states["/root/running/main_behaviour/creating"]])
-        _root_running_main_behaviour_running_0.setAction(self._root_running_main_behaviour_running_0_exec)
-        _root_running_main_behaviour_running_0.setTrigger(Event("right_click", "field_ui"))
-        self.states["/root/running/main_behaviour/running"].addTransition(_root_running_main_behaviour_running_0)
-        
-        # transition /root/running/main_behaviour/creating
-        _root_running_main_behaviour_creating_0 = Transition(self, self.states["/root/running/main_behaviour/creating"], [self.states["/root/running/main_behaviour/running"]])
-        _root_running_main_behaviour_creating_0.setAction(self._root_running_main_behaviour_creating_0_exec)
-        _root_running_main_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/root/running/main_behaviour/creating"].addTransition(_root_running_main_behaviour_creating_0)
-        
-        # transition /root/running/deleting_behaviour/running
-        _root_running_deleting_behaviour_running_0 = Transition(self, self.states["/root/running/deleting_behaviour/running"], [self.states["/root/running/deleting_behaviour/running"]])
-        _root_running_deleting_behaviour_running_0.setAction(self._root_running_deleting_behaviour_running_0_exec)
-        _root_running_deleting_behaviour_running_0.setTrigger(Event("delete_ball", None))
-        self.states["/root/running/deleting_behaviour/running"].addTransition(_root_running_deleting_behaviour_running_0)
-        
-        # transition /root/running/child_behaviour/listening
-        _root_running_child_behaviour_listening_0 = Transition(self, self.states["/root/running/child_behaviour/listening"], [self.states["/root/running/child_behaviour/listening"]])
-        _root_running_child_behaviour_listening_0.setAction(self._root_running_child_behaviour_listening_0_exec)
-        _root_running_child_behaviour_listening_0.setTrigger(Event("button_pressed", None))
-        self.states["/root/running/child_behaviour/listening"].addTransition(_root_running_child_behaviour_listening_0)
-        
-        # transition /root/running/deleting_balls_behaviour/listening
-        _root_running_deleting_balls_behaviour_listening_0 = Transition(self, self.states["/root/running/deleting_balls_behaviour/listening"], [self.states["/root/running/deleting_balls_behaviour/listening"]])
-        _root_running_deleting_balls_behaviour_listening_0.setAction(self._root_running_deleting_balls_behaviour_listening_0_exec)
-        _root_running_deleting_balls_behaviour_listening_0.setTrigger(Event("key_press", "field_ui"))
-        _root_running_deleting_balls_behaviour_listening_0.setGuard(self._root_running_deleting_balls_behaviour_listening_0_guard)
-        self.states["/root/running/deleting_balls_behaviour/listening"].addTransition(_root_running_deleting_balls_behaviour_listening_0)
-        
-        # transition /root/deleting
-        _root_deleting_0 = Transition(self, self.states["/root/deleting"], [self.states["/root/deleted"]])
-        _root_deleting_0.setAction(self._root_deleting_0_exec)
-        _root_deleting_0.setTrigger(None)
-        self.states["/root/deleting"].addTransition(_root_deleting_0)
-        
-        # transition /root/running
-        _root_running_0 = Transition(self, self.states["/root/running"], [self.states["/root/deleting"]])
-        _root_running_0.setAction(self._root_running_0_exec)
-        _root_running_0.setTrigger(Event("window_close", "field_ui"))
-        self.states["/root/running"].addTransition(_root_running_0)
-    
-    def _root_running_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, "buttons"]))
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, "balls"]))
-    
-    def _root_waiting_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.association_name = association_name
-    
-    def _root_initializing_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "buttons", "Button", self, 'create_new_field', 'Spawn New Window']))
-    
-    def _root_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-    
-    def _root_running_main_behaviour_running_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "balls", "Ball", self.canvas, x, y]))
-    
-    def _root_running_main_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, association_name, Event("set_association_name", None, [association_name])]))
-    
-    def _root_running_deleting_behaviour_running_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, association_name]))
-    
-    def _root_running_child_behaviour_listening_0_exec(self, parameters):
-        event_name = parameters[0]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_pressed", None, [event_name])]))
-    
-    def _root_running_deleting_balls_behaviour_listening_0_exec(self, parameters):
-        key = parameters[0]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'balls', Event("delete_self", None, [])]))
-    
-    def _root_running_deleting_balls_behaviour_listening_0_guard(self, parameters):
-        key = parameters[0]
-        return key == ui.KEYCODES.DELETE
-    
-    def _root_deleting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("delete_field", None, [self.association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/root"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Button(RuntimeClassBase):
-    def __init__(self, controller, parent, event_name, button_text):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["button_ui"] = controller.addInputPort("button_ui", self)
-        
-        # call user defined constructor
-        Button.user_defined_constructor(self, parent, event_name, button_text)
-    
-    def user_defined_constructor(self, parent, event_name, button_text):
-        self.event_name = event_name;
-        button = ui.append_button(parent.field_window, event_name);
-        ui.bind_event(button.element, ui.EVENTS.MOUSE_CLICK, self.controller, 'mouse_click', self.inports['button_ui']);
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /initializing
-        self.states["/initializing"] = State(1, self)
-        
-        # state /running
-        self.states["/running"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/initializing"])
-        self.states[""].addChild(self.states["/running"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/initializing"]
-        
-        # transition /initializing
-        _initializing_0 = Transition(self, self.states["/initializing"], [self.states["/running"]])
-        _initializing_0.setAction(self._initializing_0_exec)
-        _initializing_0.setTrigger(None)
-        self.states["/initializing"].addTransition(_initializing_0)
-        
-        # transition /running
-        _running_0 = Transition(self, self.states["/running"], [self.states["/running"]])
-        _running_0.setAction(self._running_0_exec)
-        _running_0.setTrigger(Event("mouse_click", "button_ui"))
-        _running_0.setGuard(self._running_0_guard)
-        self.states["/running"].addTransition(_running_0)
-    
-    def _initializing_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_created", None, [])]))
-    
-    def _running_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_pressed", None, [self.event_name])]))
-    
-    def _running_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/initializing"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Ball(RuntimeClassBase):
-    def __init__(self, controller, canvas, x, y):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["ball_ui"] = controller.addInputPort("ball_ui", self)
-        
-        # user defined attributes
-        self.canvas = None
-        
-        # call user defined constructor
-        Ball.user_defined_constructor(self, canvas, x, y)
-    
-    def user_defined_constructor(self, canvas, x, y):
-        self.canvas = canvas;
-        self.r = 20.0;
-        self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
-        self.mouse_pos = {};
-        self.smooth = 0.4; # value between 0 and 1
-        
-        circle = self.canvas.add_circle(x, y, self.r, {'fill':'#000'});
-        ui.bind_event(circle, ui.EVENTS.MOUSE_PRESS, self.controller, 'mouse_press', self.inports["ball_ui"]);
-        ui.bind_event(circle, ui.EVENTS.MOUSE_MOVE, self.controller, 'mouse_move', self.inports['ball_ui']);
-        ui.bind_event(circle, ui.EVENTS.MOUSE_RELEASE, self.controller, 'mouse_release', self.inports['ball_ui']);
-        self.element = circle;
-    
-    def user_defined_destructor(self):
-        self.canvas.remove_element(self.element);
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /main_behaviour
-        self.states["/main_behaviour"] = State(1, self)
-        
-        # state /main_behaviour/initializing
-        self.states["/main_behaviour/initializing"] = State(2, self)
-        
-        # state /main_behaviour/bouncing
-        self.states["/main_behaviour/bouncing"] = State(3, self)
-        self.states["/main_behaviour/bouncing"].setEnter(self._main_behaviour_bouncing_enter)
-        self.states["/main_behaviour/bouncing"].setExit(self._main_behaviour_bouncing_exit)
-        
-        # state /main_behaviour/dragging
-        self.states["/main_behaviour/dragging"] = State(4, self)
-        
-        # state /main_behaviour/selected
-        self.states["/main_behaviour/selected"] = State(5, self)
-        
-        # state /deleted
-        self.states["/deleted"] = State(6, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/main_behaviour"])
-        self.states[""].addChild(self.states["/deleted"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/initializing"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/bouncing"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/dragging"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/selected"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/main_behaviour"]
-        self.states["/main_behaviour"].default_state = self.states["/main_behaviour/initializing"]
-        
-        # transition /main_behaviour/initializing
-        _main_behaviour_initializing_0 = Transition(self, self.states["/main_behaviour/initializing"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_initializing_0.setAction(self._main_behaviour_initializing_0_exec)
-        _main_behaviour_initializing_0.setTrigger(Event("set_association_name", None))
-        self.states["/main_behaviour/initializing"].addTransition(_main_behaviour_initializing_0)
-        
-        # transition /main_behaviour/bouncing
-        _main_behaviour_bouncing_0 = Transition(self, self.states["/main_behaviour/bouncing"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_bouncing_0.setAction(self._main_behaviour_bouncing_0_exec)
-        _main_behaviour_bouncing_0.setTrigger(Event("_0after"))
-        self.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_0)
-        _main_behaviour_bouncing_1 = Transition(self, self.states["/main_behaviour/bouncing"], [self.states["/main_behaviour/selected"]])
-        _main_behaviour_bouncing_1.setAction(self._main_behaviour_bouncing_1_exec)
-        _main_behaviour_bouncing_1.setTrigger(Event("mouse_press", "ball_ui"))
-        _main_behaviour_bouncing_1.setGuard(self._main_behaviour_bouncing_1_guard)
-        self.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_1)
-        
-        # transition /main_behaviour/dragging
-        _main_behaviour_dragging_0 = Transition(self, self.states["/main_behaviour/dragging"], [self.states["/main_behaviour/dragging"]])
-        _main_behaviour_dragging_0.setAction(self._main_behaviour_dragging_0_exec)
-        _main_behaviour_dragging_0.setTrigger(Event("mouse_move", "ball_ui"))
-        self.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_0)
-        _main_behaviour_dragging_1 = Transition(self, self.states["/main_behaviour/dragging"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_dragging_1.setAction(self._main_behaviour_dragging_1_exec)
-        _main_behaviour_dragging_1.setTrigger(Event("mouse_release", "ball_ui"))
-        self.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_1)
-        
-        # transition /main_behaviour/selected
-        _main_behaviour_selected_0 = Transition(self, self.states["/main_behaviour/selected"], [self.states["/main_behaviour/dragging"]])
-        _main_behaviour_selected_0.setAction(self._main_behaviour_selected_0_exec)
-        _main_behaviour_selected_0.setTrigger(Event("mouse_press", "ball_ui"))
-        _main_behaviour_selected_0.setGuard(self._main_behaviour_selected_0_guard)
-        self.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_0)
-        _main_behaviour_selected_1 = Transition(self, self.states["/main_behaviour/selected"], [self.states["/deleted"]])
-        _main_behaviour_selected_1.setAction(self._main_behaviour_selected_1_exec)
-        _main_behaviour_selected_1.setTrigger(Event("delete_self", None))
-        self.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_1)
-    
-    def _main_behaviour_bouncing_enter(self):
-        self.addTimer(0, (20 - self.getSimulatedTime() % 20) / 1000.0)
-    
-    def _main_behaviour_bouncing_exit(self):
-        self.removeTimer(0)
-    
-    def _main_behaviour_initializing_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.association_name = association_name
-    
-    def _main_behaviour_bouncing_0_exec(self, parameters):
-        pos = self.element.get_position();    
-        if pos.x-self.r <= 0 or pos.x+self.r >= self.canvas.width :
-            self.vel['x'] = -self.vel['x'];
-        if pos.y-self.r <= 0 or pos.y+self.r >= self.canvas.height :
-            self.vel['y'] = -self.vel['y'];
-        self.element.move(self.vel['x'], self.vel['y']);
-    
-    def _main_behaviour_bouncing_1_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.element.set_color("#ff0");
-    
-    def _main_behaviour_bouncing_1_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _main_behaviour_dragging_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        dx = x - self.mouse_pos['x'];
-        dy = y - self.mouse_pos['y'];
-        
-        self.element.move(dx, dy);
-        
-        # keep ball within boundaries
-        pos = self.element.get_position();
-        if pos.x-self.r <= 0 :
-            pos.x = self.r + 1;
-        elif pos.x+self.r >= self.canvas.width :
-            pos.x = self.canvas.width-self.r-1;
-        if pos.y-self.r <= 0 :
-            pos.y = self.r + 1;
-        elif pos.y+self.r >= self.canvas.height :
-            pos.y = self.canvas.height-self.r-1;
-        self.element.set_position(pos.x, pos.y);
-        self.mouse_pos = {'x':x, 'y':y};
-        self.vel = {
-            'x': (1-self.smooth)*dx + self.smooth*self.vel['x'],
-            'y': (1-self.smooth)*dy + self.smooth*self.vel['y']
-        };
-    
-    def _main_behaviour_dragging_1_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        self.element.set_color("#f00");
-    
-    def _main_behaviour_selected_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.mouse_pos = {'x':x, 'y':y};
-    
-    def _main_behaviour_selected_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _main_behaviour_selected_1_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("delete_ball", None, [self.association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/main_behaviour"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-            instance.associations["fields"] = Association("Field", 0, -1)
-        elif class_name == "Field":
-            instance = Field(self.controller)
-            instance.associations = {}
-            instance.associations["balls"] = Association("Ball", 0, -1)
-            instance.associations["buttons"] = Association("Button", 0, -1)
-            instance.associations["parent"] = Association("MainApp", 1, 1)
-        elif class_name == "Button":
-            instance = Button(self.controller, construct_params[0], construct_params[1], construct_params[2])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Field", 1, 1)
-        elif class_name == "Ball":
-            instance = Ball(self.controller, construct_params[0], construct_params[1], construct_params[2])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Field", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 774
examples/bouncingballs/python/target_py/target_performance.py

@@ -1,774 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:51:00 2016
-
-Model author: Simon Van Mierlo+Raphael Mannadiar
-Model name:   Bouncing_Balls_Python_Version
-Model description:
-Tkinter frame with bouncing balls in it.
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.libs.ui import ui
-from sccd.runtime.libs.utils import utils
-import random
-
-# package "Bouncing_Balls_Python_Version"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.nr_of_fields = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = State(1, self)
-        
-        # state /running/root
-        self.states["/running/root"] = ParallelState(2, self)
-        
-        # state /running/root/main_behaviour
-        self.states["/running/root/main_behaviour"] = State(3, self)
-        
-        # state /running/root/main_behaviour/initializing
-        self.states["/running/root/main_behaviour/initializing"] = State(4, self)
-        
-        # state /running/root/main_behaviour/running
-        self.states["/running/root/main_behaviour/running"] = State(5, self)
-        
-        # state /running/root/cd_behaviour
-        self.states["/running/root/cd_behaviour"] = State(6, self)
-        
-        # state /running/root/cd_behaviour/waiting
-        self.states["/running/root/cd_behaviour/waiting"] = State(7, self)
-        
-        # state /running/root/cd_behaviour/creating
-        self.states["/running/root/cd_behaviour/creating"] = State(8, self)
-        
-        # state /running/root/cd_behaviour/check_nr_of_fields
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"] = State(9, self)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].setEnter(self._running_root_cd_behaviour_check_nr_of_fields_enter)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].setExit(self._running_root_cd_behaviour_check_nr_of_fields_exit)
-        
-        # state /running/root/spawn_windows
-        self.states["/running/root/spawn_windows"] = State(10, self)
-        
-        # state /running/root/spawn_windows/spawning
-        self.states["/running/root/spawn_windows/spawning"] = State(11, self)
-        self.states["/running/root/spawn_windows/spawning"].setEnter(self._running_root_spawn_windows_spawning_enter)
-        self.states["/running/root/spawn_windows/spawning"].setExit(self._running_root_spawn_windows_spawning_exit)
-        
-        # state /running/stopped
-        self.states["/running/stopped"] = State(12, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states["/running"].addChild(self.states["/running/root"])
-        self.states["/running"].addChild(self.states["/running/stopped"])
-        self.states["/running/root"].addChild(self.states["/running/root/main_behaviour"])
-        self.states["/running/root"].addChild(self.states["/running/root/cd_behaviour"])
-        self.states["/running/root"].addChild(self.states["/running/root/spawn_windows"])
-        self.states["/running/root/main_behaviour"].addChild(self.states["/running/root/main_behaviour/initializing"])
-        self.states["/running/root/main_behaviour"].addChild(self.states["/running/root/main_behaviour/running"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/waiting"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/creating"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/check_nr_of_fields"])
-        self.states["/running/root/spawn_windows"].addChild(self.states["/running/root/spawn_windows/spawning"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        self.states["/running"].default_state = self.states["/running/root"]
-        self.states["/running/root/main_behaviour"].default_state = self.states["/running/root/main_behaviour/initializing"]
-        self.states["/running/root/cd_behaviour"].default_state = self.states["/running/root/cd_behaviour/waiting"]
-        self.states["/running/root/spawn_windows"].default_state = self.states["/running/root/spawn_windows/spawning"]
-        
-        # transition /running/root/main_behaviour/initializing
-        _running_root_main_behaviour_initializing_0 = Transition(self, self.states["/running/root/main_behaviour/initializing"], [self.states["/running/root/main_behaviour/running"]])
-        _running_root_main_behaviour_initializing_0.setAction(self._running_root_main_behaviour_initializing_0_exec)
-        _running_root_main_behaviour_initializing_0.setTrigger(None)
-        self.states["/running/root/main_behaviour/initializing"].addTransition(_running_root_main_behaviour_initializing_0)
-        
-        # transition /running/root/main_behaviour/running
-        _running_root_main_behaviour_running_0 = Transition(self, self.states["/running/root/main_behaviour/running"], [self.states["/running/root/main_behaviour/running"]])
-        _running_root_main_behaviour_running_0.setAction(self._running_root_main_behaviour_running_0_exec)
-        _running_root_main_behaviour_running_0.setTrigger(Event("button_pressed", None))
-        _running_root_main_behaviour_running_0.setGuard(self._running_root_main_behaviour_running_0_guard)
-        self.states["/running/root/main_behaviour/running"].addTransition(_running_root_main_behaviour_running_0)
-        
-        # transition /running/root/cd_behaviour/waiting
-        _running_root_cd_behaviour_waiting_0 = Transition(self, self.states["/running/root/cd_behaviour/waiting"], [self.states["/running/root/cd_behaviour/creating"]])
-        _running_root_cd_behaviour_waiting_0.setAction(self._running_root_cd_behaviour_waiting_0_exec)
-        _running_root_cd_behaviour_waiting_0.setTrigger(Event("create_field", None))
-        self.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_0)
-        _running_root_cd_behaviour_waiting_1 = Transition(self, self.states["/running/root/cd_behaviour/waiting"], [self.states["/running/root/cd_behaviour/check_nr_of_fields"]])
-        _running_root_cd_behaviour_waiting_1.setAction(self._running_root_cd_behaviour_waiting_1_exec)
-        _running_root_cd_behaviour_waiting_1.setTrigger(Event("delete_field", None))
-        self.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_1)
-        
-        # transition /running/root/cd_behaviour/creating
-        _running_root_cd_behaviour_creating_0 = Transition(self, self.states["/running/root/cd_behaviour/creating"], [self.states["/running/root/cd_behaviour/waiting"]])
-        _running_root_cd_behaviour_creating_0.setAction(self._running_root_cd_behaviour_creating_0_exec)
-        _running_root_cd_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/running/root/cd_behaviour/creating"].addTransition(_running_root_cd_behaviour_creating_0)
-        
-        # transition /running/root/cd_behaviour/check_nr_of_fields
-        _running_root_cd_behaviour_check_nr_of_fields_0 = Transition(self, self.states["/running/root/cd_behaviour/check_nr_of_fields"], [self.states["/running/root/cd_behaviour/waiting"]])
-        _running_root_cd_behaviour_check_nr_of_fields_0.setTrigger(None)
-        _running_root_cd_behaviour_check_nr_of_fields_0.setGuard(self._running_root_cd_behaviour_check_nr_of_fields_0_guard)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_0)
-        _running_root_cd_behaviour_check_nr_of_fields_1 = Transition(self, self.states["/running/root/cd_behaviour/check_nr_of_fields"], [self.states["/running/stopped"]])
-        _running_root_cd_behaviour_check_nr_of_fields_1.setAction(self._running_root_cd_behaviour_check_nr_of_fields_1_exec)
-        _running_root_cd_behaviour_check_nr_of_fields_1.setTrigger(Event("_0after"))
-        _running_root_cd_behaviour_check_nr_of_fields_1.setGuard(self._running_root_cd_behaviour_check_nr_of_fields_1_guard)
-        self.states["/running/root/cd_behaviour/check_nr_of_fields"].addTransition(_running_root_cd_behaviour_check_nr_of_fields_1)
-        
-        # transition /running/root/spawn_windows/spawning
-        _running_root_spawn_windows_spawning_0 = Transition(self, self.states["/running/root/spawn_windows/spawning"], [self.states["/running/root/spawn_windows/spawning"]])
-        _running_root_spawn_windows_spawning_0.setAction(self._running_root_spawn_windows_spawning_0_exec)
-        _running_root_spawn_windows_spawning_0.setTrigger(Event("_1after"))
-        _running_root_spawn_windows_spawning_0.setGuard(self._running_root_spawn_windows_spawning_0_guard)
-        self.states["/running/root/spawn_windows/spawning"].addTransition(_running_root_spawn_windows_spawning_0)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_exit(self):
-        self.removeTimer(0)
-    
-    def _running_root_spawn_windows_spawning_enter(self):
-        self.addTimer(1, (1000 - self.getSimulatedTime() % 1000) / 1000.0)
-    
-    def _running_root_spawn_windows_spawning_exit(self):
-        self.removeTimer(1)
-    
-    def _running_root_main_behaviour_initializing_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("create_field", None, []))
-    
-    def _running_root_main_behaviour_running_0_exec(self, parameters):
-        event_name = parameters[0]
-        self.raiseInternalEvent(Event("create_field", None, []))
-    
-    def _running_root_main_behaviour_running_0_guard(self, parameters):
-        event_name = parameters[0]
-        return event_name == "create_new_field"
-    
-    def _running_root_cd_behaviour_waiting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "fields"]))
-    
-    def _running_root_cd_behaviour_waiting_1_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, association_name]))
-        self.nr_of_fields -= 1
-    
-    def _running_root_cd_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, association_name, Event("set_association_name", None, [association_name])]))
-        self.nr_of_fields += 1
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_0_guard(self, parameters):
-        return self.nr_of_fields != 0
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_1_exec(self, parameters):
-        ui.close_window(ui.window)
-    
-    def _running_root_cd_behaviour_check_nr_of_fields_1_guard(self, parameters):
-        return self.nr_of_fields == 0
-    
-    def _running_root_spawn_windows_spawning_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("button_pressed", None, ['create_new_field']))
-    
-    def _running_root_spawn_windows_spawning_0_guard(self, parameters):
-        return self.nr_of_fields < 10
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/running"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Field(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["field_ui"] = controller.addInputPort("field_ui", self)
-        
-        # user defined attributes
-        self.canvas = None
-        self.field_window = None
-        
-        # call user defined constructor
-        Field.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.field_window = ui.new_window(400,450);
-        self.canvas = ui.append_canvas(self.field_window,400,400,{'background':'#eee'});
-        ui.bind_event(self.field_window, ui.EVENTS.WINDOW_CLOSE, self.controller, 'window_close', self.inports['field_ui']);
-        ui.bind_event(self.field_window, ui.EVENTS.KEY_PRESS, self.controller, 'key_press', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_RIGHT_CLICK,    self.controller, 'right_click', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_MOVE, self.controller, 'mouse_move', self.inports['field_ui']);
-        ui.bind_event(self.canvas.element, ui.EVENTS.MOUSE_RELEASE, self.controller, 'mouse_release', self.inports['field_ui']);
-    
-    def user_defined_destructor(self):
-        ui.close_window(self.field_window);
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /root
-        self.states["/root"] = State(1, self)
-        
-        # state /root/waiting
-        self.states["/root/waiting"] = State(2, self)
-        
-        # state /root/initializing
-        self.states["/root/initializing"] = State(3, self)
-        
-        # state /root/creating
-        self.states["/root/creating"] = State(4, self)
-        
-        # state /root/packing
-        self.states["/root/packing"] = State(5, self)
-        
-        # state /root/running
-        self.states["/root/running"] = ParallelState(6, self)
-        
-        # state /root/running/main_behaviour
-        self.states["/root/running/main_behaviour"] = State(7, self)
-        
-        # state /root/running/main_behaviour/running
-        self.states["/root/running/main_behaviour/running"] = State(8, self)
-        
-        # state /root/running/main_behaviour/creating
-        self.states["/root/running/main_behaviour/creating"] = State(9, self)
-        
-        # state /root/running/deleting_behaviour
-        self.states["/root/running/deleting_behaviour"] = State(10, self)
-        
-        # state /root/running/deleting_behaviour/running
-        self.states["/root/running/deleting_behaviour/running"] = State(11, self)
-        
-        # state /root/running/child_behaviour
-        self.states["/root/running/child_behaviour"] = State(12, self)
-        
-        # state /root/running/child_behaviour/listening
-        self.states["/root/running/child_behaviour/listening"] = State(13, self)
-        
-        # state /root/running/deleting_balls_behaviour
-        self.states["/root/running/deleting_balls_behaviour"] = State(14, self)
-        
-        # state /root/running/deleting_balls_behaviour/listening
-        self.states["/root/running/deleting_balls_behaviour/listening"] = State(15, self)
-        
-        # state /root/running/spawn_balls
-        self.states["/root/running/spawn_balls"] = State(16, self)
-        
-        # state /root/running/spawn_balls/spawning
-        self.states["/root/running/spawn_balls/spawning"] = State(17, self)
-        self.states["/root/running/spawn_balls/spawning"].setEnter(self._root_running_spawn_balls_spawning_enter)
-        self.states["/root/running/spawn_balls/spawning"].setExit(self._root_running_spawn_balls_spawning_exit)
-        
-        # state /root/deleting
-        self.states["/root/deleting"] = State(18, self)
-        
-        # state /root/deleted
-        self.states["/root/deleted"] = State(19, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/root"])
-        self.states["/root"].addChild(self.states["/root/waiting"])
-        self.states["/root"].addChild(self.states["/root/initializing"])
-        self.states["/root"].addChild(self.states["/root/creating"])
-        self.states["/root"].addChild(self.states["/root/packing"])
-        self.states["/root"].addChild(self.states["/root/running"])
-        self.states["/root"].addChild(self.states["/root/deleting"])
-        self.states["/root"].addChild(self.states["/root/deleted"])
-        self.states["/root/running"].addChild(self.states["/root/running/main_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/deleting_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/child_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/deleting_balls_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/spawn_balls"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/running"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/creating"])
-        self.states["/root/running/deleting_behaviour"].addChild(self.states["/root/running/deleting_behaviour/running"])
-        self.states["/root/running/child_behaviour"].addChild(self.states["/root/running/child_behaviour/listening"])
-        self.states["/root/running/deleting_balls_behaviour"].addChild(self.states["/root/running/deleting_balls_behaviour/listening"])
-        self.states["/root/running/spawn_balls"].addChild(self.states["/root/running/spawn_balls/spawning"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/root"]
-        self.states["/root"].default_state = self.states["/root/waiting"]
-        self.states["/root/running/main_behaviour"].default_state = self.states["/root/running/main_behaviour/running"]
-        self.states["/root/running/deleting_behaviour"].default_state = self.states["/root/running/deleting_behaviour/running"]
-        self.states["/root/running/child_behaviour"].default_state = self.states["/root/running/child_behaviour/listening"]
-        self.states["/root/running/deleting_balls_behaviour"].default_state = self.states["/root/running/deleting_balls_behaviour/listening"]
-        self.states["/root/running/spawn_balls"].default_state = self.states["/root/running/spawn_balls/spawning"]
-        
-        # transition /root/waiting
-        _root_waiting_0 = Transition(self, self.states["/root/waiting"], [self.states["/root/initializing"]])
-        _root_waiting_0.setAction(self._root_waiting_0_exec)
-        _root_waiting_0.setTrigger(Event("set_association_name", None))
-        self.states["/root/waiting"].addTransition(_root_waiting_0)
-        
-        # transition /root/initializing
-        _root_initializing_0 = Transition(self, self.states["/root/initializing"], [self.states["/root/creating"]])
-        _root_initializing_0.setAction(self._root_initializing_0_exec)
-        _root_initializing_0.setTrigger(None)
-        self.states["/root/initializing"].addTransition(_root_initializing_0)
-        
-        # transition /root/creating
-        _root_creating_0 = Transition(self, self.states["/root/creating"], [self.states["/root/packing"]])
-        _root_creating_0.setAction(self._root_creating_0_exec)
-        _root_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/root/creating"].addTransition(_root_creating_0)
-        
-        # transition /root/packing
-        _root_packing_0 = Transition(self, self.states["/root/packing"], [self.states["/root/running"]])
-        _root_packing_0.setTrigger(Event("button_created", None))
-        self.states["/root/packing"].addTransition(_root_packing_0)
-        
-        # transition /root/running/main_behaviour/running
-        _root_running_main_behaviour_running_0 = Transition(self, self.states["/root/running/main_behaviour/running"], [self.states["/root/running/main_behaviour/creating"]])
-        _root_running_main_behaviour_running_0.setAction(self._root_running_main_behaviour_running_0_exec)
-        _root_running_main_behaviour_running_0.setTrigger(Event("right_click", None))
-        self.states["/root/running/main_behaviour/running"].addTransition(_root_running_main_behaviour_running_0)
-        
-        # transition /root/running/main_behaviour/creating
-        _root_running_main_behaviour_creating_0 = Transition(self, self.states["/root/running/main_behaviour/creating"], [self.states["/root/running/main_behaviour/running"]])
-        _root_running_main_behaviour_creating_0.setAction(self._root_running_main_behaviour_creating_0_exec)
-        _root_running_main_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/root/running/main_behaviour/creating"].addTransition(_root_running_main_behaviour_creating_0)
-        
-        # transition /root/running/deleting_behaviour/running
-        _root_running_deleting_behaviour_running_0 = Transition(self, self.states["/root/running/deleting_behaviour/running"], [self.states["/root/running/deleting_behaviour/running"]])
-        _root_running_deleting_behaviour_running_0.setAction(self._root_running_deleting_behaviour_running_0_exec)
-        _root_running_deleting_behaviour_running_0.setTrigger(Event("delete_ball", None))
-        self.states["/root/running/deleting_behaviour/running"].addTransition(_root_running_deleting_behaviour_running_0)
-        
-        # transition /root/running/child_behaviour/listening
-        _root_running_child_behaviour_listening_0 = Transition(self, self.states["/root/running/child_behaviour/listening"], [self.states["/root/running/child_behaviour/listening"]])
-        _root_running_child_behaviour_listening_0.setAction(self._root_running_child_behaviour_listening_0_exec)
-        _root_running_child_behaviour_listening_0.setTrigger(Event("button_pressed", None))
-        self.states["/root/running/child_behaviour/listening"].addTransition(_root_running_child_behaviour_listening_0)
-        
-        # transition /root/running/deleting_balls_behaviour/listening
-        _root_running_deleting_balls_behaviour_listening_0 = Transition(self, self.states["/root/running/deleting_balls_behaviour/listening"], [self.states["/root/running/deleting_balls_behaviour/listening"]])
-        _root_running_deleting_balls_behaviour_listening_0.setAction(self._root_running_deleting_balls_behaviour_listening_0_exec)
-        _root_running_deleting_balls_behaviour_listening_0.setTrigger(Event("key_press", "field_ui"))
-        _root_running_deleting_balls_behaviour_listening_0.setGuard(self._root_running_deleting_balls_behaviour_listening_0_guard)
-        self.states["/root/running/deleting_balls_behaviour/listening"].addTransition(_root_running_deleting_balls_behaviour_listening_0)
-        
-        # transition /root/running/spawn_balls/spawning
-        _root_running_spawn_balls_spawning_0 = Transition(self, self.states["/root/running/spawn_balls/spawning"], [self.states["/root/running/spawn_balls/spawning"]])
-        _root_running_spawn_balls_spawning_0.setAction(self._root_running_spawn_balls_spawning_0_exec)
-        _root_running_spawn_balls_spawning_0.setTrigger(Event("_0after"))
-        self.states["/root/running/spawn_balls/spawning"].addTransition(_root_running_spawn_balls_spawning_0)
-        
-        # transition /root/deleting
-        _root_deleting_0 = Transition(self, self.states["/root/deleting"], [self.states["/root/deleted"]])
-        _root_deleting_0.setAction(self._root_deleting_0_exec)
-        _root_deleting_0.setTrigger(None)
-        self.states["/root/deleting"].addTransition(_root_deleting_0)
-        
-        # transition /root/running
-        _root_running_0 = Transition(self, self.states["/root/running"], [self.states["/root/deleting"]])
-        _root_running_0.setAction(self._root_running_0_exec)
-        _root_running_0.setTrigger(Event("window_close", "field_ui"))
-        self.states["/root/running"].addTransition(_root_running_0)
-    
-    def _root_running_spawn_balls_spawning_enter(self):
-        self.addTimer(0, (50 - self.getSimulatedTime() % 50) / 1000.0)
-    
-    def _root_running_spawn_balls_spawning_exit(self):
-        self.removeTimer(0)
-    
-    def _root_running_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, "buttons"]))
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, "balls"]))
-    
-    def _root_waiting_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.association_name = association_name
-    
-    def _root_initializing_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "buttons", "Button", self, 'create_new_field', 'Spawn New Window']))
-    
-    def _root_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-    
-    def _root_running_main_behaviour_running_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "balls", "Ball", self.canvas, x, y]))
-    
-    def _root_running_main_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, association_name, Event("set_association_name", None, [association_name])]))
-    
-    def _root_running_deleting_behaviour_running_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, association_name]))
-    
-    def _root_running_child_behaviour_listening_0_exec(self, parameters):
-        event_name = parameters[0]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_pressed", None, [event_name])]))
-    
-    def _root_running_deleting_balls_behaviour_listening_0_exec(self, parameters):
-        key = parameters[0]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'balls', Event("delete_self", None, [])]))
-    
-    def _root_running_deleting_balls_behaviour_listening_0_guard(self, parameters):
-        key = parameters[0]
-        return key == ui.KEYCODES.DELETE
-    
-    def _root_running_spawn_balls_spawning_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("right_click", None, [150, 150, None]))
-    
-    def _root_deleting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("delete_field", None, [self.association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/root"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Button(RuntimeClassBase):
-    def __init__(self, controller, parent, event_name, button_text):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["button_ui"] = controller.addInputPort("button_ui", self)
-        
-        # call user defined constructor
-        Button.user_defined_constructor(self, parent, event_name, button_text)
-    
-    def user_defined_constructor(self, parent, event_name, button_text):
-        self.event_name = event_name;
-        button = ui.append_button(parent.field_window, event_name);
-        ui.bind_event(button.element, ui.EVENTS.MOUSE_CLICK, self.controller, 'mouse_click', self.inports['button_ui']);
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /initializing
-        self.states["/initializing"] = State(1, self)
-        
-        # state /running
-        self.states["/running"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/initializing"])
-        self.states[""].addChild(self.states["/running"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/initializing"]
-        
-        # transition /initializing
-        _initializing_0 = Transition(self, self.states["/initializing"], [self.states["/running"]])
-        _initializing_0.setAction(self._initializing_0_exec)
-        _initializing_0.setTrigger(None)
-        self.states["/initializing"].addTransition(_initializing_0)
-        
-        # transition /running
-        _running_0 = Transition(self, self.states["/running"], [self.states["/running"]])
-        _running_0.setAction(self._running_0_exec)
-        _running_0.setTrigger(Event("mouse_click", "button_ui"))
-        _running_0.setGuard(self._running_0_guard)
-        self.states["/running"].addTransition(_running_0)
-    
-    def _initializing_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_created", None, [])]))
-    
-    def _running_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("button_pressed", None, [self.event_name])]))
-    
-    def _running_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/initializing"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Ball(RuntimeClassBase):
-    def __init__(self, controller, canvas, x, y):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        self.inports["ball_ui"] = controller.addInputPort("ball_ui", self)
-        
-        # user defined attributes
-        self.canvas = None
-        
-        # call user defined constructor
-        Ball.user_defined_constructor(self, canvas, x, y)
-    
-    def user_defined_constructor(self, canvas, x, y):
-        self.canvas = canvas;
-        self.r = 20.0;
-        self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
-        self.mouse_pos = {};
-        self.smooth = 0.4; # value between 0 and 1
-        
-        circle = self.canvas.add_circle(x, y, self.r, {'fill':'#000'});
-        ui.bind_event(circle, ui.EVENTS.MOUSE_PRESS, self.controller, 'mouse_press', self.inports["ball_ui"]);
-        ui.bind_event(circle, ui.EVENTS.MOUSE_MOVE, self.controller, 'mouse_move', self.inports['ball_ui']);
-        ui.bind_event(circle, ui.EVENTS.MOUSE_RELEASE, self.controller, 'mouse_release', self.inports['ball_ui']);
-        self.element = circle;
-    
-    def user_defined_destructor(self):
-        self.canvas.remove_element(self.element);
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /main_behaviour
-        self.states["/main_behaviour"] = State(1, self)
-        
-        # state /main_behaviour/initializing
-        self.states["/main_behaviour/initializing"] = State(2, self)
-        
-        # state /main_behaviour/bouncing
-        self.states["/main_behaviour/bouncing"] = State(3, self)
-        self.states["/main_behaviour/bouncing"].setEnter(self._main_behaviour_bouncing_enter)
-        self.states["/main_behaviour/bouncing"].setExit(self._main_behaviour_bouncing_exit)
-        
-        # state /main_behaviour/dragging
-        self.states["/main_behaviour/dragging"] = State(4, self)
-        
-        # state /main_behaviour/selected
-        self.states["/main_behaviour/selected"] = State(5, self)
-        
-        # state /deleted
-        self.states["/deleted"] = State(6, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/main_behaviour"])
-        self.states[""].addChild(self.states["/deleted"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/initializing"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/bouncing"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/dragging"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/selected"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/main_behaviour"]
-        self.states["/main_behaviour"].default_state = self.states["/main_behaviour/initializing"]
-        
-        # transition /main_behaviour/initializing
-        _main_behaviour_initializing_0 = Transition(self, self.states["/main_behaviour/initializing"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_initializing_0.setAction(self._main_behaviour_initializing_0_exec)
-        _main_behaviour_initializing_0.setTrigger(Event("set_association_name", None))
-        self.states["/main_behaviour/initializing"].addTransition(_main_behaviour_initializing_0)
-        
-        # transition /main_behaviour/bouncing
-        _main_behaviour_bouncing_0 = Transition(self, self.states["/main_behaviour/bouncing"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_bouncing_0.setAction(self._main_behaviour_bouncing_0_exec)
-        _main_behaviour_bouncing_0.setTrigger(Event("_0after"))
-        self.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_0)
-        _main_behaviour_bouncing_1 = Transition(self, self.states["/main_behaviour/bouncing"], [self.states["/main_behaviour/selected"]])
-        _main_behaviour_bouncing_1.setAction(self._main_behaviour_bouncing_1_exec)
-        _main_behaviour_bouncing_1.setTrigger(Event("mouse_press", "ball_ui"))
-        _main_behaviour_bouncing_1.setGuard(self._main_behaviour_bouncing_1_guard)
-        self.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_1)
-        
-        # transition /main_behaviour/dragging
-        _main_behaviour_dragging_0 = Transition(self, self.states["/main_behaviour/dragging"], [self.states["/main_behaviour/dragging"]])
-        _main_behaviour_dragging_0.setAction(self._main_behaviour_dragging_0_exec)
-        _main_behaviour_dragging_0.setTrigger(Event("mouse_move", "ball_ui"))
-        self.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_0)
-        _main_behaviour_dragging_1 = Transition(self, self.states["/main_behaviour/dragging"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_dragging_1.setAction(self._main_behaviour_dragging_1_exec)
-        _main_behaviour_dragging_1.setTrigger(Event("mouse_release", "ball_ui"))
-        self.states["/main_behaviour/dragging"].addTransition(_main_behaviour_dragging_1)
-        
-        # transition /main_behaviour/selected
-        _main_behaviour_selected_0 = Transition(self, self.states["/main_behaviour/selected"], [self.states["/main_behaviour/dragging"]])
-        _main_behaviour_selected_0.setAction(self._main_behaviour_selected_0_exec)
-        _main_behaviour_selected_0.setTrigger(Event("mouse_press", "ball_ui"))
-        _main_behaviour_selected_0.setGuard(self._main_behaviour_selected_0_guard)
-        self.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_0)
-        _main_behaviour_selected_1 = Transition(self, self.states["/main_behaviour/selected"], [self.states["/deleted"]])
-        _main_behaviour_selected_1.setAction(self._main_behaviour_selected_1_exec)
-        _main_behaviour_selected_1.setTrigger(Event("delete_self", None))
-        self.states["/main_behaviour/selected"].addTransition(_main_behaviour_selected_1)
-    
-    def _main_behaviour_bouncing_enter(self):
-        self.addTimer(0, (20 - self.getSimulatedTime() % 20) / 1000.0)
-    
-    def _main_behaviour_bouncing_exit(self):
-        self.removeTimer(0)
-    
-    def _main_behaviour_initializing_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.association_name = association_name
-    
-    def _main_behaviour_bouncing_0_exec(self, parameters):
-        pos = self.element.get_position();    
-        if pos.x-self.r <= 0 or pos.x+self.r >= self.canvas.width :
-            self.vel['x'] = -self.vel['x'];
-        if pos.y-self.r <= 0 or pos.y+self.r >= self.canvas.height :
-            self.vel['y'] = -self.vel['y'];
-        self.element.move(self.vel['x'], self.vel['y']);
-    
-    def _main_behaviour_bouncing_1_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.element.set_color("#ff0");
-    
-    def _main_behaviour_bouncing_1_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _main_behaviour_dragging_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        dx = x - self.mouse_pos['x'];
-        dy = y - self.mouse_pos['y'];
-        
-        self.element.move(dx, dy);
-        
-        # keep ball within boundaries
-        pos = self.element.get_position();
-        if pos.x-self.r <= 0 :
-            pos.x = self.r + 1;
-        elif pos.x+self.r >= self.canvas.width :
-            pos.x = self.canvas.width-self.r-1;
-        if pos.y-self.r <= 0 :
-            pos.y = self.r + 1;
-        elif pos.y+self.r >= self.canvas.height :
-            pos.y = self.canvas.height-self.r-1;
-        self.element.set_position(pos.x, pos.y);
-        self.mouse_pos = {'x':x, 'y':y};
-        self.vel = {
-            'x': (1-self.smooth)*dx + self.smooth*self.vel['x'],
-            'y': (1-self.smooth)*dy + self.smooth*self.vel['y']
-        };
-    
-    def _main_behaviour_dragging_1_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        self.element.set_color("#f00");
-    
-    def _main_behaviour_selected_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.mouse_pos = {'x':x, 'y':y};
-    
-    def _main_behaviour_selected_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _main_behaviour_selected_1_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("delete_ball", None, [self.association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/main_behaviour"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-            instance.associations["fields"] = Association("Field", 0, -1)
-        elif class_name == "Field":
-            instance = Field(self.controller)
-            instance.associations = {}
-            instance.associations["balls"] = Association("Ball", 0, -1)
-            instance.associations["buttons"] = Association("Button", 0, -1)
-            instance.associations["parent"] = Association("MainApp", 1, 1)
-        elif class_name == "Button":
-            instance = Button(self.controller, construct_params[0], construct_params[1], construct_params[2])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Field", 1, 1)
-        elif class_name == "Ball":
-            instance = Ball(self.controller, construct_params[0], construct_params[1], construct_params[2])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Field", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 355
examples/bouncingballs/python/target_py/target_performance_threads.py

@@ -1,355 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 10:51:10 2016
-
-Model author: Simon Van Mierlo+Raphael Mannadiar
-Model name:   Bouncing_Balls_Python_Version
-Model description:
-Tkinter frame with bouncing balls in it.
-"""
-
-from sccd.runtime.statecharts_core import *
-import random, sys
-
-# package "Bouncing_Balls_Python_Version"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.nr_of_fields = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = State(1, self)
-        
-        # state /running/root
-        self.states["/running/root"] = ParallelState(2, self)
-        
-        # state /running/root/cd_behaviour
-        self.states["/running/root/cd_behaviour"] = State(3, self)
-        
-        # state /running/root/cd_behaviour/waiting
-        self.states["/running/root/cd_behaviour/waiting"] = State(4, self)
-        
-        # state /running/root/cd_behaviour/creating
-        self.states["/running/root/cd_behaviour/creating"] = State(5, self)
-        
-        # state /running/root/spawn_windows
-        self.states["/running/root/spawn_windows"] = State(6, self)
-        
-        # state /running/root/spawn_windows/spawning
-        self.states["/running/root/spawn_windows/spawning"] = State(7, self)
-        self.states["/running/root/spawn_windows/spawning"].setEnter(self._running_root_spawn_windows_spawning_enter)
-        self.states["/running/root/spawn_windows/spawning"].setExit(self._running_root_spawn_windows_spawning_exit)
-        
-        # state /running/stopped
-        self.states["/running/stopped"] = State(8, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states["/running"].addChild(self.states["/running/root"])
-        self.states["/running"].addChild(self.states["/running/stopped"])
-        self.states["/running/root"].addChild(self.states["/running/root/cd_behaviour"])
-        self.states["/running/root"].addChild(self.states["/running/root/spawn_windows"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/waiting"])
-        self.states["/running/root/cd_behaviour"].addChild(self.states["/running/root/cd_behaviour/creating"])
-        self.states["/running/root/spawn_windows"].addChild(self.states["/running/root/spawn_windows/spawning"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        self.states["/running"].default_state = self.states["/running/root"]
-        self.states["/running/root/cd_behaviour"].default_state = self.states["/running/root/cd_behaviour/waiting"]
-        self.states["/running/root/spawn_windows"].default_state = self.states["/running/root/spawn_windows/spawning"]
-        
-        # transition /running/root/cd_behaviour/waiting
-        _running_root_cd_behaviour_waiting_0 = Transition(self, self.states["/running/root/cd_behaviour/waiting"], [self.states["/running/root/cd_behaviour/creating"]])
-        _running_root_cd_behaviour_waiting_0.setAction(self._running_root_cd_behaviour_waiting_0_exec)
-        _running_root_cd_behaviour_waiting_0.setTrigger(Event("create_field", None))
-        self.states["/running/root/cd_behaviour/waiting"].addTransition(_running_root_cd_behaviour_waiting_0)
-        
-        # transition /running/root/cd_behaviour/creating
-        _running_root_cd_behaviour_creating_0 = Transition(self, self.states["/running/root/cd_behaviour/creating"], [self.states["/running/root/cd_behaviour/waiting"]])
-        _running_root_cd_behaviour_creating_0.setAction(self._running_root_cd_behaviour_creating_0_exec)
-        _running_root_cd_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/running/root/cd_behaviour/creating"].addTransition(_running_root_cd_behaviour_creating_0)
-        
-        # transition /running/root/spawn_windows/spawning
-        _running_root_spawn_windows_spawning_0 = Transition(self, self.states["/running/root/spawn_windows/spawning"], [self.states["/running/root/spawn_windows/spawning"]])
-        _running_root_spawn_windows_spawning_0.setAction(self._running_root_spawn_windows_spawning_0_exec)
-        _running_root_spawn_windows_spawning_0.setTrigger(Event("_0after"))
-        _running_root_spawn_windows_spawning_0.setGuard(self._running_root_spawn_windows_spawning_0_guard)
-        self.states["/running/root/spawn_windows/spawning"].addTransition(_running_root_spawn_windows_spawning_0)
-    
-    def _running_root_spawn_windows_spawning_enter(self):
-        self.addTimer(0, (1000 - self.getSimulatedTime() % 1000) / 1000.0)
-    
-    def _running_root_spawn_windows_spawning_exit(self):
-        self.removeTimer(0)
-    
-    def _running_root_cd_behaviour_waiting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "fields"]))
-    
-    def _running_root_cd_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-    
-    def _running_root_spawn_windows_spawning_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("create_field", None, []))
-    
-    def _running_root_spawn_windows_spawning_0_guard(self, parameters):
-        return self.nr_of_fields < 10
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/running"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Field(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Field.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /root
-        self.states["/root"] = State(1, self)
-        
-        # state /root/running
-        self.states["/root/running"] = ParallelState(2, self)
-        
-        # state /root/running/main_behaviour
-        self.states["/root/running/main_behaviour"] = State(3, self)
-        
-        # state /root/running/main_behaviour/running
-        self.states["/root/running/main_behaviour/running"] = State(4, self)
-        
-        # state /root/running/main_behaviour/creating
-        self.states["/root/running/main_behaviour/creating"] = State(5, self)
-        
-        # state /root/running/spawn_balls
-        self.states["/root/running/spawn_balls"] = State(6, self)
-        
-        # state /root/running/spawn_balls/spawning
-        self.states["/root/running/spawn_balls/spawning"] = State(7, self)
-        self.states["/root/running/spawn_balls/spawning"].setEnter(self._root_running_spawn_balls_spawning_enter)
-        self.states["/root/running/spawn_balls/spawning"].setExit(self._root_running_spawn_balls_spawning_exit)
-        
-        # state /root/deleting
-        self.states["/root/deleting"] = State(8, self)
-        
-        # state /root/deleted
-        self.states["/root/deleted"] = State(9, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/root"])
-        self.states["/root"].addChild(self.states["/root/running"])
-        self.states["/root"].addChild(self.states["/root/deleting"])
-        self.states["/root"].addChild(self.states["/root/deleted"])
-        self.states["/root/running"].addChild(self.states["/root/running/main_behaviour"])
-        self.states["/root/running"].addChild(self.states["/root/running/spawn_balls"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/running"])
-        self.states["/root/running/main_behaviour"].addChild(self.states["/root/running/main_behaviour/creating"])
-        self.states["/root/running/spawn_balls"].addChild(self.states["/root/running/spawn_balls/spawning"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/root"]
-        self.states["/root"].default_state = self.states["/root/running"]
-        self.states["/root/running/main_behaviour"].default_state = self.states["/root/running/main_behaviour/running"]
-        self.states["/root/running/spawn_balls"].default_state = self.states["/root/running/spawn_balls/spawning"]
-        
-        # transition /root/running/main_behaviour/running
-        _root_running_main_behaviour_running_0 = Transition(self, self.states["/root/running/main_behaviour/running"], [self.states["/root/running/main_behaviour/creating"]])
-        _root_running_main_behaviour_running_0.setAction(self._root_running_main_behaviour_running_0_exec)
-        _root_running_main_behaviour_running_0.setTrigger(Event("spawn_ball", None))
-        self.states["/root/running/main_behaviour/running"].addTransition(_root_running_main_behaviour_running_0)
-        
-        # transition /root/running/main_behaviour/creating
-        _root_running_main_behaviour_creating_0 = Transition(self, self.states["/root/running/main_behaviour/creating"], [self.states["/root/running/main_behaviour/running"]])
-        _root_running_main_behaviour_creating_0.setAction(self._root_running_main_behaviour_creating_0_exec)
-        _root_running_main_behaviour_creating_0.setTrigger(Event("instance_created", None))
-        self.states["/root/running/main_behaviour/creating"].addTransition(_root_running_main_behaviour_creating_0)
-        
-        # transition /root/running/spawn_balls/spawning
-        _root_running_spawn_balls_spawning_0 = Transition(self, self.states["/root/running/spawn_balls/spawning"], [self.states["/root/running/spawn_balls/spawning"]])
-        _root_running_spawn_balls_spawning_0.setAction(self._root_running_spawn_balls_spawning_0_exec)
-        _root_running_spawn_balls_spawning_0.setTrigger(Event("_0after"))
-        self.states["/root/running/spawn_balls/spawning"].addTransition(_root_running_spawn_balls_spawning_0)
-        
-        # transition /root/deleting
-        _root_deleting_0 = Transition(self, self.states["/root/deleting"], [self.states["/root/deleted"]])
-        _root_deleting_0.setAction(self._root_deleting_0_exec)
-        _root_deleting_0.setTrigger(None)
-        self.states["/root/deleting"].addTransition(_root_deleting_0)
-    
-    def _root_running_spawn_balls_spawning_enter(self):
-        self.addTimer(0, (50 - self.getSimulatedTime() % 50) / 1000.0)
-    
-    def _root_running_spawn_balls_spawning_exit(self):
-        self.removeTimer(0)
-    
-    def _root_running_main_behaviour_running_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "balls", "Ball", x, y]))
-    
-    def _root_running_main_behaviour_creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-    
-    def _root_running_spawn_balls_spawning_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("spawn_ball", None, [150, 150]))
-    
-    def _root_deleting_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("delete_field", None, [self.association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/root"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Ball(RuntimeClassBase):
-    def __init__(self, controller, x, y):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Ball.user_defined_constructor(self, x, y)
-    
-    def user_defined_constructor(self, x, y):
-        self.r = 20.0;
-        self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
-        self.mouse_pos = {};
-        self.smooth = 0.4; # value between 0 and 1
-        self.pos = {'x': x, 'y': y}
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /main_behaviour
-        self.states["/main_behaviour"] = State(1, self)
-        
-        # state /main_behaviour/bouncing
-        self.states["/main_behaviour/bouncing"] = State(2, self)
-        self.states["/main_behaviour/bouncing"].setEnter(self._main_behaviour_bouncing_enter)
-        self.states["/main_behaviour/bouncing"].setExit(self._main_behaviour_bouncing_exit)
-        
-        # add children
-        self.states[""].addChild(self.states["/main_behaviour"])
-        self.states["/main_behaviour"].addChild(self.states["/main_behaviour/bouncing"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/main_behaviour"]
-        self.states["/main_behaviour"].default_state = self.states["/main_behaviour/bouncing"]
-        
-        # transition /main_behaviour/bouncing
-        _main_behaviour_bouncing_0 = Transition(self, self.states["/main_behaviour/bouncing"], [self.states["/main_behaviour/bouncing"]])
-        _main_behaviour_bouncing_0.setAction(self._main_behaviour_bouncing_0_exec)
-        _main_behaviour_bouncing_0.setTrigger(Event("_0after"))
-        self.states["/main_behaviour/bouncing"].addTransition(_main_behaviour_bouncing_0)
-    
-    def _main_behaviour_bouncing_enter(self):
-        self.addTimer(0, (20 - self.getSimulatedTime() % 20) / 1000.0)
-    
-    def _main_behaviour_bouncing_exit(self):
-        self.removeTimer(0)
-    
-    def _main_behaviour_bouncing_0_exec(self, parameters):
-        self.pos
-        if self.pos['x'] - self.r <= 0 or self.pos['x'] + self.r >= 800 :
-            self.vel['x'] = -self.vel['x'];
-        if self.pos['y'] - self.r <= 0 or self.pos['y'] + self.r >= 600 :
-            self.vel['y'] = -self.vel['y'];
-        self.pos['x'] += self.vel['x']
-        self.pos['y'] += self.vel['y']
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/main_behaviour"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-            instance.associations["fields"] = Association("Field", 0, -1)
-        elif class_name == "Field":
-            instance = Field(self.controller)
-            instance.associations = {}
-            instance.associations["balls"] = Association("Ball", 0, -1)
-            instance.associations["parent"] = Association("MainApp", 1, 1)
-        elif class_name == "Ball":
-            instance = Ball(self.controller, construct_params[0], construct_params[1])
-            instance.associations = {}
-            instance.associations["parent"] = Association("Field", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.object_manager.createInstance("MainApp", [])

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 1734
examples/tanks/ai_controller.py


+ 0 - 515
examples/tanks/player_controller.py

@@ -1,515 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:35 2016
-
-Model author: Glenn De Jonghe
-Model name:   Player Tank
-Model description:
-Handling the player tank.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "Player Tank"
-
-class Main(RuntimeClassBase):
-    def __init__(self, controller, tank):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # user defined attributes
-        self.tank = None
-        
-        # call user defined constructor
-        Main.user_defined_constructor(self, tank)
-    
-    def user_defined_constructor(self, tank):
-        self.tank = tank
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /state_1
-        self.states["/state_1"] = State(1, self)
-        
-        # state /state_2
-        self.states["/state_2"] = State(2, self)
-        
-        # state /state_3
-        self.states["/state_3"] = State(3, self)
-        
-        # state /state_4
-        self.states["/state_4"] = State(4, self)
-        
-        # state /end
-        self.states["/end"] = State(5, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state_1"])
-        self.states[""].addChild(self.states["/state_2"])
-        self.states[""].addChild(self.states["/state_3"])
-        self.states[""].addChild(self.states["/state_4"])
-        self.states[""].addChild(self.states["/end"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state_1"]
-        
-        # transition /state_1
-        _state_1_0 = Transition(self, self.states["/state_1"], [self.states["/state_2"]])
-        _state_1_0.setAction(self._state_1_0_exec)
-        _state_1_0.setTrigger(None)
-        self.states["/state_1"].addTransition(_state_1_0)
-        
-        # transition /state_2
-        _state_2_0 = Transition(self, self.states["/state_2"], [self.states["/state_3"]])
-        _state_2_0.setTrigger(Event("instance_created", None))
-        self.states["/state_2"].addTransition(_state_2_0)
-        
-        # transition /state_3
-        _state_3_0 = Transition(self, self.states["/state_3"], [self.states["/state_4"]])
-        _state_3_0.setAction(self._state_3_0_exec)
-        _state_3_0.setTrigger(None)
-        self.states["/state_3"].addTransition(_state_3_0)
-        
-        # transition /state_4
-        _state_4_0 = Transition(self, self.states["/state_4"], [self.states["/end"]])
-        _state_4_0.setAction(self._state_4_0_exec)
-        _state_4_0.setTrigger(Event("instance_created", None))
-        self.states["/state_4"].addTransition(_state_4_0)
-    
-    def _state_1_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'cannon', 'Cannon', self.tank]))
-    
-    def _state_3_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'body', 'Body', self.tank]))
-    
-    def _state_4_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("start_instance", None, [self, 'cannon']))
-        self.big_step.outputEventOM(Event("start_instance", None, [self, 'body']))
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/state_1"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class Cannon(RuntimeClassBase):
-    def __init__(self, controller, tank):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # user defined attributes
-        self.tank = None
-        self.reload_time = None
-        
-        # call user defined constructor
-        Cannon.user_defined_constructor(self, tank)
-    
-    def user_defined_constructor(self, tank):
-        self.tank = tank
-        self.reload_time = tank.getReloadTime()
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /container
-        self.states["/container"] = ParallelState(1, self)
-        
-        # state /container/rotating
-        self.states["/container/rotating"] = State(2, self)
-        
-        # state /container/rotating/none
-        self.states["/container/rotating/none"] = State(3, self)
-        
-        # state /container/rotating/left
-        self.states["/container/rotating/left"] = State(4, self)
-        
-        # state /container/rotating/both
-        self.states["/container/rotating/both"] = State(5, self)
-        
-        # state /container/rotating/right
-        self.states["/container/rotating/right"] = State(6, self)
-        
-        # state /container/shoot
-        self.states["/container/shoot"] = State(7, self)
-        
-        # state /container/shoot/hold
-        self.states["/container/shoot/hold"] = State(8, self)
-        
-        # state /container/shoot/shoot
-        self.states["/container/shoot/shoot"] = State(9, self)
-        
-        # state /container/ammo
-        self.states["/container/ammo"] = State(10, self)
-        
-        # state /container/ammo/loaded
-        self.states["/container/ammo/loaded"] = State(11, self)
-        
-        # state /container/ammo/unloaded
-        self.states["/container/ammo/unloaded"] = State(12, self)
-        self.states["/container/ammo/unloaded"].setEnter(self._container_ammo_unloaded_enter)
-        self.states["/container/ammo/unloaded"].setExit(self._container_ammo_unloaded_exit)
-        
-        # add children
-        self.states[""].addChild(self.states["/container"])
-        self.states["/container"].addChild(self.states["/container/rotating"])
-        self.states["/container"].addChild(self.states["/container/shoot"])
-        self.states["/container"].addChild(self.states["/container/ammo"])
-        self.states["/container/rotating"].addChild(self.states["/container/rotating/none"])
-        self.states["/container/rotating"].addChild(self.states["/container/rotating/left"])
-        self.states["/container/rotating"].addChild(self.states["/container/rotating/both"])
-        self.states["/container/rotating"].addChild(self.states["/container/rotating/right"])
-        self.states["/container/shoot"].addChild(self.states["/container/shoot/hold"])
-        self.states["/container/shoot"].addChild(self.states["/container/shoot/shoot"])
-        self.states["/container/ammo"].addChild(self.states["/container/ammo/loaded"])
-        self.states["/container/ammo"].addChild(self.states["/container/ammo/unloaded"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/container"]
-        self.states["/container/rotating"].default_state = self.states["/container/rotating/none"]
-        self.states["/container/shoot"].default_state = self.states["/container/shoot/hold"]
-        self.states["/container/ammo"].default_state = self.states["/container/ammo/loaded"]
-        
-        # transition /container/rotating/none
-        _container_rotating_none_0 = Transition(self, self.states["/container/rotating/none"], [self.states["/container/rotating/left"]])
-        _container_rotating_none_0.setTrigger(Event("cannon-left-pressed", "input"))
-        self.states["/container/rotating/none"].addTransition(_container_rotating_none_0)
-        _container_rotating_none_1 = Transition(self, self.states["/container/rotating/none"], [self.states["/container/rotating/right"]])
-        _container_rotating_none_1.setTrigger(Event("cannon-right-pressed", "input"))
-        self.states["/container/rotating/none"].addTransition(_container_rotating_none_1)
-        
-        # transition /container/rotating/left
-        _container_rotating_left_0 = Transition(self, self.states["/container/rotating/left"], [self.states["/container/rotating/none"]])
-        _container_rotating_left_0.setTrigger(Event("cannon-left-released", "input"))
-        self.states["/container/rotating/left"].addTransition(_container_rotating_left_0)
-        _container_rotating_left_1 = Transition(self, self.states["/container/rotating/left"], [self.states["/container/rotating/both"]])
-        _container_rotating_left_1.setTrigger(Event("cannon-right-pressed", "input"))
-        self.states["/container/rotating/left"].addTransition(_container_rotating_left_1)
-        _container_rotating_left_2 = Transition(self, self.states["/container/rotating/left"], [self.states["/container/rotating/left"]])
-        _container_rotating_left_2.setAction(self._container_rotating_left_2_exec)
-        _container_rotating_left_2.setTrigger(Event("update", "engine"))
-        self.states["/container/rotating/left"].addTransition(_container_rotating_left_2)
-        
-        # transition /container/rotating/both
-        _container_rotating_both_0 = Transition(self, self.states["/container/rotating/both"], [self.states["/container/rotating/right"]])
-        _container_rotating_both_0.setTrigger(Event("cannon-left-released", "input"))
-        self.states["/container/rotating/both"].addTransition(_container_rotating_both_0)
-        _container_rotating_both_1 = Transition(self, self.states["/container/rotating/both"], [self.states["/container/rotating/left"]])
-        _container_rotating_both_1.setTrigger(Event("cannon-right-released", "input"))
-        self.states["/container/rotating/both"].addTransition(_container_rotating_both_1)
-        
-        # transition /container/rotating/right
-        _container_rotating_right_0 = Transition(self, self.states["/container/rotating/right"], [self.states["/container/rotating/both"]])
-        _container_rotating_right_0.setTrigger(Event("cannon-left-pressed", "input"))
-        self.states["/container/rotating/right"].addTransition(_container_rotating_right_0)
-        _container_rotating_right_1 = Transition(self, self.states["/container/rotating/right"], [self.states["/container/rotating/none"]])
-        _container_rotating_right_1.setTrigger(Event("cannon-right-released", "input"))
-        self.states["/container/rotating/right"].addTransition(_container_rotating_right_1)
-        _container_rotating_right_2 = Transition(self, self.states["/container/rotating/right"], [self.states["/container/rotating/right"]])
-        _container_rotating_right_2.setAction(self._container_rotating_right_2_exec)
-        _container_rotating_right_2.setTrigger(Event("update", "engine"))
-        self.states["/container/rotating/right"].addTransition(_container_rotating_right_2)
-        
-        # transition /container/shoot/hold
-        _container_shoot_hold_0 = Transition(self, self.states["/container/shoot/hold"], [self.states["/container/shoot/shoot"]])
-        _container_shoot_hold_0.setAction(self._container_shoot_hold_0_exec)
-        _container_shoot_hold_0.setTrigger(Event("shoot-pressed", "input"))
-        self.states["/container/shoot/hold"].addTransition(_container_shoot_hold_0)
-        
-        # transition /container/shoot/shoot
-        _container_shoot_shoot_0 = Transition(self, self.states["/container/shoot/shoot"], [self.states["/container/shoot/hold"]])
-        _container_shoot_shoot_0.setTrigger(Event("shoot-released", "input"))
-        self.states["/container/shoot/shoot"].addTransition(_container_shoot_shoot_0)
-        _container_shoot_shoot_1 = Transition(self, self.states["/container/shoot/shoot"], [self.states["/container/shoot/shoot"]])
-        _container_shoot_shoot_1.setAction(self._container_shoot_shoot_1_exec)
-        _container_shoot_shoot_1.setTrigger(Event("loaded", None))
-        self.states["/container/shoot/shoot"].addTransition(_container_shoot_shoot_1)
-        
-        # transition /container/ammo/loaded
-        _container_ammo_loaded_0 = Transition(self, self.states["/container/ammo/loaded"], [self.states["/container/ammo/unloaded"]])
-        _container_ammo_loaded_0.setAction(self._container_ammo_loaded_0_exec)
-        _container_ammo_loaded_0.setTrigger(Event("shoot", None))
-        self.states["/container/ammo/loaded"].addTransition(_container_ammo_loaded_0)
-        
-        # transition /container/ammo/unloaded
-        _container_ammo_unloaded_0 = Transition(self, self.states["/container/ammo/unloaded"], [self.states["/container/ammo/loaded"]])
-        _container_ammo_unloaded_0.setAction(self._container_ammo_unloaded_0_exec)
-        _container_ammo_unloaded_0.setTrigger(Event("_0after"))
-        self.states["/container/ammo/unloaded"].addTransition(_container_ammo_unloaded_0)
-    
-    def _container_ammo_unloaded_enter(self):
-        self.addTimer(0, self.reload_time)
-    
-    def _container_ammo_unloaded_exit(self):
-        self.removeTimer(0)
-    
-    def _container_rotating_left_2_exec(self, parameters):
-        self.tank.turnCannonLeft()
-    
-    def _container_rotating_right_2_exec(self, parameters):
-        self.tank.turnCannonRight()
-    
-    def _container_shoot_hold_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("shoot", None, []))
-    
-    def _container_shoot_shoot_1_exec(self, parameters):
-        self.raiseInternalEvent(Event("shoot", None, []))
-    
-    def _container_ammo_loaded_0_exec(self, parameters):
-        self.tank.shoot()
-        self.big_step.outputEvent(Event("reloading", "gui", []))
-    
-    def _container_ammo_unloaded_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("loaded", None, []))
-        self.big_step.outputEvent(Event("loaded", "gui", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/container"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class Body(RuntimeClassBase):
-    def __init__(self, controller, tank):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # user defined attributes
-        self.tank = None
-        
-        # call user defined constructor
-        Body.user_defined_constructor(self, tank)
-    
-    def user_defined_constructor(self, tank):
-        self.tank = tank
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /container
-        self.states["/container"] = ParallelState(1, self)
-        
-        # state /container/horizontal
-        self.states["/container/horizontal"] = State(2, self)
-        
-        # state /container/horizontal/none
-        self.states["/container/horizontal/none"] = State(3, self)
-        
-        # state /container/horizontal/left
-        self.states["/container/horizontal/left"] = State(4, self)
-        
-        # state /container/horizontal/both
-        self.states["/container/horizontal/both"] = State(5, self)
-        
-        # state /container/horizontal/right
-        self.states["/container/horizontal/right"] = State(6, self)
-        
-        # state /container/vertical
-        self.states["/container/vertical"] = State(7, self)
-        
-        # state /container/vertical/none
-        self.states["/container/vertical/none"] = State(8, self)
-        
-        # state /container/vertical/down
-        self.states["/container/vertical/down"] = State(9, self)
-        
-        # state /container/vertical/both
-        self.states["/container/vertical/both"] = State(10, self)
-        
-        # state /container/vertical/up
-        self.states["/container/vertical/up"] = State(11, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/container"])
-        self.states["/container"].addChild(self.states["/container/horizontal"])
-        self.states["/container"].addChild(self.states["/container/vertical"])
-        self.states["/container/horizontal"].addChild(self.states["/container/horizontal/none"])
-        self.states["/container/horizontal"].addChild(self.states["/container/horizontal/left"])
-        self.states["/container/horizontal"].addChild(self.states["/container/horizontal/both"])
-        self.states["/container/horizontal"].addChild(self.states["/container/horizontal/right"])
-        self.states["/container/vertical"].addChild(self.states["/container/vertical/none"])
-        self.states["/container/vertical"].addChild(self.states["/container/vertical/down"])
-        self.states["/container/vertical"].addChild(self.states["/container/vertical/both"])
-        self.states["/container/vertical"].addChild(self.states["/container/vertical/up"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/container"]
-        self.states["/container/horizontal"].default_state = self.states["/container/horizontal/none"]
-        self.states["/container/vertical"].default_state = self.states["/container/vertical/none"]
-        
-        # transition /container/horizontal/none
-        _container_horizontal_none_0 = Transition(self, self.states["/container/horizontal/none"], [self.states["/container/horizontal/left"]])
-        _container_horizontal_none_0.setTrigger(Event("left-pressed", "input"))
-        self.states["/container/horizontal/none"].addTransition(_container_horizontal_none_0)
-        _container_horizontal_none_1 = Transition(self, self.states["/container/horizontal/none"], [self.states["/container/horizontal/right"]])
-        _container_horizontal_none_1.setTrigger(Event("right-pressed", "input"))
-        self.states["/container/horizontal/none"].addTransition(_container_horizontal_none_1)
-        
-        # transition /container/horizontal/left
-        _container_horizontal_left_0 = Transition(self, self.states["/container/horizontal/left"], [self.states["/container/horizontal/none"]])
-        _container_horizontal_left_0.setTrigger(Event("left-released", "input"))
-        self.states["/container/horizontal/left"].addTransition(_container_horizontal_left_0)
-        _container_horizontal_left_1 = Transition(self, self.states["/container/horizontal/left"], [self.states["/container/horizontal/both"]])
-        _container_horizontal_left_1.setTrigger(Event("right-pressed", "input"))
-        self.states["/container/horizontal/left"].addTransition(_container_horizontal_left_1)
-        _container_horizontal_left_2 = Transition(self, self.states["/container/horizontal/left"], [self.states["/container/horizontal/left"]])
-        _container_horizontal_left_2.setAction(self._container_horizontal_left_2_exec)
-        _container_horizontal_left_2.setTrigger(Event("update", "engine"))
-        self.states["/container/horizontal/left"].addTransition(_container_horizontal_left_2)
-        
-        # transition /container/horizontal/both
-        _container_horizontal_both_0 = Transition(self, self.states["/container/horizontal/both"], [self.states["/container/horizontal/right"]])
-        _container_horizontal_both_0.setTrigger(Event("left-released", "input"))
-        self.states["/container/horizontal/both"].addTransition(_container_horizontal_both_0)
-        _container_horizontal_both_1 = Transition(self, self.states["/container/horizontal/both"], [self.states["/container/horizontal/left"]])
-        _container_horizontal_both_1.setTrigger(Event("right-released", "input"))
-        self.states["/container/horizontal/both"].addTransition(_container_horizontal_both_1)
-        
-        # transition /container/horizontal/right
-        _container_horizontal_right_0 = Transition(self, self.states["/container/horizontal/right"], [self.states["/container/horizontal/both"]])
-        _container_horizontal_right_0.setTrigger(Event("left-pressed", "input"))
-        self.states["/container/horizontal/right"].addTransition(_container_horizontal_right_0)
-        _container_horizontal_right_1 = Transition(self, self.states["/container/horizontal/right"], [self.states["/container/horizontal/none"]])
-        _container_horizontal_right_1.setTrigger(Event("right-released", "input"))
-        self.states["/container/horizontal/right"].addTransition(_container_horizontal_right_1)
-        _container_horizontal_right_2 = Transition(self, self.states["/container/horizontal/right"], [self.states["/container/horizontal/right"]])
-        _container_horizontal_right_2.setAction(self._container_horizontal_right_2_exec)
-        _container_horizontal_right_2.setTrigger(Event("update", "engine"))
-        self.states["/container/horizontal/right"].addTransition(_container_horizontal_right_2)
-        
-        # transition /container/vertical/none
-        _container_vertical_none_0 = Transition(self, self.states["/container/vertical/none"], [self.states["/container/vertical/down"]])
-        _container_vertical_none_0.setTrigger(Event("down-pressed", "input"))
-        self.states["/container/vertical/none"].addTransition(_container_vertical_none_0)
-        _container_vertical_none_1 = Transition(self, self.states["/container/vertical/none"], [self.states["/container/vertical/up"]])
-        _container_vertical_none_1.setTrigger(Event("up-pressed", "input"))
-        self.states["/container/vertical/none"].addTransition(_container_vertical_none_1)
-        
-        # transition /container/vertical/down
-        _container_vertical_down_0 = Transition(self, self.states["/container/vertical/down"], [self.states["/container/vertical/none"]])
-        _container_vertical_down_0.setTrigger(Event("down-released", "input"))
-        self.states["/container/vertical/down"].addTransition(_container_vertical_down_0)
-        _container_vertical_down_1 = Transition(self, self.states["/container/vertical/down"], [self.states["/container/vertical/both"]])
-        _container_vertical_down_1.setTrigger(Event("up-pressed", "input"))
-        self.states["/container/vertical/down"].addTransition(_container_vertical_down_1)
-        _container_vertical_down_2 = Transition(self, self.states["/container/vertical/down"], [self.states["/container/vertical/down"]])
-        _container_vertical_down_2.setAction(self._container_vertical_down_2_exec)
-        _container_vertical_down_2.setTrigger(Event("update", "engine"))
-        self.states["/container/vertical/down"].addTransition(_container_vertical_down_2)
-        
-        # transition /container/vertical/both
-        _container_vertical_both_0 = Transition(self, self.states["/container/vertical/both"], [self.states["/container/vertical/up"]])
-        _container_vertical_both_0.setTrigger(Event("down-released", "input"))
-        self.states["/container/vertical/both"].addTransition(_container_vertical_both_0)
-        _container_vertical_both_1 = Transition(self, self.states["/container/vertical/both"], [self.states["/container/vertical/down"]])
-        _container_vertical_both_1.setTrigger(Event("up-released", "input"))
-        self.states["/container/vertical/both"].addTransition(_container_vertical_both_1)
-        
-        # transition /container/vertical/up
-        _container_vertical_up_0 = Transition(self, self.states["/container/vertical/up"], [self.states["/container/vertical/both"]])
-        _container_vertical_up_0.setTrigger(Event("down-pressed", "input"))
-        self.states["/container/vertical/up"].addTransition(_container_vertical_up_0)
-        _container_vertical_up_1 = Transition(self, self.states["/container/vertical/up"], [self.states["/container/vertical/none"]])
-        _container_vertical_up_1.setTrigger(Event("up-released", "input"))
-        self.states["/container/vertical/up"].addTransition(_container_vertical_up_1)
-        _container_vertical_up_2 = Transition(self, self.states["/container/vertical/up"], [self.states["/container/vertical/up"]])
-        _container_vertical_up_2.setAction(self._container_vertical_up_2_exec)
-        _container_vertical_up_2.setTrigger(Event("update", "engine"))
-        self.states["/container/vertical/up"].addTransition(_container_vertical_up_2)
-    
-    def _container_horizontal_left_2_exec(self, parameters):
-        self.tank.turnLeft()
-    
-    def _container_horizontal_right_2_exec(self, parameters):
-        self.tank.turnRight()
-    
-    def _container_vertical_down_2_exec(self, parameters):
-        self.tank.moveDown()
-    
-    def _container_vertical_up_2_exec(self, parameters):
-        self.tank.moveUp()
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/container"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Main":
-            instance = Main(self.controller, construct_params[0])
-            instance.associations = {}
-            instance.associations["cannon"] = Association("Cannon", 1, 1)
-            instance.associations["body"] = Association("Body", 1, 1)
-        elif class_name == "Cannon":
-            instance = Cannon(self.controller, construct_params[0])
-            instance.associations = {}
-        elif class_name == "Body":
-            instance = Body(self.controller, construct_params[0])
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, tank, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("engine")
-        self.addInputPort("input")
-        self.addOutputPort("gui")
-        self.object_manager.createInstance("Main", [tank])

+ 0 - 0
examples/timer-parallel/python/target_py/__init__.py


+ 0 - 181
examples/timer-parallel/python/target_py/target.py

@@ -1,181 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:36 2016
-
-Model author: Simon Van Mierlo
-Model name:   Timer (Threaded Version)
-
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.accurate_time import time
-
-# package "Timer (Threaded Version)"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # user defined method
-    def print_simulated_time(self):
-        print 'SIMTIME = %.2f' % get_simulated_time()
-    
-    
-    # user defined method
-    def print_wct_time(self):
-        print 'ACTTIME = %.2f' % time()
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = ParallelState(1, self)
-        
-        # state /running/print_simulated_time
-        self.states["/running/print_simulated_time"] = State(2, self)
-        
-        # state /running/print_simulated_time/print_simulated_time
-        self.states["/running/print_simulated_time/print_simulated_time"] = State(3, self)
-        self.states["/running/print_simulated_time/print_simulated_time"].setEnter(self._running_print_simulated_time_print_simulated_time_enter)
-        self.states["/running/print_simulated_time/print_simulated_time"].setExit(self._running_print_simulated_time_print_simulated_time_exit)
-        
-        # state /running/print_wct_time
-        self.states["/running/print_wct_time"] = State(4, self)
-        
-        # state /running/print_wct_time/print_wct_time
-        self.states["/running/print_wct_time/print_wct_time"] = State(5, self)
-        self.states["/running/print_wct_time/print_wct_time"].setEnter(self._running_print_wct_time_print_wct_time_enter)
-        self.states["/running/print_wct_time/print_wct_time"].setExit(self._running_print_wct_time_print_wct_time_exit)
-        
-        # state /interrupted
-        self.states["/interrupted"] = State(6, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states[""].addChild(self.states["/interrupted"])
-        self.states["/running"].addChild(self.states["/running/print_simulated_time"])
-        self.states["/running"].addChild(self.states["/running/print_wct_time"])
-        self.states["/running/print_simulated_time"].addChild(self.states["/running/print_simulated_time/print_simulated_time"])
-        self.states["/running/print_wct_time"].addChild(self.states["/running/print_wct_time/print_wct_time"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        self.states["/running/print_simulated_time"].default_state = self.states["/running/print_simulated_time/print_simulated_time"]
-        self.states["/running/print_wct_time"].default_state = self.states["/running/print_wct_time/print_wct_time"]
-        
-        # transition /running/print_simulated_time/print_simulated_time
-        _running_print_simulated_time_print_simulated_time_0 = Transition(self, self.states["/running/print_simulated_time/print_simulated_time"], [self.states["/running/print_simulated_time/print_simulated_time"]])
-        _running_print_simulated_time_print_simulated_time_0.setAction(self._running_print_simulated_time_print_simulated_time_0_exec)
-        _running_print_simulated_time_print_simulated_time_0.setTrigger(Event("_0after"))
-        self.states["/running/print_simulated_time/print_simulated_time"].addTransition(_running_print_simulated_time_print_simulated_time_0)
-        
-        # transition /running/print_wct_time/print_wct_time
-        _running_print_wct_time_print_wct_time_0 = Transition(self, self.states["/running/print_wct_time/print_wct_time"], [self.states["/running/print_wct_time/print_wct_time"]])
-        _running_print_wct_time_print_wct_time_0.setAction(self._running_print_wct_time_print_wct_time_0_exec)
-        _running_print_wct_time_print_wct_time_0.setTrigger(Event("_1after"))
-        self.states["/running/print_wct_time/print_wct_time"].addTransition(_running_print_wct_time_print_wct_time_0)
-        
-        # transition /interrupted
-        _interrupted_0 = Transition(self, self.states["/interrupted"], [self.states["/interrupted"]])
-        _interrupted_0.setAction(self._interrupted_0_exec)
-        _interrupted_0.setTrigger(Event("interrupt", "input"))
-        self.states["/interrupted"].addTransition(_interrupted_0)
-        _interrupted_1 = Transition(self, self.states["/interrupted"], [self.states["/running"]])
-        _interrupted_1.setAction(self._interrupted_1_exec)
-        _interrupted_1.setTrigger(Event("continue", "input"))
-        self.states["/interrupted"].addTransition(_interrupted_1)
-        
-        # transition /running
-        _running_0 = Transition(self, self.states["/running"], [self.states["/interrupted"]])
-        _running_0.setAction(self._running_0_exec)
-        _running_0.setTrigger(Event("interrupt", "input"))
-        self.states["/running"].addTransition(_running_0)
-        
-        # transition /running/print_simulated_time
-        _running_print_simulated_time_0 = Transition(self, self.states["/running/print_simulated_time"], [self.states["/running/print_simulated_time"]])
-        _running_print_simulated_time_0.setAction(self._running_print_simulated_time_0_exec)
-        _running_print_simulated_time_0.setTrigger(Event("interrupt", "input"))
-        self.states["/running/print_simulated_time"].addTransition(_running_print_simulated_time_0)
-    
-    def _running_print_simulated_time_print_simulated_time_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _running_print_simulated_time_print_simulated_time_exit(self):
-        self.removeTimer(0)
-    
-    def _running_print_wct_time_print_wct_time_enter(self):
-        self.addTimer(1, 0.05)
-    
-    def _running_print_wct_time_print_wct_time_exit(self):
-        self.removeTimer(1)
-    
-    def _running_0_exec(self, parameters):
-        self.print_simulated_time()
-        self.print_wct_time()
-    
-    def _running_print_simulated_time_0_exec(self, parameters):
-        print 'going nowhere'
-    
-    def _running_print_simulated_time_print_simulated_time_0_exec(self, parameters):
-        self.print_simulated_time()
-    
-    def _running_print_wct_time_print_wct_time_0_exec(self, parameters):
-        self.print_wct_time()
-    
-    def _interrupted_0_exec(self, parameters):
-        self.print_simulated_time()
-        self.print_wct_time()
-    
-    def _interrupted_1_exec(self, parameters):
-        self.print_simulated_time()
-        self.print_wct_time()
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/running"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None):
-        if keep_running == None: keep_running = True
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running)
-        self.addInputPort("input")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 0
examples/timer-threads/python/target_py/__init__.py


+ 0 - 128
examples/timer-threads/python/target_py/target.py

@@ -1,128 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:36 2016
-
-Model author: Simon Van Mierlo
-Model name:   Timer (Threaded Version)
-
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.accurate_time import time
-
-# package "Timer (Threaded Version)"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # user defined method
-    def update_timers(self):
-        print 'SIMTIME = %.2f' % get_simulated_time()
-        print 'ACTTIME = %.2f' % time()
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = State(1, self)
-        self.states["/running"].setEnter(self._running_enter)
-        self.states["/running"].setExit(self._running_exit)
-        
-        # state /interrupted
-        self.states["/interrupted"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states[""].addChild(self.states["/interrupted"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        
-        # transition /running
-        _running_0 = Transition(self, self.states["/running"], [self.states["/running"]])
-        _running_0.setAction(self._running_0_exec)
-        _running_0.setTrigger(Event("_0after"))
-        self.states["/running"].addTransition(_running_0)
-        _running_1 = Transition(self, self.states["/running"], [self.states["/interrupted"]])
-        _running_1.setAction(self._running_1_exec)
-        _running_1.setTrigger(Event("interrupt", "input"))
-        self.states["/running"].addTransition(_running_1)
-        
-        # transition /interrupted
-        _interrupted_0 = Transition(self, self.states["/interrupted"], [self.states["/interrupted"]])
-        _interrupted_0.setAction(self._interrupted_0_exec)
-        _interrupted_0.setTrigger(Event("interrupt", "input"))
-        self.states["/interrupted"].addTransition(_interrupted_0)
-        _interrupted_1 = Transition(self, self.states["/interrupted"], [self.states["/running"]])
-        _interrupted_1.setAction(self._interrupted_1_exec)
-        _interrupted_1.setTrigger(Event("continue", "input"))
-        self.states["/interrupted"].addTransition(_interrupted_1)
-    
-    def _running_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _running_exit(self):
-        self.removeTimer(0)
-    
-    def _running_0_exec(self, parameters):
-        self.update_timers()
-    
-    def _running_1_exec(self, parameters):
-        self.update_timers()
-    
-    def _interrupted_0_exec(self, parameters):
-        self.update_timers()
-    
-    def _interrupted_1_exec(self, parameters):
-        self.update_timers()
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/running"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None):
-        if keep_running == None: keep_running = True
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running)
-        self.addInputPort("input")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 190
examples/timer/js/target_js/target.js

@@ -1,190 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:36 2016
-
-Model author: Simon Van Mierlo
-Model name:   Timer
-*/
-
-
-// package "Timer"
-var Timer = {};
-(function() {
-
-var MainApp = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    MainApp.prototype.user_defined_constructor.call(this);
-};
-MainApp.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        MainApp.prototype[prop] = proto[prop];
-    }
-})();
-
-MainApp.prototype.user_defined_constructor = function() {
-    this.canvas = ui.append_canvas(ui.window,400,150,{'background':'#eee'})
-    this.clock_text = this.canvas.add_text(25,25,'0.0')
-    this.actual_clock_text = this.canvas.add_text(25,50,'0.0')
-    var interrupt_button = ui.append_button(ui.window, 'INTERRUPT');
-    var continue_button = ui.append_button(ui.window, 'CONTINUE');
-    ui.bind_event(interrupt_button.element, ui.EVENTS.MOUSE_CLICK, this.controller, 'interrupt_clicked');
-    ui.bind_event(continue_button.element, ui.EVENTS.MOUSE_CLICK, this.controller, 'continue_clicked');
-};
-
-MainApp.prototype.user_defined_destructor = function() {
-};
-
-
-// user defined method
-MainApp.prototype.update_timers = function() {
-    this.clock_text.set_text(get_simulated_time().toFixed(2));
-    this.actual_clock_text.set_text(time().toFixed(2));
-};
-
-
-// builds Statechart structure
-MainApp.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /running
-    this.states["/running"] = new State(1, this);
-    this.states["/running"].setEnter(this._running_enter);
-    this.states["/running"].setExit(this._running_exit);
-    
-    // state /interrupted
-    this.states["/interrupted"] = new State(2, this);
-    this.states["/interrupted"].setEnter(this._interrupted_enter);
-    this.states["/interrupted"].setExit(this._interrupted_exit);
-    
-    // add children
-    this.states[""].addChild(this.states["/running"]);
-    this.states[""].addChild(this.states["/interrupted"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/running"];
-    
-    // transition /running
-    var _running_0 = new Transition(this, this.states["/running"], [this.states["/running"]]);
-    _running_0.setAction(this._running_0_exec);
-    _running_0.setTrigger(new Event("_0after"));
-    this.states["/running"].addTransition(_running_0);
-    var _running_1 = new Transition(this, this.states["/running"], [this.states["/interrupted"]]);
-    _running_1.setAction(this._running_1_exec);
-    _running_1.setTrigger(new Event("interrupt_clicked", "ui"));
-    this.states["/running"].addTransition(_running_1);
-    
-    // transition /interrupted
-    var _interrupted_0 = new Transition(this, this.states["/interrupted"], [this.states["/interrupted"]]);
-    _interrupted_0.setAction(this._interrupted_0_exec);
-    _interrupted_0.setTrigger(new Event("interrupt_clicked", "ui"));
-    this.states["/interrupted"].addTransition(_interrupted_0);
-    var _interrupted_1 = new Transition(this, this.states["/interrupted"], [this.states["/running"]]);
-    _interrupted_1.setAction(this._interrupted_1_exec);
-    _interrupted_1.setTrigger(new Event("continue_clicked", "ui"));
-    this.states["/interrupted"].addTransition(_interrupted_1);
-};
-
-MainApp.prototype._running_enter = function() {
-    this.addTimer(0, 0.05);
-};
-
-MainApp.prototype._running_exit = function() {
-    this.removeTimer(0);
-};
-
-MainApp.prototype._interrupted_enter = function() {
-    console.log("entering interrupted");
-};
-
-MainApp.prototype._interrupted_exit = function() {
-    console.log("entering interrupted");
-};
-
-MainApp.prototype._running_0_exec = function(parameters) {
-    this.update_timers();
-};
-
-MainApp.prototype._running_1_exec = function(parameters) {
-    this.update_timers();
-};
-
-MainApp.prototype._interrupted_0_exec = function(parameters) {
-    this.update_timers();
-};
-
-MainApp.prototype._interrupted_1_exec = function(parameters) {
-    this.update_timers();
-};
-
-MainApp.prototype.initializeStatechart = function() {
-    // enter default state
-    var states = this.states["/running"].getEffectiveTargetStates();
-    this.updateConfiguration(states);
-    for (var state_idx in states) {
-        if (!states.hasOwnProperty(state_idx)) continue;
-        var state = states[state_idx]
-        if (state.enter) {
-            state.enter();
-        }
-    }
-};
-
-// add symbol 'MainApp' to package 'Timer'
-Timer.MainApp = MainApp;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "MainApp") {
-        var instance = new MainApp(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'Timer'
-Timer.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("ui");
-    this.object_manager.createInstance("MainApp", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'Timer'
-Timer.Controller = Controller;
-})();

+ 0 - 0
examples/timer/python/target_py/__init__.py


+ 0 - 137
examples/timer/python/target_py/target.py

@@ -1,137 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:36 2016
-
-Model author: Simon Van Mierlo
-Model name:   Timer
-
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.libs.ui import ui
-from sccd.runtime.accurate_time import time
-from sccd.runtime.statecharts_core import get_simulated_time
-
-# package "Timer"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.canvas = ui.append_canvas(ui.window,100,100,{'background':'#eee'})
-        self.clock_text = self.canvas.element.create_text(25,25,{'text':'0.0'})
-        self.actual_clock_text = self.canvas.element.create_text(25,50,{'text':'0.0'})
-        interrupt_button = ui.append_button(ui.window, 'INTERRUPT');
-        continue_button = ui.append_button(ui.window, 'CONTINUE');
-        ui.bind_event(interrupt_button.element, ui.EVENTS.MOUSE_CLICK, self.controller, 'interrupt_clicked');
-        ui.bind_event(continue_button.element, ui.EVENTS.MOUSE_CLICK, self.controller, 'continue_clicked');
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # user defined method
-    def update_timers(self):
-        self.canvas.element.itemconfigure(self.clock_text, text=str('%.2f' % get_simulated_time()))
-        self.canvas.element.itemconfigure(self.actual_clock_text, text='%.2f' % time())
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /running
-        self.states["/running"] = State(1, self)
-        self.states["/running"].setEnter(self._running_enter)
-        self.states["/running"].setExit(self._running_exit)
-        
-        # state /interrupted
-        self.states["/interrupted"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/running"])
-        self.states[""].addChild(self.states["/interrupted"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/running"]
-        
-        # transition /running
-        _running_0 = Transition(self, self.states["/running"], [self.states["/running"]])
-        _running_0.setAction(self._running_0_exec)
-        _running_0.setTrigger(Event("_0after"))
-        self.states["/running"].addTransition(_running_0)
-        _running_1 = Transition(self, self.states["/running"], [self.states["/interrupted"]])
-        _running_1.setAction(self._running_1_exec)
-        _running_1.setTrigger(Event("interrupt_clicked", "ui"))
-        self.states["/running"].addTransition(_running_1)
-        
-        # transition /interrupted
-        _interrupted_0 = Transition(self, self.states["/interrupted"], [self.states["/interrupted"]])
-        _interrupted_0.setAction(self._interrupted_0_exec)
-        _interrupted_0.setTrigger(Event("interrupt_clicked", "ui"))
-        self.states["/interrupted"].addTransition(_interrupted_0)
-        _interrupted_1 = Transition(self, self.states["/interrupted"], [self.states["/running"]])
-        _interrupted_1.setAction(self._interrupted_1_exec)
-        _interrupted_1.setTrigger(Event("continue_clicked", "ui"))
-        self.states["/interrupted"].addTransition(_interrupted_1)
-    
-    def _running_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _running_exit(self):
-        self.removeTimer(0)
-    
-    def _running_0_exec(self, parameters):
-        self.update_timers()
-    
-    def _running_1_exec(self, parameters):
-        self.update_timers()
-    
-    def _interrupted_0_exec(self, parameters):
-        self.update_timers()
-    
-    def _interrupted_1_exec(self, parameters):
-        self.update_timers()
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/running"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 393
examples/trafficlights/js/target_js/target.js

@@ -1,393 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:36 2016
-
-Model author: Raphael Mannadiar
-Model name:   Traffic_Light_JavaScript_Version
-*/
-
-
-// package "Traffic_Light_JavaScript_Version"
-var Traffic_Light_JavaScript_Version = {};
-(function() {
-
-var MainApp = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    MainApp.prototype.user_defined_constructor.call(this);
-};
-MainApp.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        MainApp.prototype[prop] = proto[prop];
-    }
-})();
-
-MainApp.prototype.user_defined_constructor = function() {
-    this.canvas	= ui.append_canvas(ui.window,100,310,{'background':'#eee'});
-    var police_button = ui.append_button(ui.window, 'Police interrupt');
-    var quit_button	= ui.append_button(ui.window, 'Quit');
-    ui.bind_event(police_button.element, ui.EVENTS.MOUSE_CLICK, this.controller, 'police_interrupt_clicked');
-    ui.bind_event(quit_button.element, 	 ui.EVENTS.MOUSE_CLICK, this.controller, 'quit_clicked');
-};
-
-MainApp.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-MainApp.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /initializing
-    this.states["/initializing"] = new State(1, this);
-    
-    // state /creating
-    this.states["/creating"] = new State(2, this);
-    
-    // state /initialized
-    this.states["/initialized"] = new State(3, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/initializing"]);
-    this.states[""].addChild(this.states["/creating"]);
-    this.states[""].addChild(this.states["/initialized"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/initializing"];
-    
-    // transition /initializing
-    var _initializing_0 = new Transition(this, this.states["/initializing"], [this.states["/creating"]]);
-    _initializing_0.setAction(this._initializing_0_exec);
-    _initializing_0.setTrigger(null);
-    this.states["/initializing"].addTransition(_initializing_0);
-    
-    // transition /creating
-    var _creating_0 = new Transition(this, this.states["/creating"], [this.states["/initialized"]]);
-    _creating_0.setAction(this._creating_0_exec);
-    _creating_0.setTrigger(new Event("instance_created", null));
-    this.states["/creating"].addTransition(_creating_0);
-};
-
-MainApp.prototype._initializing_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "trafficlight", "TrafficLight", this.canvas]));
-};
-
-MainApp.prototype._creating_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, association_name]));
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, association_name, new Event("set_association_name", null, [association_name])]));
-};
-
-MainApp.prototype.initializeStatechart = function() {
-    // enter default state
-    var states = this.states["/initializing"].getEffectiveTargetStates();
-    this.updateConfiguration(states);
-    for (var state_idx in states) {
-        if (!states.hasOwnProperty(state_idx)) continue;
-        var state = states[state_idx]
-        if (state.enter) {
-            state.enter();
-        }
-    }
-};
-
-// add symbol 'MainApp' to package 'Traffic_Light_JavaScript_Version'
-Traffic_Light_JavaScript_Version.MainApp = MainApp;
-
-var TrafficLight = function(controller, canvas) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    TrafficLight.prototype.user_defined_constructor.call(this, canvas);
-};
-TrafficLight.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        TrafficLight.prototype[prop] = proto[prop];
-    }
-})();
-
-TrafficLight.prototype.user_defined_constructor = function(canvas) {
-    var size 	= 100;
-    var offset 	= size+5;
-    this.RED 	= 0;
-    this.YELLOW = 1;
-    this.GREEN 	= 2;
-    this.colors	= ['#f00','#ff0','#0f0']
-    this.lights = [canvas.add_rectangle(size/2, size/2, 		 	 size, size, {'fill':'#000'}),
-    					canvas.add_rectangle(size/2, size/2+offset,	 size, size, {'fill':'#000'}),
-    					canvas.add_rectangle(size/2, size/2+2*offset, size, size, {'fill':'#000'})];
-};
-
-TrafficLight.prototype.user_defined_destructor = function() {
-};
-
-
-// user defined method
-TrafficLight.prototype.clear = function() {
-    this.lights[this.RED].set_color('#000');
-    this.lights[this.YELLOW].set_color('#000');
-    this.lights[this.GREEN].set_color('#000');
-};
-
-
-// user defined method
-TrafficLight.prototype.setGreen = function() {
-    this.clear();
-    this.lights[this.GREEN].set_color(this.colors[this.GREEN]);
-};
-
-
-// user defined method
-TrafficLight.prototype.setYellow = function() {
-    this.clear();
-    this.lights[this.YELLOW].set_color(this.colors[this.YELLOW]);
-};
-
-
-// user defined method
-TrafficLight.prototype.setRed = function() {
-    this.clear();
-    this.lights[this.RED].set_color(this.colors[this.RED]);
-};
-
-
-// builds Statechart structure
-TrafficLight.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /on
-    this.states["/on"] = new State(1, this);
-    
-    // state /on/normal
-    this.states["/on/normal"] = new State(2, this);
-    
-    // state /on/normal/red
-    this.states["/on/normal/red"] = new State(3, this);
-    this.states["/on/normal/red"].setEnter(this._on_normal_red_enter);
-    this.states["/on/normal/red"].setExit(this._on_normal_red_exit);
-    
-    // state /on/normal/green
-    this.states["/on/normal/green"] = new State(4, this);
-    this.states["/on/normal/green"].setEnter(this._on_normal_green_enter);
-    this.states["/on/normal/green"].setExit(this._on_normal_green_exit);
-    
-    // state /on/normal/yellow
-    this.states["/on/normal/yellow"] = new State(5, this);
-    this.states["/on/normal/yellow"].setEnter(this._on_normal_yellow_enter);
-    this.states["/on/normal/yellow"].setExit(this._on_normal_yellow_exit);
-    
-    // state /on/normal/history
-    this.states["/on/normal/history"] = new ShallowHistoryState(6, this);
-    
-    // state /on/interrupted
-    this.states["/on/interrupted"] = new State(7, this);
-    
-    // state /on/interrupted/yellow
-    this.states["/on/interrupted/yellow"] = new State(8, this);
-    this.states["/on/interrupted/yellow"].setEnter(this._on_interrupted_yellow_enter);
-    this.states["/on/interrupted/yellow"].setExit(this._on_interrupted_yellow_exit);
-    
-    // state /on/interrupted/black
-    this.states["/on/interrupted/black"] = new State(9, this);
-    this.states["/on/interrupted/black"].setEnter(this._on_interrupted_black_enter);
-    this.states["/on/interrupted/black"].setExit(this._on_interrupted_black_exit);
-    
-    // state /off
-    this.states["/off"] = new State(10, this);
-    this.states["/off"].setEnter(this._off_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/on"]);
-    this.states[""].addChild(this.states["/off"]);
-    this.states["/on"].addChild(this.states["/on/normal"]);
-    this.states["/on"].addChild(this.states["/on/interrupted"]);
-    this.states["/on/normal"].addChild(this.states["/on/normal/red"]);
-    this.states["/on/normal"].addChild(this.states["/on/normal/green"]);
-    this.states["/on/normal"].addChild(this.states["/on/normal/yellow"]);
-    this.states["/on/normal"].addChild(this.states["/on/normal/history"]);
-    this.states["/on/interrupted"].addChild(this.states["/on/interrupted/yellow"]);
-    this.states["/on/interrupted"].addChild(this.states["/on/interrupted/black"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/on"];
-    this.states["/on"].default_state = this.states["/on/normal"];
-    this.states["/on/normal"].default_state = this.states["/on/normal/red"];
-    this.states["/on/interrupted"].default_state = this.states["/on/interrupted/yellow"];
-    
-    // transition /on/normal/red
-    var _on_normal_red_0 = new Transition(this, this.states["/on/normal/red"], [this.states["/on/normal/green"]]);
-    _on_normal_red_0.setTrigger(new Event("_0after"));
-    this.states["/on/normal/red"].addTransition(_on_normal_red_0);
-    
-    // transition /on/normal/green
-    var _on_normal_green_0 = new Transition(this, this.states["/on/normal/green"], [this.states["/on/normal/yellow"]]);
-    _on_normal_green_0.setTrigger(new Event("_1after"));
-    this.states["/on/normal/green"].addTransition(_on_normal_green_0);
-    
-    // transition /on/normal/yellow
-    var _on_normal_yellow_0 = new Transition(this, this.states["/on/normal/yellow"], [this.states["/on/normal/red"]]);
-    _on_normal_yellow_0.setTrigger(new Event("_2after"));
-    this.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0);
-    
-    // transition /on/interrupted/yellow
-    var _on_interrupted_yellow_0 = new Transition(this, this.states["/on/interrupted/yellow"], [this.states["/on/interrupted/black"]]);
-    _on_interrupted_yellow_0.setTrigger(new Event("_3after"));
-    this.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0);
-    
-    // transition /on/interrupted/black
-    var _on_interrupted_black_0 = new Transition(this, this.states["/on/interrupted/black"], [this.states["/on/interrupted/yellow"]]);
-    _on_interrupted_black_0.setTrigger(new Event("_4after"));
-    this.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0);
-    
-    // transition /on
-    var _on_0 = new Transition(this, this.states["/on"], [this.states["/off"]]);
-    _on_0.setTrigger(new Event("quit_clicked", "ui"));
-    this.states["/on"].addTransition(_on_0);
-    
-    // transition /on/normal
-    var _on_normal_0 = new Transition(this, this.states["/on/normal"], [this.states["/on/interrupted"]]);
-    _on_normal_0.setTrigger(new Event("police_interrupt_clicked", "ui"));
-    this.states["/on/normal"].addTransition(_on_normal_0);
-    
-    // transition /on/interrupted
-    var _on_interrupted_0 = new Transition(this, this.states["/on/interrupted"], [this.states["/on/normal/history"]]);
-    _on_interrupted_0.setTrigger(new Event("police_interrupt_clicked", "ui"));
-    this.states["/on/interrupted"].addTransition(_on_interrupted_0);
-};
-
-TrafficLight.prototype._on_normal_red_enter = function() {
-    this.addTimer(0, 3);
-    this.setRed();
-};
-
-TrafficLight.prototype._on_normal_red_exit = function() {
-    this.removeTimer(0);
-};
-
-TrafficLight.prototype._on_normal_green_enter = function() {
-    this.addTimer(1, 2);
-    this.setGreen();
-};
-
-TrafficLight.prototype._on_normal_green_exit = function() {
-    this.removeTimer(1);
-};
-
-TrafficLight.prototype._on_normal_yellow_enter = function() {
-    this.addTimer(2, 1);
-    this.setYellow();
-};
-
-TrafficLight.prototype._on_normal_yellow_exit = function() {
-    this.removeTimer(2);
-};
-
-TrafficLight.prototype._on_interrupted_yellow_enter = function() {
-    this.addTimer(3, .5);
-    this.setYellow();
-};
-
-TrafficLight.prototype._on_interrupted_yellow_exit = function() {
-    this.removeTimer(3);
-};
-
-TrafficLight.prototype._on_interrupted_black_enter = function() {
-    this.addTimer(4, .5);
-    this.clear();
-};
-
-TrafficLight.prototype._on_interrupted_black_exit = function() {
-    this.removeTimer(4);
-};
-
-TrafficLight.prototype._off_enter = function() {
-    this.clear();
-};
-
-TrafficLight.prototype.initializeStatechart = function() {
-    // enter default state
-    var states = this.states["/on"].getEffectiveTargetStates();
-    this.updateConfiguration(states);
-    for (var state_idx in states) {
-        if (!states.hasOwnProperty(state_idx)) continue;
-        var state = states[state_idx]
-        if (state.enter) {
-            state.enter();
-        }
-    }
-};
-
-// add symbol 'TrafficLight' to package 'Traffic_Light_JavaScript_Version'
-Traffic_Light_JavaScript_Version.TrafficLight = TrafficLight;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "MainApp") {
-        var instance = new MainApp(this.controller);
-        instance.associations = new Object();
-        instance.associations["trafficlight"] = new Association("TrafficLight", 0, -1);
-    } else if (class_name === "TrafficLight") {
-        var instance = new TrafficLight(this.controller, construct_params[0]);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'Traffic_Light_JavaScript_Version'
-Traffic_Light_JavaScript_Version.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("ui");
-    this.object_manager.createInstance("MainApp", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'Traffic_Light_JavaScript_Version'
-Traffic_Light_JavaScript_Version.Controller = Controller;
-})();

+ 0 - 0
examples/trafficlights/python/target_py/__init__.py


+ 0 - 322
examples/trafficlights/python/target_py/target.py

@@ -1,322 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:37 2016
-
-Model author: Raphael Mannadiar
-Model name:   Traffic_Light_Python_Version
-
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.libs.ui import ui
-
-# package "Traffic_Light_Python_Version"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.canvas   = ui.append_canvas(ui.window,100,310,{'background':'#eee'});
-        police_button = ui.append_button(ui.window, 'Police interrupt');
-        quit_button   = ui.append_button(ui.window, 'Quit');
-        ui.bind_event(police_button.element, ui.EVENTS.MOUSE_CLICK, self.controller, 'police_interrupt_clicked');
-        ui.bind_event(quit_button.element,      ui.EVENTS.MOUSE_CLICK, self.controller, 'quit_clicked');
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /initializing
-        self.states["/initializing"] = State(1, self)
-        
-        # state /creating
-        self.states["/creating"] = State(2, self)
-        
-        # state /initialized
-        self.states["/initialized"] = State(3, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/initializing"])
-        self.states[""].addChild(self.states["/creating"])
-        self.states[""].addChild(self.states["/initialized"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/initializing"]
-        
-        # transition /initializing
-        _initializing_0 = Transition(self, self.states["/initializing"], [self.states["/creating"]])
-        _initializing_0.setAction(self._initializing_0_exec)
-        _initializing_0.setTrigger(None)
-        self.states["/initializing"].addTransition(_initializing_0)
-        
-        # transition /creating
-        _creating_0 = Transition(self, self.states["/creating"], [self.states["/initialized"]])
-        _creating_0.setAction(self._creating_0_exec)
-        _creating_0.setTrigger(Event("instance_created", None))
-        self.states["/creating"].addTransition(_creating_0)
-    
-    def _initializing_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "trafficlight", "TrafficLight", self.canvas]))
-    
-    def _creating_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, association_name, Event("set_association_name", None, [association_name])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/initializing"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class TrafficLight(RuntimeClassBase):
-    def __init__(self, controller, canvas):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        TrafficLight.user_defined_constructor(self, canvas)
-    
-    def user_defined_constructor(self, canvas):
-        size        = 100;
-        offset      = size+5;
-        self.RED    = 0;
-        self.YELLOW = 1;
-        self.GREEN  = 2;
-        self.colors = ['#f00','#ff0','#0f0']
-        self.lights = [
-            canvas.add_rectangle(size/2, size/2, size, size, {'fill':'#000'}),
-            canvas.add_rectangle(size/2, size/2+offset,     size, size, {'fill':'#000'}),
-            canvas.add_rectangle(size/2, size/2+2*offset, size, size, {'fill':'#000'})];
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # user defined method
-    def clear(self):
-        self.lights[self.RED].set_color('#000');
-        self.lights[self.YELLOW].set_color('#000');
-        self.lights[self.GREEN].set_color('#000');
-    
-    
-    # user defined method
-    def setGreen(self):
-        self.clear();
-        self.lights[self.GREEN].set_color(self.colors[self.GREEN]);
-    
-    
-    # user defined method
-    def setYellow(self):
-        self.clear();
-        self.lights[self.YELLOW].set_color(self.colors[self.YELLOW]);
-    
-    
-    # user defined method
-    def setRed(self):
-        self.clear();
-        self.lights[self.RED].set_color(self.colors[self.RED]);
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /on
-        self.states["/on"] = State(1, self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(2, self)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(3, self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(4, self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(5, self)
-        self.states["/on/normal/yellow"].setEnter(self._on_normal_yellow_enter)
-        self.states["/on/normal/yellow"].setExit(self._on_normal_yellow_exit)
-        
-        # state /on/normal/history
-        self.states["/on/normal/history"] = ShallowHistoryState(6, self)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(7, self)
-        
-        # state /on/interrupted/yellow
-        self.states["/on/interrupted/yellow"] = State(8, self)
-        self.states["/on/interrupted/yellow"].setEnter(self._on_interrupted_yellow_enter)
-        self.states["/on/interrupted/yellow"].setExit(self._on_interrupted_yellow_exit)
-        
-        # state /on/interrupted/black
-        self.states["/on/interrupted/black"] = State(9, self)
-        self.states["/on/interrupted/black"].setEnter(self._on_interrupted_black_enter)
-        self.states["/on/interrupted/black"].setExit(self._on_interrupted_black_exit)
-        
-        # state /off
-        self.states["/off"] = State(10, self)
-        self.states["/off"].setEnter(self._off_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/history"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/black"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/on"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/interrupted"].default_state = self.states["/on/interrupted/yellow"]
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_0after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow
-        _on_normal_yellow_0 = Transition(self, self.states["/on/normal/yellow"], [self.states["/on/normal/red"]])
-        _on_normal_yellow_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0)
-        
-        # transition /on/interrupted/yellow
-        _on_interrupted_yellow_0 = Transition(self, self.states["/on/interrupted/yellow"], [self.states["/on/interrupted/black"]])
-        _on_interrupted_yellow_0.setTrigger(Event("_3after"))
-        self.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0)
-        
-        # transition /on/interrupted/black
-        _on_interrupted_black_0 = Transition(self, self.states["/on/interrupted/black"], [self.states["/on/interrupted/yellow"]])
-        _on_interrupted_black_0.setTrigger(Event("_4after"))
-        self.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0)
-        
-        # transition /on
-        _on_0 = Transition(self, self.states["/on"], [self.states["/off"]])
-        _on_0.setTrigger(Event("quit_clicked", "ui"))
-        self.states["/on"].addTransition(_on_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setTrigger(Event("police_interrupt_clicked", "ui"))
-        self.states["/on/normal"].addTransition(_on_normal_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal/history"]])
-        _on_interrupted_0.setTrigger(Event("police_interrupt_clicked", "ui"))
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-    
-    def _on_normal_red_enter(self):
-        self.addTimer(0, 3)
-        self.setRed();
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(0)
-    
-    def _on_normal_green_enter(self):
-        self.addTimer(1, 2)
-        self.setGreen();
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_yellow_enter(self):
-        self.addTimer(2, 1)
-        self.setYellow();
-    
-    def _on_normal_yellow_exit(self):
-        self.removeTimer(2)
-    
-    def _on_interrupted_yellow_enter(self):
-        self.addTimer(3, .5)
-        self.setYellow();
-    
-    def _on_interrupted_yellow_exit(self):
-        self.removeTimer(3)
-    
-    def _on_interrupted_black_enter(self):
-        self.addTimer(4, .5)
-        self.clear();
-    
-    def _on_interrupted_black_exit(self):
-        self.removeTimer(4)
-    
-    def _off_enter(self):
-        self.clear();
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/on"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-            instance.associations["trafficlight"] = Association("TrafficLight", 0, -1)
-        elif class_name == "TrafficLight":
-            instance = TrafficLight(self.controller, construct_params[0])
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 0
examples/train/python/target_py/__init__.py


+ 0 - 477
examples/train/python/target_py/target.py

@@ -1,477 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Fri Aug 05 16:08:37 2016
-
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package ""
-
-class Train(RuntimeClassBase):
-    def __init__(self, controller, root):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceChild
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Train.user_defined_constructor(self, root)
-    
-    def user_defined_constructor(self, root):
-        self.root, self.acceleration, self.velocity = root, 0.0, 0.0
-        self.root.trainIs(self)
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # user defined method
-    def updateState(self):
-        self.root.updateState()
-    
-    
-    # user defined method
-    def openDoors(self):
-        self.root.openDoors()
-    
-    
-    # user defined method
-    def closeDoors(self):
-        self.root.closeDoors()
-    
-    
-    # user defined method
-    def notify(self, message, color):
-        self.root.notify(message, color)
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /normal_operation
-        self.states["/normal_operation"] = State(1, self)
-        
-        # state /normal_operation/for_history
-        self.states["/normal_operation/for_history"] = ParallelState(2, self)
-        
-        # state /normal_operation/for_history/train
-        self.states["/normal_operation/for_history/train"] = State(3, self)
-        
-        # state /normal_operation/for_history/train/train
-        self.states["/normal_operation/for_history/train/train"] = State(4, self)
-        
-        # state /normal_operation/for_history/train/train/stopped
-        self.states["/normal_operation/for_history/train/train/stopped"] = State(5, self)
-        self.states["/normal_operation/for_history/train/train/stopped"].setEnter(self._normal_operation_for_history_train_train_stopped_enter)
-        
-        # state /normal_operation/for_history/train/train/stopped/opened_doors
-        self.states["/normal_operation/for_history/train/train/stopped/opened_doors"] = State(6, self)
-        self.states["/normal_operation/for_history/train/train/stopped/opened_doors"].setEnter(self._normal_operation_for_history_train_train_stopped_opened_doors_enter)
-        self.states["/normal_operation/for_history/train/train/stopped/opened_doors"].setExit(self._normal_operation_for_history_train_train_stopped_opened_doors_exit)
-        
-        # state /normal_operation/for_history/train/train/stopped/in_station
-        self.states["/normal_operation/for_history/train/train/stopped/in_station"] = State(7, self)
-        
-        # state /normal_operation/for_history/train/train/stopped/allow_closing
-        self.states["/normal_operation/for_history/train/train/stopped/allow_closing"] = State(8, self)
-        self.states["/normal_operation/for_history/train/train/stopped/allow_closing"].setEnter(self._normal_operation_for_history_train_train_stopped_allow_closing_enter)
-        
-        # state /normal_operation/for_history/train/train/stopped/ready_to_leave
-        self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"] = State(9, self)
-        
-        # state /normal_operation/for_history/train/train/approaching_station
-        self.states["/normal_operation/for_history/train/train/approaching_station"] = State(10, self)
-        
-        # state /normal_operation/for_history/train/train/driving
-        self.states["/normal_operation/for_history/train/train/driving"] = State(11, self)
-        
-        # state /normal_operation/for_history/train/train/max_speed
-        self.states["/normal_operation/for_history/train/train/max_speed"] = State(12, self)
-        self.states["/normal_operation/for_history/train/train/max_speed"].setEnter(self._normal_operation_for_history_train_train_max_speed_enter)
-        self.states["/normal_operation/for_history/train/train/max_speed"].setExit(self._normal_operation_for_history_train_train_max_speed_exit)
-        
-        # state /normal_operation/for_history/GUI_update
-        self.states["/normal_operation/for_history/GUI_update"] = State(13, self)
-        
-        # state /normal_operation/for_history/GUI_update/S_
-        self.states["/normal_operation/for_history/GUI_update/S_"] = State(14, self)
-        
-        # state /normal_operation/for_history/GUI_update/S_/updating
-        self.states["/normal_operation/for_history/GUI_update/S_/updating"] = State(15, self)
-        self.states["/normal_operation/for_history/GUI_update/S_/updating"].setEnter(self._normal_operation_for_history_GUI_update_S__updating_enter)
-        self.states["/normal_operation/for_history/GUI_update/S_/updating"].setExit(self._normal_operation_for_history_GUI_update_S__updating_exit)
-        
-        # state /normal_operation/for_history/polling
-        self.states["/normal_operation/for_history/polling"] = State(16, self)
-        
-        # state /normal_operation/for_history/polling/S_
-        self.states["/normal_operation/for_history/polling/S_"] = State(17, self)
-        
-        # state /normal_operation/for_history/polling/S_/okay
-        self.states["/normal_operation/for_history/polling/S_/okay"] = State(18, self)
-        self.states["/normal_operation/for_history/polling/S_/okay"].setEnter(self._normal_operation_for_history_polling_S__okay_enter)
-        self.states["/normal_operation/for_history/polling/S_/okay"].setExit(self._normal_operation_for_history_polling_S__okay_exit)
-        
-        # state /normal_operation/for_history/polling/S_/warn
-        self.states["/normal_operation/for_history/polling/S_/warn"] = State(19, self)
-        self.states["/normal_operation/for_history/polling/S_/warn"].setEnter(self._normal_operation_for_history_polling_S__warn_enter)
-        self.states["/normal_operation/for_history/polling/S_/warn"].setExit(self._normal_operation_for_history_polling_S__warn_exit)
-        
-        # state /normal_operation/H
-        self.states["/normal_operation/H"] = DeepHistoryState(20, self)
-        
-        # state /emergency_stop
-        self.states["/emergency_stop"] = State(21, self)
-        self.states["/emergency_stop"].setEnter(self._emergency_stop_enter)
-        self.states["/emergency_stop"].setExit(self._emergency_stop_exit)
-        
-        # state /finished
-        self.states["/finished"] = State(22, self)
-        self.states["/finished"].setEnter(self._finished_enter)
-        
-        # state /paused
-        self.states["/paused"] = State(23, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/normal_operation"])
-        self.states[""].addChild(self.states["/emergency_stop"])
-        self.states[""].addChild(self.states["/finished"])
-        self.states[""].addChild(self.states["/paused"])
-        self.states["/normal_operation"].addChild(self.states["/normal_operation/for_history"])
-        self.states["/normal_operation"].addChild(self.states["/normal_operation/H"])
-        self.states["/normal_operation/for_history"].addChild(self.states["/normal_operation/for_history/train"])
-        self.states["/normal_operation/for_history"].addChild(self.states["/normal_operation/for_history/GUI_update"])
-        self.states["/normal_operation/for_history"].addChild(self.states["/normal_operation/for_history/polling"])
-        self.states["/normal_operation/for_history/train"].addChild(self.states["/normal_operation/for_history/train/train"])
-        self.states["/normal_operation/for_history/train/train"].addChild(self.states["/normal_operation/for_history/train/train/stopped"])
-        self.states["/normal_operation/for_history/train/train"].addChild(self.states["/normal_operation/for_history/train/train/approaching_station"])
-        self.states["/normal_operation/for_history/train/train"].addChild(self.states["/normal_operation/for_history/train/train/driving"])
-        self.states["/normal_operation/for_history/train/train"].addChild(self.states["/normal_operation/for_history/train/train/max_speed"])
-        self.states["/normal_operation/for_history/train/train/stopped"].addChild(self.states["/normal_operation/for_history/train/train/stopped/opened_doors"])
-        self.states["/normal_operation/for_history/train/train/stopped"].addChild(self.states["/normal_operation/for_history/train/train/stopped/in_station"])
-        self.states["/normal_operation/for_history/train/train/stopped"].addChild(self.states["/normal_operation/for_history/train/train/stopped/allow_closing"])
-        self.states["/normal_operation/for_history/train/train/stopped"].addChild(self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"])
-        self.states["/normal_operation/for_history/GUI_update"].addChild(self.states["/normal_operation/for_history/GUI_update/S_"])
-        self.states["/normal_operation/for_history/GUI_update/S_"].addChild(self.states["/normal_operation/for_history/GUI_update/S_/updating"])
-        self.states["/normal_operation/for_history/polling"].addChild(self.states["/normal_operation/for_history/polling/S_"])
-        self.states["/normal_operation/for_history/polling/S_"].addChild(self.states["/normal_operation/for_history/polling/S_/okay"])
-        self.states["/normal_operation/for_history/polling/S_"].addChild(self.states["/normal_operation/for_history/polling/S_/warn"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/paused"]
-        self.states["/normal_operation"].default_state = self.states["/normal_operation/for_history"]
-        self.states["/normal_operation/for_history/train"].default_state = self.states["/normal_operation/for_history/train/train"]
-        self.states["/normal_operation/for_history/train/train"].default_state = self.states["/normal_operation/for_history/train/train/stopped"]
-        self.states["/normal_operation/for_history/train/train/stopped"].default_state = self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"]
-        self.states["/normal_operation/for_history/GUI_update"].default_state = self.states["/normal_operation/for_history/GUI_update/S_"]
-        self.states["/normal_operation/for_history/GUI_update/S_"].default_state = self.states["/normal_operation/for_history/GUI_update/S_/updating"]
-        self.states["/normal_operation/for_history/polling"].default_state = self.states["/normal_operation/for_history/polling/S_"]
-        self.states["/normal_operation/for_history/polling/S_"].default_state = self.states["/normal_operation/for_history/polling/S_/okay"]
-        
-        # transition /normal_operation/for_history/train/train/stopped/opened_doors
-        _normal_operation_for_history_train_train_stopped_opened_doors_0 = Transition(self, self.states["/normal_operation/for_history/train/train/stopped/opened_doors"], [self.states["/normal_operation/for_history/train/train/stopped/allow_closing"]])
-        _normal_operation_for_history_train_train_stopped_opened_doors_0.setTrigger(Event("_0after"))
-        self.states["/normal_operation/for_history/train/train/stopped/opened_doors"].addTransition(_normal_operation_for_history_train_train_stopped_opened_doors_0)
-        
-        # transition /normal_operation/for_history/train/train/stopped/in_station
-        _normal_operation_for_history_train_train_stopped_in_station_0 = Transition(self, self.states["/normal_operation/for_history/train/train/stopped/in_station"], [self.states["/normal_operation/for_history/train/train/stopped/opened_doors"]])
-        _normal_operation_for_history_train_train_stopped_in_station_0.setAction(self._normal_operation_for_history_train_train_stopped_in_station_0_exec)
-        _normal_operation_for_history_train_train_stopped_in_station_0.setTrigger(Event("open", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/stopped/in_station"].addTransition(_normal_operation_for_history_train_train_stopped_in_station_0)
-        
-        # transition /normal_operation/for_history/train/train/stopped/allow_closing
-        _normal_operation_for_history_train_train_stopped_allow_closing_0 = Transition(self, self.states["/normal_operation/for_history/train/train/stopped/allow_closing"], [self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"]])
-        _normal_operation_for_history_train_train_stopped_allow_closing_0.setAction(self._normal_operation_for_history_train_train_stopped_allow_closing_0_exec)
-        _normal_operation_for_history_train_train_stopped_allow_closing_0.setTrigger(Event("close", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/stopped/allow_closing"].addTransition(_normal_operation_for_history_train_train_stopped_allow_closing_0)
-        
-        # transition /normal_operation/for_history/train/train/stopped/ready_to_leave
-        _normal_operation_for_history_train_train_stopped_ready_to_leave_0 = Transition(self, self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"], [self.states["/normal_operation/for_history/train/train/driving"]])
-        _normal_operation_for_history_train_train_stopped_ready_to_leave_0.setAction(self._normal_operation_for_history_train_train_stopped_ready_to_leave_0_exec)
-        _normal_operation_for_history_train_train_stopped_ready_to_leave_0.setTrigger(Event("accel", "tkinter_input"))
-        _normal_operation_for_history_train_train_stopped_ready_to_leave_0.setGuard(self._normal_operation_for_history_train_train_stopped_ready_to_leave_0_guard)
-        self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"].addTransition(_normal_operation_for_history_train_train_stopped_ready_to_leave_0)
-        
-        # transition /normal_operation/for_history/train/train/approaching_station
-        _normal_operation_for_history_train_train_approaching_station_0 = Transition(self, self.states["/normal_operation/for_history/train/train/approaching_station"], [self.states["/normal_operation/for_history/train/train/stopped/in_station"]])
-        _normal_operation_for_history_train_train_approaching_station_0.setTrigger(None)
-        _normal_operation_for_history_train_train_approaching_station_0.setGuard(self._normal_operation_for_history_train_train_approaching_station_0_guard)
-        self.states["/normal_operation/for_history/train/train/approaching_station"].addTransition(_normal_operation_for_history_train_train_approaching_station_0)
-        _normal_operation_for_history_train_train_approaching_station_1 = Transition(self, self.states["/normal_operation/for_history/train/train/approaching_station"], [self.states["/normal_operation/for_history/train/train/approaching_station"]])
-        _normal_operation_for_history_train_train_approaching_station_1.setAction(self._normal_operation_for_history_train_train_approaching_station_1_exec)
-        _normal_operation_for_history_train_train_approaching_station_1.setTrigger(Event("accel", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/approaching_station"].addTransition(_normal_operation_for_history_train_train_approaching_station_1)
-        _normal_operation_for_history_train_train_approaching_station_2 = Transition(self, self.states["/normal_operation/for_history/train/train/approaching_station"], [self.states["/normal_operation/for_history/train/train/approaching_station"]])
-        _normal_operation_for_history_train_train_approaching_station_2.setAction(self._normal_operation_for_history_train_train_approaching_station_2_exec)
-        _normal_operation_for_history_train_train_approaching_station_2.setTrigger(Event("leave", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/approaching_station"].addTransition(_normal_operation_for_history_train_train_approaching_station_2)
-        
-        # transition /normal_operation/for_history/train/train/driving
-        _normal_operation_for_history_train_train_driving_0 = Transition(self, self.states["/normal_operation/for_history/train/train/driving"], [self.states["/normal_operation/for_history/train/train/max_speed"]])
-        _normal_operation_for_history_train_train_driving_0.setTrigger(None)
-        _normal_operation_for_history_train_train_driving_0.setGuard(self._normal_operation_for_history_train_train_driving_0_guard)
-        self.states["/normal_operation/for_history/train/train/driving"].addTransition(_normal_operation_for_history_train_train_driving_0)
-        _normal_operation_for_history_train_train_driving_1 = Transition(self, self.states["/normal_operation/for_history/train/train/driving"], [self.states["/normal_operation/for_history/train/train/stopped/ready_to_leave"]])
-        _normal_operation_for_history_train_train_driving_1.setTrigger(None)
-        _normal_operation_for_history_train_train_driving_1.setGuard(self._normal_operation_for_history_train_train_driving_1_guard)
-        self.states["/normal_operation/for_history/train/train/driving"].addTransition(_normal_operation_for_history_train_train_driving_1)
-        _normal_operation_for_history_train_train_driving_2 = Transition(self, self.states["/normal_operation/for_history/train/train/driving"], [self.states["/normal_operation/for_history/train/train/approaching_station"]])
-        _normal_operation_for_history_train_train_driving_2.setTrigger(Event("enter", "tkinter_input"))
-        _normal_operation_for_history_train_train_driving_2.setGuard(self._normal_operation_for_history_train_train_driving_2_guard)
-        self.states["/normal_operation/for_history/train/train/driving"].addTransition(_normal_operation_for_history_train_train_driving_2)
-        _normal_operation_for_history_train_train_driving_3 = Transition(self, self.states["/normal_operation/for_history/train/train/driving"], [self.states["/normal_operation/for_history/train/train/driving"]])
-        _normal_operation_for_history_train_train_driving_3.setAction(self._normal_operation_for_history_train_train_driving_3_exec)
-        _normal_operation_for_history_train_train_driving_3.setTrigger(Event("accel", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/driving"].addTransition(_normal_operation_for_history_train_train_driving_3)
-        _normal_operation_for_history_train_train_driving_4 = Transition(self, self.states["/normal_operation/for_history/train/train/driving"], [self.states["/normal_operation/for_history/train/train/approaching_station"]])
-        _normal_operation_for_history_train_train_driving_4.setAction(self._normal_operation_for_history_train_train_driving_4_exec)
-        _normal_operation_for_history_train_train_driving_4.setTrigger(Event("enter", None))
-        _normal_operation_for_history_train_train_driving_4.setGuard(self._normal_operation_for_history_train_train_driving_4_guard)
-        self.states["/normal_operation/for_history/train/train/driving"].addTransition(_normal_operation_for_history_train_train_driving_4)
-        
-        # transition /normal_operation/for_history/train/train/max_speed
-        _normal_operation_for_history_train_train_max_speed_0 = Transition(self, self.states["/normal_operation/for_history/train/train/max_speed"], [self.states["/normal_operation/for_history/train/train/driving"]])
-        _normal_operation_for_history_train_train_max_speed_0.setAction(self._normal_operation_for_history_train_train_max_speed_0_exec)
-        _normal_operation_for_history_train_train_max_speed_0.setTrigger(Event("accel", "tkinter_input"))
-        _normal_operation_for_history_train_train_max_speed_0.setGuard(self._normal_operation_for_history_train_train_max_speed_0_guard)
-        self.states["/normal_operation/for_history/train/train/max_speed"].addTransition(_normal_operation_for_history_train_train_max_speed_0)
-        _normal_operation_for_history_train_train_max_speed_1 = Transition(self, self.states["/normal_operation/for_history/train/train/max_speed"], [self.states["/normal_operation/for_history/train/train/max_speed"]])
-        _normal_operation_for_history_train_train_max_speed_1.setAction(self._normal_operation_for_history_train_train_max_speed_1_exec)
-        _normal_operation_for_history_train_train_max_speed_1.setTrigger(Event("enter", "tkinter_input"))
-        self.states["/normal_operation/for_history/train/train/max_speed"].addTransition(_normal_operation_for_history_train_train_max_speed_1)
-        
-        # transition /normal_operation/for_history/GUI_update/S_/updating
-        _normal_operation_for_history_GUI_update_S__updating_0 = Transition(self, self.states["/normal_operation/for_history/GUI_update/S_/updating"], [self.states["/normal_operation/for_history/GUI_update/S_/updating"]])
-        _normal_operation_for_history_GUI_update_S__updating_0.setAction(self._normal_operation_for_history_GUI_update_S__updating_0_exec)
-        _normal_operation_for_history_GUI_update_S__updating_0.setTrigger(Event("_1after"))
-        self.states["/normal_operation/for_history/GUI_update/S_/updating"].addTransition(_normal_operation_for_history_GUI_update_S__updating_0)
-        
-        # transition /normal_operation/for_history/polling/S_/okay
-        _normal_operation_for_history_polling_S__okay_0 = Transition(self, self.states["/normal_operation/for_history/polling/S_/okay"], [self.states["/normal_operation/for_history/polling/S_/warn"]])
-        _normal_operation_for_history_polling_S__okay_0.setAction(self._normal_operation_for_history_polling_S__okay_0_exec)
-        _normal_operation_for_history_polling_S__okay_0.setTrigger(Event("_2after"))
-        self.states["/normal_operation/for_history/polling/S_/okay"].addTransition(_normal_operation_for_history_polling_S__okay_0)
-        
-        # transition /normal_operation/for_history/polling/S_/warn
-        _normal_operation_for_history_polling_S__warn_0 = Transition(self, self.states["/normal_operation/for_history/polling/S_/warn"], [self.states["/normal_operation/for_history/polling/S_/okay"]])
-        _normal_operation_for_history_polling_S__warn_0.setAction(self._normal_operation_for_history_polling_S__warn_0_exec)
-        _normal_operation_for_history_polling_S__warn_0.setTrigger(Event("awake", "tkinter_input"))
-        self.states["/normal_operation/for_history/polling/S_/warn"].addTransition(_normal_operation_for_history_polling_S__warn_0)
-        _normal_operation_for_history_polling_S__warn_1 = Transition(self, self.states["/normal_operation/for_history/polling/S_/warn"], [self.states["/normal_operation/for_history/polling/S_/warn"]])
-        _normal_operation_for_history_polling_S__warn_1.setAction(self._normal_operation_for_history_polling_S__warn_1_exec)
-        _normal_operation_for_history_polling_S__warn_1.setTrigger(Event("_3after"))
-        self.states["/normal_operation/for_history/polling/S_/warn"].addTransition(_normal_operation_for_history_polling_S__warn_1)
-        
-        # transition /emergency_stop
-        _emergency_stop_0 = Transition(self, self.states["/emergency_stop"], [self.states["/finished"]])
-        _emergency_stop_0.setTrigger(None)
-        _emergency_stop_0.setGuard(self._emergency_stop_0_guard)
-        self.states["/emergency_stop"].addTransition(_emergency_stop_0)
-        _emergency_stop_1 = Transition(self, self.states["/emergency_stop"], [self.states["/emergency_stop"]])
-        _emergency_stop_1.setAction(self._emergency_stop_1_exec)
-        _emergency_stop_1.setTrigger(Event("_4after"))
-        self.states["/emergency_stop"].addTransition(_emergency_stop_1)
-        
-        # transition /paused
-        _paused_0 = Transition(self, self.states["/paused"], [self.states["/normal_operation/H"]])
-        _paused_0.setAction(self._paused_0_exec)
-        _paused_0.setTrigger(Event("continue", "tkinter_input"))
-        self.states["/paused"].addTransition(_paused_0)
-        
-        # transition /normal_operation
-        _normal_operation_0 = Transition(self, self.states["/normal_operation"], [self.states["/emergency_stop"]])
-        _normal_operation_0.setAction(self._normal_operation_0_exec)
-        _normal_operation_0.setTrigger(Event("red_light", "tkinter_input"))
-        self.states["/normal_operation"].addTransition(_normal_operation_0)
-        _normal_operation_1 = Transition(self, self.states["/normal_operation"], [self.states["/emergency_stop"]])
-        _normal_operation_1.setAction(self._normal_operation_1_exec)
-        _normal_operation_1.setTrigger(Event("yellow_light", "tkinter_input"))
-        _normal_operation_1.setGuard(self._normal_operation_1_guard)
-        self.states["/normal_operation"].addTransition(_normal_operation_1)
-        _normal_operation_2 = Transition(self, self.states["/normal_operation"], [self.states["/emergency_stop"]])
-        _normal_operation_2.setTrigger(Event("error", None))
-        self.states["/normal_operation"].addTransition(_normal_operation_2)
-        _normal_operation_3 = Transition(self, self.states["/normal_operation"], [self.states["/paused"]])
-        _normal_operation_3.setAction(self._normal_operation_3_exec)
-        _normal_operation_3.setTrigger(Event("pause", "tkinter_input"))
-        self.states["/normal_operation"].addTransition(_normal_operation_3)
-    
-    def _normal_operation_for_history_train_train_stopped_enter(self):
-        self.speed = 0.0
-        self.acceleration = 0.0
-    
-    def _normal_operation_for_history_train_train_stopped_opened_doors_enter(self):
-        self.addTimer(0, 5)
-        self.notify("Please wait before closing doors", "white")
-    
-    def _normal_operation_for_history_train_train_stopped_opened_doors_exit(self):
-        self.removeTimer(0)
-    
-    def _normal_operation_for_history_train_train_stopped_allow_closing_enter(self):
-        self.notify("You can now close the doors!", "white")
-    
-    def _normal_operation_for_history_train_train_max_speed_enter(self):
-        self.speed = 120.0
-        self.acceleration = 0.0
-        print("MAX")
-    
-    def _normal_operation_for_history_train_train_max_speed_exit(self):
-        print("LEAVE MAX")
-    
-    def _normal_operation_for_history_GUI_update_S__updating_enter(self):
-        self.addTimer(1, 0.02)
-    
-    def _normal_operation_for_history_GUI_update_S__updating_exit(self):
-        self.removeTimer(1)
-    
-    def _normal_operation_for_history_polling_S__okay_enter(self):
-        self.addTimer(2, 20.0)
-    
-    def _normal_operation_for_history_polling_S__okay_exit(self):
-        self.removeTimer(2)
-    
-    def _normal_operation_for_history_polling_S__warn_enter(self):
-        self.addTimer(3, 10.0)
-    
-    def _normal_operation_for_history_polling_S__warn_exit(self):
-        self.removeTimer(3)
-    
-    def _emergency_stop_enter(self):
-        self.addTimer(4, 0.02)
-        self.acceleration = -1
-    
-    def _emergency_stop_exit(self):
-        self.removeTimer(4)
-    
-    def _finished_enter(self):
-        self.acceleration = 0.0
-        self.speed = 0.0
-    
-    def _normal_operation_0_exec(self, parameters):
-        self.notify("Passed red light", "red")
-    
-    def _normal_operation_1_exec(self, parameters):
-        self.notify("Passed yellow light while driving too fast", "red")
-    
-    def _normal_operation_1_guard(self, parameters):
-        return self.speed > 50
-    
-    def _normal_operation_3_exec(self, parameters):
-        self.notify("Paused", "white")
-    
-    def _normal_operation_for_history_train_train_stopped_in_station_0_exec(self, parameters):
-        self.openDoors()
-    
-    def _normal_operation_for_history_train_train_stopped_allow_closing_0_exec(self, parameters):
-        self.closeDoors()
-    
-    def _normal_operation_for_history_train_train_stopped_ready_to_leave_0_exec(self, parameters):
-        value = parameters[0]
-        self.acceleration = value
-    
-    def _normal_operation_for_history_train_train_stopped_ready_to_leave_0_guard(self, parameters):
-        value = parameters[0]
-        return value > 0
-    
-    def _normal_operation_for_history_train_train_approaching_station_0_guard(self, parameters):
-        return self.speed <= 0
-    
-    def _normal_operation_for_history_train_train_approaching_station_1_exec(self, parameters):
-        value = parameters[0]
-        self.acceleration = value
-    
-    def _normal_operation_for_history_train_train_approaching_station_2_exec(self, parameters):
-        self.notify("Left station without stopping", "red")
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("error", None, [])]))
-    
-    def _normal_operation_for_history_train_train_driving_0_guard(self, parameters):
-        return self.speed >= 100 and self.acceleration > 0
-    
-    def _normal_operation_for_history_train_train_driving_1_guard(self, parameters):
-        return self.speed <= 0 and self.acceleration < 0
-    
-    def _normal_operation_for_history_train_train_driving_2_guard(self, parameters):
-        return self.speed <= 50
-    
-    def _normal_operation_for_history_train_train_driving_3_exec(self, parameters):
-        value = parameters[0]
-        self.acceleration = value
-    
-    def _normal_operation_for_history_train_train_driving_4_exec(self, parameters):
-        self.notify("Entered station too fast", "red")
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("error", None, [])]))
-    
-    def _normal_operation_for_history_train_train_driving_4_guard(self, parameters):
-        return self.speed > 50
-    
-    def _normal_operation_for_history_train_train_max_speed_0_exec(self, parameters):
-        value = parameters[0]
-        self.acceleration = value
-    
-    def _normal_operation_for_history_train_train_max_speed_0_guard(self, parameters):
-        value = parameters[0]
-        return value < 0
-    
-    def _normal_operation_for_history_train_train_max_speed_1_exec(self, parameters):
-        self.notify("Entered station at maximum speed!", "red")
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("error", None, [])]))
-    
-    def _normal_operation_for_history_GUI_update_S__updating_0_exec(self, parameters):
-        self.updateState()
-    
-    def _normal_operation_for_history_polling_S__okay_0_exec(self, parameters):
-        self.notify("Please press button!", "yellow")
-    
-    def _normal_operation_for_history_polling_S__warn_0_exec(self, parameters):
-        self.notify("", "gray")
-    
-    def _normal_operation_for_history_polling_S__warn_1_exec(self, parameters):
-        self.notify("Did not press the button in time", "red")
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("error", None, [])]))
-    
-    def _emergency_stop_0_guard(self, parameters):
-        return self.speed <= 0
-    
-    def _emergency_stop_1_exec(self, parameters):
-        self.updateState()
-    
-    def _paused_0_exec(self, parameters):
-        self.notify("", "gray")
-    
-    def initializeStatechart(self):
-        # enter default state
-        states = self.states["/paused"].getEffectiveTargetStates()
-        self.updateConfiguration(states)
-        for state in states:
-            if state.enter:
-                state.enter()
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Train":
-            instance = Train(self.controller, construct_params[0])
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(EventLoopControllerBase):
-    def __init__(self, root, event_loop_callbacks, finished_callback = None, behind_schedule_callback = None):
-        if finished_callback == None: finished_callback = None
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        EventLoopControllerBase.__init__(self, ObjectManager(self), event_loop_callbacks, finished_callback, behind_schedule_callback)
-        self.addInputPort("tkinter_input")
-        self.object_manager.createInstance("Train", [root])

+ 0 - 162
test/target_js/big_step_maximality/00_take_one.js

@@ -1,162 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:50 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_one
-Model description:
-Take One-semantics: Each big step, only one transition can be made (per orthogonal component).*/
-
-
-// package "take_one"
-var take_one = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeOne;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setTrigger(null);
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(null);
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_one'
-take_one.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_one'
-take_one.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_one'
-take_one.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_one'
-take_one.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array())], [new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_one'
-take_one.Test = Test;
-})();

+ 0 - 162
test/target_js/big_step_maximality/01_take_many.js

@@ -1,162 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:50 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many
-Model description:
-Take Many-semantics: A big step doesn't end until there are no more enabled transitions.*/
-
-
-// package "take_many"
-var take_many = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setTrigger(null);
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(null);
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_many'
-take_many.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_many'
-take_many.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_many'
-take_many.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_many'
-take_many.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array()), new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_many'
-take_many.Test = Test;
-})();

+ 0 - 213
test/target_js/big_step_maximality/10_orthogonal_take_one.js

@@ -1,213 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:50 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_one
-Model description:
-Take One-semantics: Each big step, a transition in each orthogonal component is made.*/
-
-
-// package "orthogonal_take_one"
-var orthogonal_take_one = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeOne;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o0/sc
-    this.states["/p/o0/sc"] = new State(5, this);
-    this.states["/p/o0/sc"].setEnter(this._p_o0_sc_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(6, this);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // state /p/o1/sf
-    this.states["/p/o1/sf"] = new State(9, this);
-    this.states["/p/o1/sf"].setEnter(this._p_o1_sf_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sf"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sd"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setTrigger(null);
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sc"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(null);
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-    
-    // transition /p/o1/se
-    var _p_o1_se_0 = new Transition(this, this.states["/p/o1/se"], [this.states["/p/o1/sf"]]);
-    _p_o1_se_0.setTrigger(null);
-    this.states["/p/o1/se"].addTransition(_p_o1_se_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o0_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o1_sf_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sf", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_one'
-orthogonal_take_one.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_one'
-orthogonal_take_one.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_one'
-orthogonal_take_one.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_one'
-orthogonal_take_one.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sd", "out", new Array())], [new Event("entered_sb", "out", new Array()), new Event("entered_se", "out", new Array())], [new Event("entered_sc", "out", new Array()), new Event("entered_sf", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_one'
-orthogonal_take_one.Test = Test;
-})();

+ 0 - 213
test/target_js/big_step_maximality/11_orthogonal_take_many.js

@@ -1,213 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:50 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many
-Model description:
-Take Many-semantics: In both components, transitions keep firing until there are no more enabled transitions.*/
-
-
-// package "orthogonal_take_many"
-var orthogonal_take_many = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o0/sc
-    this.states["/p/o0/sc"] = new State(5, this);
-    this.states["/p/o0/sc"].setEnter(this._p_o0_sc_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(6, this);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // state /p/o1/sf
-    this.states["/p/o1/sf"] = new State(9, this);
-    this.states["/p/o1/sf"].setEnter(this._p_o1_sf_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sf"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sd"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setTrigger(null);
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sc"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(null);
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-    
-    // transition /p/o1/se
-    var _p_o1_se_0 = new Transition(this, this.states["/p/o1/se"], [this.states["/p/o1/sf"]]);
-    _p_o1_se_0.setTrigger(null);
-    this.states["/p/o1/se"].addTransition(_p_o1_se_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o0_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o1_sf_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sf", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_many'
-orthogonal_take_many.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_many'
-orthogonal_take_many.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_many'
-orthogonal_take_many.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_many'
-orthogonal_take_many.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sd", "out", new Array())], [new Event("entered_sb", "out", new Array()), new Event("entered_se", "out", new Array()), new Event("entered_sc", "out", new Array()), new Event("entered_sf", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_many'
-orthogonal_take_many.Test = Test;
-})();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 167
test/target_js/event_lifeline/00_take_one_next_small_step.js


+ 0 - 167
test/target_js/event_lifeline/02_take_one_queue.js

@@ -1,167 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_one_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internal events are treated just like external events: They are added to the object's event queue and will be sensed in another big step. This way, a raised internal event will always be sensed at some point later in time, but it is possible that other (external) events in the object's event queue are treated first.*/
-
-
-// package "take_one_queue"
-var take_one_queue = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeOne;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("e", "in"));
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(new Event("f", null));
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype._a_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_one_queue'
-take_one_queue.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_one_queue'
-take_one_queue.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_one_queue'
-take_one_queue.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_one_queue'
-take_one_queue.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array())], [new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_one_queue'
-take_one_queue.Test = Test;
-})();

+ 0 - 167
test/target_js/event_lifeline/10_take_many_next_small_step.js

@@ -1,167 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_next_small_step
-Model description:
-Internal event lifeline - Next Small Step-semantics: Internally raised events become present in the next small step.*/
-
-
-// package "take_many_next_small_step"
-var take_many_next_small_step = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("e", "in"));
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(new Event("f", null));
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype._a_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_many_next_small_step'
-take_many_next_small_step.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_many_next_small_step'
-take_many_next_small_step.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_many_next_small_step'
-take_many_next_small_step.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_many_next_small_step'
-take_many_next_small_step.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array()), new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_many_next_small_step'
-take_many_next_small_step.Test = Test;
-})();

+ 0 - 167
test/target_js/event_lifeline/11_take_many_next_combo_step.js

@@ -1,167 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_next_combo_step
-Model description:
-Internal event lifeline - Next Combo Step-semantics: Internally raised events become present in and throughout the next combo step.*/
-
-
-// package "take_many_next_combo_step"
-var take_many_next_combo_step = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.NextComboStep;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("e", "in"));
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(new Event("f", null));
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype._a_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_many_next_combo_step'
-take_many_next_combo_step.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_many_next_combo_step'
-take_many_next_combo_step.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_many_next_combo_step'
-take_many_next_combo_step.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_many_next_combo_step'
-take_many_next_combo_step.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array()), new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_many_next_combo_step'
-take_many_next_combo_step.Test = Test;
-})();

+ 0 - 167
test/target_js/event_lifeline/12_take_many_queue.js

@@ -1,167 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internally raised events are treated like external events and are added to the object's event queue. They become present in another big step later on.*/
-
-
-// package "take_many_queue"
-var take_many_queue = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(3, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("e", "in"));
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/c"]]);
-    _b_0.setTrigger(new Event("f", null));
-    this.states["/b"].addTransition(_b_0);
-};
-
-c.prototype._a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype._a_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'take_many_queue'
-take_many_queue.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'take_many_queue'
-take_many_queue.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'take_many_queue'
-take_many_queue.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'take_many_queue'
-take_many_queue.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array())], [new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'take_many_queue'
-take_many_queue.Test = Test;
-})();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 216
test/target_js/event_lifeline/20_orthogonal_take_one_next_small_step.js


+ 0 - 214
test/target_js/event_lifeline/21_orthogonal_take_one_queue.js

@@ -1,214 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_one_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internal events are treated just like external events: They are added to the object's event queue and will be sensed in another big step. This way, a raised internal event will always be sensed at some point later in time, but it is possible that other (external) events in the object's event queue are treated first.*/
-
-
-// package "orthogonal_take_one_queue"
-var orthogonal_take_one_queue = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeOne;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(5, this);
-    
-    // state /p/o1/sc
-    this.states["/p/o1/sc"] = new State(6, this);
-    this.states["/p/o1/sc"].setEnter(this._p_o1_sc_enter);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sc"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setAction(this._p_o0_sa_0_exec);
-    _p_o0_sa_0.setTrigger(new Event("f", null));
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sa"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sc
-    var _p_o1_sc_0 = new Transition(this, this.states["/p/o1/sc"], [this.states["/p/o1/sd"]]);
-    _p_o1_sc_0.setAction(this._p_o1_sc_0_exec);
-    _p_o1_sc_0.setTrigger(new Event("e", "in"));
-    this.states["/p/o1/sc"].addTransition(_p_o1_sc_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(new Event("g", null));
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o1_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o0_sa_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("g", null, new Array()));
-};
-
-c.prototype._p_o1_sc_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_one_queue'
-orthogonal_take_one_queue.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_one_queue'
-orthogonal_take_one_queue.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_one_queue'
-orthogonal_take_one_queue.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_one_queue'
-orthogonal_take_one_queue.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sc", "out", new Array())], [new Event("entered_sd", "out", new Array())], [new Event("entered_sb", "out", new Array())], [new Event("entered_sa", "out", new Array()), new Event("entered_se", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_one_queue'
-orthogonal_take_one_queue.Test = Test;
-})();

+ 0 - 218
test/target_js/event_lifeline/30_orthogonal_take_many_next_small_step.js

@@ -1,218 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_next_small_step
-Model description:
-This test is a variation of 'orthogonal_next_small_step', but instead we use 'Take Many' big-step maximality semantics, allowing a big step to consist of as many small steps as possible (i.e. keep on executing transitions until there are no longer any enabled transitions).
-
-		In this configuration, internally raised events cannot be lost: if there is a transition that is triggered by an internal event that was raised by a transition from the previous small step, the transition will have a chance of being executed, *but* if there are other transitions (e.g. in other orthogonal components) that are enabled as well, it is possible for one of those to "occupy" the small step and the transition to "miss" it's event. There are 2 solutions to this problem:
-			1) Combine 'Take One' and 'Take Many' semantics, by using 'Take Many' for big step maximality, and 'Take One' for combo step maximality. An internally raised event then becomes present in the next combo step. These semantics are used in Statemate.
-			2) Use concurrency semantics: multiple (orthogonal) transitions are allowed to be executed in a single small step.*/
-
-
-// package "orthogonal_take_many_next_small_step"
-var orthogonal_take_many_next_small_step = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(5, this);
-    
-    // state /p/o1/sc
-    this.states["/p/o1/sc"] = new State(6, this);
-    this.states["/p/o1/sc"].setEnter(this._p_o1_sc_enter);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sc"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setAction(this._p_o0_sa_0_exec);
-    _p_o0_sa_0.setTrigger(new Event("f", null));
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sa"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sc
-    var _p_o1_sc_0 = new Transition(this, this.states["/p/o1/sc"], [this.states["/p/o1/sd"]]);
-    _p_o1_sc_0.setAction(this._p_o1_sc_0_exec);
-    _p_o1_sc_0.setTrigger(new Event("e", "in"));
-    this.states["/p/o1/sc"].addTransition(_p_o1_sc_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(new Event("g", null));
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o1_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o0_sa_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("g", null, new Array()));
-};
-
-c.prototype._p_o1_sc_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_many_next_small_step'
-orthogonal_take_many_next_small_step.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_many_next_small_step'
-orthogonal_take_many_next_small_step.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_many_next_small_step'
-orthogonal_take_many_next_small_step.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_many_next_small_step'
-orthogonal_take_many_next_small_step.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sc", "out", new Array())], [new Event("entered_sd", "out", new Array()), new Event("entered_sb", "out", new Array()), new Event("entered_sa", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_many_next_small_step'
-orthogonal_take_many_next_small_step.Test = Test;
-})();

+ 0 - 213
test/target_js/event_lifeline/31_orthogonal_take_many_next_combo_step.js

@@ -1,213 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:51 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_next_combo_step
-*/
-
-
-// package "orthogonal_take_many_next_combo_step"
-var orthogonal_take_many_next_combo_step = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.NextComboStep;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(5, this);
-    
-    // state /p/o1/sc
-    this.states["/p/o1/sc"] = new State(6, this);
-    this.states["/p/o1/sc"].setEnter(this._p_o1_sc_enter);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sc"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setAction(this._p_o0_sa_0_exec);
-    _p_o0_sa_0.setTrigger(new Event("f", null));
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sa"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sc
-    var _p_o1_sc_0 = new Transition(this, this.states["/p/o1/sc"], [this.states["/p/o1/sd"]]);
-    _p_o1_sc_0.setAction(this._p_o1_sc_0_exec);
-    _p_o1_sc_0.setTrigger(new Event("e", "in"));
-    this.states["/p/o1/sc"].addTransition(_p_o1_sc_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(new Event("g", null));
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o1_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o0_sa_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("g", null, new Array()));
-};
-
-c.prototype._p_o1_sc_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_many_next_combo_step'
-orthogonal_take_many_next_combo_step.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_many_next_combo_step'
-orthogonal_take_many_next_combo_step.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_many_next_combo_step'
-orthogonal_take_many_next_combo_step.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_many_next_combo_step'
-orthogonal_take_many_next_combo_step.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sc", "out", new Array())], [new Event("entered_sd", "out", new Array()), new Event("entered_sb", "out", new Array()), new Event("entered_sa", "out", new Array()), new Event("entered_se", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_many_next_combo_step'
-orthogonal_take_many_next_combo_step.Test = Test;
-})();

+ 0 - 214
test/target_js/event_lifeline/32_orthogonal_take_many_queue.js

@@ -1,214 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_queue
-Model description:
-This test is a variation of 'orthogonal_queue', using 'Take Many' semantics instead of 'Take One'. Because 'Queue' internal event lifeline-semantics already does not suffer from events getting "lost", the combination of 'Take Many' and 'Queue' is not very useful. But it is included as a test for the sake of completeness.*/
-
-
-// package "orthogonal_take_many_queue"
-var orthogonal_take_many_queue = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /p
-    this.states["/p"] = new ParallelState(1, this);
-    
-    // state /p/o0
-    this.states["/p/o0"] = new State(2, this);
-    
-    // state /p/o0/sa
-    this.states["/p/o0/sa"] = new State(3, this);
-    this.states["/p/o0/sa"].setEnter(this._p_o0_sa_enter);
-    
-    // state /p/o0/sb
-    this.states["/p/o0/sb"] = new State(4, this);
-    this.states["/p/o0/sb"].setEnter(this._p_o0_sb_enter);
-    
-    // state /p/o1
-    this.states["/p/o1"] = new State(5, this);
-    
-    // state /p/o1/sc
-    this.states["/p/o1/sc"] = new State(6, this);
-    this.states["/p/o1/sc"].setEnter(this._p_o1_sc_enter);
-    
-    // state /p/o1/sd
-    this.states["/p/o1/sd"] = new State(7, this);
-    this.states["/p/o1/sd"].setEnter(this._p_o1_sd_enter);
-    
-    // state /p/o1/se
-    this.states["/p/o1/se"] = new State(8, this);
-    this.states["/p/o1/se"].setEnter(this._p_o1_se_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/p"]);
-    this.states["/p"].addChild(this.states["/p/o0"]);
-    this.states["/p"].addChild(this.states["/p/o1"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sa"]);
-    this.states["/p/o0"].addChild(this.states["/p/o0/sb"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sc"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/sd"]);
-    this.states["/p/o1"].addChild(this.states["/p/o1/se"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/p"];
-    this.states["/p/o0"].default_state = this.states["/p/o0/sa"];
-    this.states["/p/o1"].default_state = this.states["/p/o1/sc"];
-    
-    // transition /p/o0/sa
-    var _p_o0_sa_0 = new Transition(this, this.states["/p/o0/sa"], [this.states["/p/o0/sb"]]);
-    _p_o0_sa_0.setAction(this._p_o0_sa_0_exec);
-    _p_o0_sa_0.setTrigger(new Event("f", null));
-    this.states["/p/o0/sa"].addTransition(_p_o0_sa_0);
-    
-    // transition /p/o0/sb
-    var _p_o0_sb_0 = new Transition(this, this.states["/p/o0/sb"], [this.states["/p/o0/sa"]]);
-    _p_o0_sb_0.setTrigger(null);
-    this.states["/p/o0/sb"].addTransition(_p_o0_sb_0);
-    
-    // transition /p/o1/sc
-    var _p_o1_sc_0 = new Transition(this, this.states["/p/o1/sc"], [this.states["/p/o1/sd"]]);
-    _p_o1_sc_0.setAction(this._p_o1_sc_0_exec);
-    _p_o1_sc_0.setTrigger(new Event("e", "in"));
-    this.states["/p/o1/sc"].addTransition(_p_o1_sc_0);
-    
-    // transition /p/o1/sd
-    var _p_o1_sd_0 = new Transition(this, this.states["/p/o1/sd"], [this.states["/p/o1/se"]]);
-    _p_o1_sd_0.setTrigger(new Event("g", null));
-    this.states["/p/o1/sd"].addTransition(_p_o1_sd_0);
-};
-
-c.prototype._p_o0_sa_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sa", "out", new Array()));
-};
-
-c.prototype._p_o0_sb_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sb", "out", new Array()));
-};
-
-c.prototype._p_o1_sc_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sc", "out", new Array()));
-};
-
-c.prototype._p_o1_sd_enter = function() {
-    this.big_step.outputEvent(new Event("entered_sd", "out", new Array()));
-};
-
-c.prototype._p_o1_se_enter = function() {
-    this.big_step.outputEvent(new Event("entered_se", "out", new Array()));
-};
-
-c.prototype._p_o0_sa_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("g", null, new Array()));
-};
-
-c.prototype._p_o1_sc_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("f", null, new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/p"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'orthogonal_take_many_queue'
-orthogonal_take_many_queue.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'orthogonal_take_many_queue'
-orthogonal_take_many_queue.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'orthogonal_take_many_queue'
-orthogonal_take_many_queue.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'orthogonal_take_many_queue'
-orthogonal_take_many_queue.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("entered_sa", "out", new Array()), new Event("entered_sc", "out", new Array())], [new Event("entered_sd", "out", new Array())], [new Event("entered_sb", "out", new Array()), new Event("entered_sa", "out", new Array())], [new Event("entered_se", "out", new Array())]];
-
-// add symbol 'Test' to package 'orthogonal_take_many_queue'
-orthogonal_take_many_queue.Test = Test;
-})();

+ 0 - 210
test/target_js/no_statechart/00_no_statechart_js.js

@@ -1,210 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   no_statechart
-Model description:
-Test to see what happens when a class with no statechart is defined.*/
-
-
-// package "no_statechart"
-var no_statechart = {};
-(function() {
-
-var my_struct = function(x, y) {
-    
-    // user defined attributes
-    this.x = null;
-    this.y = null;
-    
-    // call user defined constructor
-    my_struct.prototype.user_defined_constructor.call(this, x, y);
-};
-
-my_struct.prototype.user_defined_constructor = function(x, y) {
-    this.x = x;
-    this.y = y;
-};
-
-my_struct.prototype.user_defined_destructor = function() {
-};
-
-// add symbol 'my_struct' to package 'no_statechart'
-no_statechart.my_struct = my_struct;
-
-var my_class = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    my_class.prototype.user_defined_constructor.call(this);
-};
-my_class.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        my_class.prototype[prop] = proto[prop];
-    }
-})();
-
-my_class.prototype.user_defined_constructor = function() {
-    this.data = new my_struct(0, 0);
-};
-
-my_class.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-my_class.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    this.states["/a"].setExit(this._a_exit);
-    
-    // state /b
-    this.states["/b"] = new State(2, this);
-    this.states["/b"].setEnter(this._b_enter);
-    this.states["/b"].setExit(this._b_exit);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].addChild(this.states["/b"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/b"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("_0after"));
-    _a_0.setGuard(this._a_0_guard);
-    this.states["/a"].addTransition(_a_0);
-    
-    // transition /b
-    var _b_0 = new Transition(this, this.states["/b"], [this.states["/a"]]);
-    _b_0.setAction(this._b_0_exec);
-    _b_0.setTrigger(new Event("_1after"));
-    _b_0.setGuard(this._b_0_guard);
-    this.states["/b"].addTransition(_b_0);
-};
-
-my_class.prototype._a_enter = function() {
-    this.addTimer(0, 0.1);
-};
-
-my_class.prototype._a_exit = function() {
-    this.removeTimer(0);
-};
-
-my_class.prototype._b_enter = function() {
-    this.addTimer(1, 0.1);
-};
-
-my_class.prototype._b_exit = function() {
-    this.removeTimer(1);
-};
-
-my_class.prototype._a_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("to_b", "out", [this.data.x]));
-    this.data.x += 1;
-};
-
-my_class.prototype._a_0_guard = function(parameters) {
-    return this.data.x < 2;
-};
-
-my_class.prototype._b_0_exec = function(parameters) {
-    this.data.y += 1;
-    this.big_step.outputEvent(new Event("to_a", "out", [this.data.y]));
-};
-
-my_class.prototype._b_0_guard = function(parameters) {
-    return this.data.y < 2;
-};
-
-my_class.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'my_class' to package 'no_statechart'
-no_statechart.my_class = my_class;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "my_struct") {
-        var instance = new my_struct(this.controller, construct_params[0], construct_params[1]);
-        instance.associations = new Object();
-    } else if (class_name === "my_class") {
-        var instance = new my_class(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'no_statechart'
-no_statechart.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("my_class", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'no_statechart'
-no_statechart.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'no_statechart'
-no_statechart.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("to_b", "out", [0])], [new Event("to_a", "out", [1])], [new Event("to_b", "out", [1])], [new Event("to_a", "out", [2])]];
-
-// add symbol 'Test' to package 'no_statechart'
-no_statechart.Test = Test;
-})();

+ 0 - 172
test/target_js/original_semantics/after.js

@@ -1,172 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestAfter
-Model description:
-Used for testing the AFTER event.*/
-
-
-// package "TestAfter"
-var TestAfter = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /composite
-    this.states["/composite"] = new State(1, this);
-    
-    // state /composite/state_1
-    this.states["/composite/state_1"] = new State(2, this);
-    this.states["/composite/state_1"].setEnter(this._composite_state_1_enter);
-    this.states["/composite/state_1"].setExit(this._composite_state_1_exit);
-    
-    // state /composite/state_2
-    this.states["/composite/state_2"] = new State(3, this);
-    this.states["/composite/state_2"].setEnter(this._composite_state_2_enter);
-    
-    // state /composite/state_3
-    this.states["/composite/state_3"] = new State(4, this);
-    this.states["/composite/state_3"].setEnter(this._composite_state_3_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/composite"]);
-    this.states["/composite"].addChild(this.states["/composite/state_1"]);
-    this.states["/composite"].addChild(this.states["/composite/state_2"]);
-    this.states["/composite"].addChild(this.states["/composite/state_3"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/composite"];
-    this.states["/composite"].default_state = this.states["/composite/state_1"];
-    
-    // transition /composite/state_1
-    var _composite_state_1_0 = new Transition(this, this.states["/composite/state_1"], [this.states["/composite/state_2"]]);
-    _composite_state_1_0.setTrigger(new Event("_0after"));
-    this.states["/composite/state_1"].addTransition(_composite_state_1_0);
-    var _composite_state_1_1 = new Transition(this, this.states["/composite/state_1"], [this.states["/composite/state_3"]]);
-    _composite_state_1_1.setTrigger(new Event("_1after"));
-    this.states["/composite/state_1"].addTransition(_composite_state_1_1);
-};
-
-Class1.prototype._composite_state_1_enter = function() {
-    this.addTimer(0, 0.1);
-    this.addTimer(1, 0.2);
-};
-
-Class1.prototype._composite_state_1_exit = function() {
-    this.removeTimer(0);
-    this.removeTimer(1);
-};
-
-Class1.prototype._composite_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-Class1.prototype._composite_state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/composite"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestAfter'
-TestAfter.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestAfter'
-TestAfter.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestAfter'
-TestAfter.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestAfter'
-TestAfter.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("in_state_2", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestAfter'
-TestAfter.Test = Test;
-})();

+ 0 - 244
test/target_js/original_semantics/after_0.js

@@ -1,244 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Yentl Van Tendeloo
-Model name:   after_0
-Model description:
-Used for testing the AFTER(0) event---which should not block the deletion of the B instance.*/
-
-
-// package "after_0"
-var after_0 = {};
-(function() {
-
-var A = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    A.prototype.user_defined_constructor.call(this);
-};
-A.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        A.prototype[prop] = proto[prop];
-    }
-})();
-
-A.prototype.user_defined_constructor = function() {
-};
-
-A.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-A.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /x
-    this.states["/x"] = new State(1, this);
-    this.states["/x"].setEnter(this._x_enter);
-    
-    // state /ready
-    this.states["/ready"] = new State(2, this);
-    this.states["/ready"].setEnter(this._ready_enter);
-    
-    // state /done
-    this.states["/done"] = new State(3, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/x"]);
-    this.states[""].addChild(this.states["/ready"]);
-    this.states[""].addChild(this.states["/done"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/x"];
-    
-    // transition /x
-    var _x_0 = new Transition(this, this.states["/x"], [this.states["/ready"]]);
-    _x_0.setTrigger(new Event("instance_created", null));
-    this.states["/x"].addTransition(_x_0);
-    
-    // transition /ready
-    var _ready_0 = new Transition(this, this.states["/ready"], [this.states["/done"]]);
-    _ready_0.setAction(this._ready_0_exec);
-    _ready_0.setTrigger(new Event("close", null));
-    this.states["/ready"].addTransition(_ready_0);
-};
-
-A.prototype._x_enter = function() {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, 'child', 'B']));
-    this.big_step.outputEvent(new Event("creating_instance", "test_output", new Array()));
-};
-
-A.prototype._ready_enter = function() {
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, 'child[0]']));
-    this.big_step.outputEvent(new Event("starting_instance", "test_output", new Array()));
-};
-
-A.prototype._ready_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("delete_instance", null, [this, 'child[0]']));
-    this.big_step.outputEvent(new Event("deleting_instance", "test_output", new Array()));
-};
-
-A.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/x"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'A' to package 'after_0'
-after_0.A = A;
-
-var B = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    B.prototype.user_defined_constructor.call(this);
-};
-B.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        B.prototype[prop] = proto[prop];
-    }
-})();
-
-B.prototype.user_defined_constructor = function() {
-};
-
-B.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-B.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /z
-    this.states["/z"] = new State(1, this);
-    this.states["/z"].setEnter(this._z_enter);
-    this.states["/z"].setExit(this._z_exit);
-    
-    // add children
-    this.states[""].addChild(this.states["/z"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/z"];
-    
-    // transition /z
-    var _z_0 = new Transition(this, this.states["/z"], [this.states["/z"]]);
-    _z_0.setAction(this._z_0_exec);
-    _z_0.setTrigger(new Event("_0after"));
-    this.states["/z"].addTransition(_z_0);
-};
-
-B.prototype._z_enter = function() {
-    this.addTimer(0, 0);
-};
-
-B.prototype._z_exit = function() {
-    this.removeTimer(0);
-};
-
-B.prototype._z_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("broad_cast", null, [new Event("close", null, new Array())]));
-    this.big_step.outputEvent(new Event("after_0", "test_output", new Array()));
-};
-
-B.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/z"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'B' to package 'after_0'
-after_0.B = B;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "A") {
-        var instance = new A(this.controller);
-        instance.associations = new Object();
-        instance.associations["child"] = new Association("B", 0, 1);
-    } else if (class_name === "B") {
-        var instance = new B(this.controller);
-        instance.associations = new Object();
-        instance.associations["parent"] = new Association("A", 1, 1);
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'after_0'
-after_0.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("A", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'after_0'
-after_0.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'after_0'
-after_0.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("creating_instance", "test_output", new Array())], [new Event("starting_instance", "test_output", new Array())], [new Event("after_0", "test_output", new Array())], [new Event("deleting_instance", "test_output", new Array()), new Event("after_0", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'after_0'
-after_0.Test = Test;
-})();

+ 0 - 227
test/target_js/original_semantics/associate_event.js

@@ -1,227 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestAssociateEvent
-Model description:
-Testing the object manager*/
-
-
-// package "TestAssociateEvent"
-var TestAssociateEvent = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /start
-    this.states["/start"] = new State(1, this);
-    
-    // state /wait
-    this.states["/wait"] = new State(2, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/start"]);
-    this.states[""].addChild(this.states["/wait"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/start"];
-    
-    // transition /start
-    var _start_0 = new Transition(this, this.states["/start"], [this.states["/wait"]]);
-    _start_0.setAction(this._start_0_exec);
-    _start_0.setTrigger(new Event("create", "test_input"));
-    this.states["/start"].addTransition(_start_0);
-    
-    // transition /wait
-    var _wait_0 = new Transition(this, this.states["/wait"], [this.states["/start"]]);
-    _wait_0.setAction(this._wait_0_exec);
-    _wait_0.setTrigger(new Event("instance_created", null));
-    this.states["/wait"].addTransition(_wait_0);
-};
-
-Class1.prototype._start_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "test2_association"]));
-    this.big_step.outputEvent(new Event("request_send", "test_output", new Array()));
-};
-
-Class1.prototype._wait_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEvent(new Event("instance_created", "test_output", new Array()));
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, "test2_association"]));
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, "test2_association", new Event("hello", null, new Array())]));
-    this.big_step.outputEventOM(new Event("associate_instance", null, [this, "test2_association", "test3_association"]));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/start"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestAssociateEvent'
-TestAssociateEvent.Class1 = Class1;
-
-var Class2 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class2.prototype.user_defined_constructor.call(this);
-};
-Class2.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class2.prototype[prop] = proto[prop];
-    }
-})();
-
-Class2.prototype.user_defined_constructor = function() {
-};
-
-Class2.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class2.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /start
-    this.states["/start"] = new State(1, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/start"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/start"];
-    
-    // transition /start
-    var _start_0 = new Transition(this, this.states["/start"], [this.states["/start"]]);
-    _start_0.setAction(this._start_0_exec);
-    _start_0.setTrigger(new Event("hello", null));
-    this.states["/start"].addTransition(_start_0);
-};
-
-Class2.prototype._start_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("second_working", "test_output", new Array()));
-};
-
-Class2.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/start"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class2' to package 'TestAssociateEvent'
-TestAssociateEvent.Class2 = Class2;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-        instance.associations["test2_association"] = new Association("Class2", 0, -1);
-        instance.associations["test3_association"] = new Association("Class2", 0, -1);
-    } else if (class_name === "Class2") {
-        var instance = new Class2(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestAssociateEvent'
-TestAssociateEvent.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestAssociateEvent'
-TestAssociateEvent.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestAssociateEvent'
-TestAssociateEvent.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("create", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("request_send", "test_output", new Array())], [new Event("instance_created", "test_output", new Array())], [new Event("second_working", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestAssociateEvent'
-TestAssociateEvent.Test = Test;
-})();

+ 0 - 149
test/target_js/original_semantics/correct_duplicate_state_id.js

@@ -1,149 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestCorrectDuplicateStateId
-Model description:
-Testing duplicate id's.*/
-
-
-// package "TestCorrectDuplicateStateId"
-var TestCorrectDuplicateStateId = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /state0
-    this.states["/state0"] = new State(1, this);
-    
-    // state /state0/state1
-    this.states["/state0/state1"] = new State(2, this);
-    
-    // state /state0/state0
-    this.states["/state0/state0"] = new State(3, this);
-    
-    // state /state1
-    this.states["/state1"] = new State(4, this);
-    
-    // state /state1/state1
-    this.states["/state1/state1"] = new State(5, this);
-    
-    // state /state1/state0
-    this.states["/state1/state0"] = new State(6, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/state0"]);
-    this.states[""].addChild(this.states["/state1"]);
-    this.states["/state0"].addChild(this.states["/state0/state1"]);
-    this.states["/state0"].addChild(this.states["/state0/state0"]);
-    this.states["/state1"].addChild(this.states["/state1/state1"]);
-    this.states["/state1"].addChild(this.states["/state1/state0"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/state1"];
-    this.states["/state0"].default_state = this.states["/state0/state1"];
-    this.states["/state1"].default_state = this.states["/state1/state1"];
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/state1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestCorrectDuplicateStateId'
-TestCorrectDuplicateStateId.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestCorrectDuplicateStateId'
-TestCorrectDuplicateStateId.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestCorrectDuplicateStateId'
-TestCorrectDuplicateStateId.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestCorrectDuplicateStateId'
-TestCorrectDuplicateStateId.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = new Array();
-
-// add symbol 'Test' to package 'TestCorrectDuplicateStateId'
-TestCorrectDuplicateStateId.Test = Test;
-})();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 241
test/target_js/original_semantics/enter_exit_hierarchy.js


+ 0 - 172
test/target_js/original_semantics/guard.js

@@ -1,172 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:52 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestGuard
-Model description:
-Testing the guard.*/
-
-
-// package "TestGuard"
-var TestGuard = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // user defined attributes
-    this.member1 = 0;
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /state_1
-    this.states["/state_1"] = new State(1, this);
-    this.states["/state_1"].setEnter(this._state_1_enter);
-    
-    // state /state_2
-    this.states["/state_2"] = new State(2, this);
-    
-    // state /state_3
-    this.states["/state_3"] = new State(3, this);
-    this.states["/state_3"].setEnter(this._state_3_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/state_1"]);
-    this.states[""].addChild(this.states["/state_2"]);
-    this.states[""].addChild(this.states["/state_3"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/state_1"];
-    
-    // transition /state_1
-    var _state_1_0 = new Transition(this, this.states["/state_1"], [this.states["/state_2"]]);
-    _state_1_0.setTrigger(null);
-    this.states["/state_1"].addTransition(_state_1_0);
-    
-    // transition /state_2
-    var _state_2_0 = new Transition(this, this.states["/state_2"], [this.states["/state_1"]]);
-    _state_2_0.setTrigger(null);
-    _state_2_0.setGuard(this._state_2_0_guard);
-    this.states["/state_2"].addTransition(_state_2_0);
-    var _state_2_1 = new Transition(this, this.states["/state_2"], [this.states["/state_3"]]);
-    _state_2_1.setTrigger(null);
-    _state_2_1.setGuard(this._state_2_1_guard);
-    this.states["/state_2"].addTransition(_state_2_1);
-};
-
-Class1.prototype._state_1_enter = function() {
-    this.member1 = this.member1 + 1;
-};
-
-Class1.prototype._state_3_enter = function() {
-    this.big_step.outputEvent(new Event("received", "test_output", [this.member1]));
-};
-
-Class1.prototype._state_2_0_guard = function(parameters) {
-    return this.member1 < 3;
-};
-
-Class1.prototype._state_2_1_guard = function(parameters) {
-    return this.member1 >= 3;
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/state_1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestGuard'
-TestGuard.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestGuard'
-TestGuard.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestGuard'
-TestGuard.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestGuard'
-TestGuard.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("received", "test_output", [3])]];
-
-// add symbol 'Test' to package 'TestGuard'
-TestGuard.Test = Test;
-})();

+ 0 - 176
test/target_js/original_semantics/history.js

@@ -1,176 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistory
-Model description:
-Testing the History state.*/
-
-
-// package "TestHistory"
-var TestHistory = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /composite_1
-    this.states["/composite_1"] = new State(1, this);
-    
-    // state /composite_1/state_1
-    this.states["/composite_1/state_1"] = new State(2, this);
-    this.states["/composite_1/state_1"].setEnter(this._composite_1_state_1_enter);
-    
-    // state /composite_1/state_2
-    this.states["/composite_1/state_2"] = new State(3, this);
-    this.states["/composite_1/state_2"].setEnter(this._composite_1_state_2_enter);
-    
-    // state /composite_1/composite_history
-    this.states["/composite_1/composite_history"] = new ShallowHistoryState(4, this);
-    
-    // state /state_3
-    this.states["/state_3"] = new State(5, this);
-    this.states["/state_3"].setEnter(this._state_3_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/composite_1"]);
-    this.states[""].addChild(this.states["/state_3"]);
-    this.states["/composite_1"].addChild(this.states["/composite_1/state_1"]);
-    this.states["/composite_1"].addChild(this.states["/composite_1/state_2"]);
-    this.states["/composite_1"].addChild(this.states["/composite_1/composite_history"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/composite_1"];
-    this.states["/composite_1"].default_state = this.states["/composite_1/state_1"];
-    
-    // transition /composite_1/state_1
-    var _composite_1_state_1_0 = new Transition(this, this.states["/composite_1/state_1"], [this.states["/composite_1/state_2"]]);
-    _composite_1_state_1_0.setTrigger(new Event("to_state_2", "test_input"));
-    this.states["/composite_1/state_1"].addTransition(_composite_1_state_1_0);
-    
-    // transition /state_3
-    var _state_3_0 = new Transition(this, this.states["/state_3"], [this.states["/composite_1/composite_history"]]);
-    _state_3_0.setTrigger(null);
-    this.states["/state_3"].addTransition(_state_3_0);
-    
-    // transition /composite_1
-    var _composite_1_0 = new Transition(this, this.states["/composite_1"], [this.states["/state_3"]]);
-    _composite_1_0.setTrigger(new Event("to_state_3", "test_input"));
-    this.states["/composite_1"].addTransition(_composite_1_0);
-};
-
-Class1.prototype._composite_1_state_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_1", "test_output", new Array()));
-};
-
-Class1.prototype._composite_1_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-Class1.prototype._state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/composite_1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestHistory'
-TestHistory.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestHistory'
-TestHistory.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestHistory'
-TestHistory.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestHistory'
-TestHistory.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("to_state_2", "test_input", new Array(), 0.0), new InputEvent("to_state_3", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_state_1", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())], [new Event("in_state_3", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestHistory'
-TestHistory.Test = Test;
-})();

+ 0 - 275
test/target_js/original_semantics/history_deep.js

@@ -1,275 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistoryDeep
-Model description:
-Testing history deep.*/
-
-
-// package "TestHistoryDeep"
-var TestHistoryDeep = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal
-    this.states["/parallel/orthogonal"] = new State(2, this);
-    
-    // state /parallel/orthogonal/wrapper
-    this.states["/parallel/orthogonal/wrapper"] = new State(3, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1
-    this.states["/parallel/orthogonal/wrapper/state_1"] = new State(4, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1/inner_1
-    this.states["/parallel/orthogonal/wrapper/state_1/inner_1"] = new State(5, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1/inner_2
-    this.states["/parallel/orthogonal/wrapper/state_1/inner_2"] = new State(6, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2
-    this.states["/parallel/orthogonal/wrapper/state_2"] = new State(7, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2/inner_3
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_3"] = new State(8, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2/inner_4
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_4"] = new State(9, this);
-    
-    // state /parallel/orthogonal/wrapper/history
-    this.states["/parallel/orthogonal/wrapper/history"] = new DeepHistoryState(10, this);
-    
-    // state /parallel/orthogonal/outer
-    this.states["/parallel/orthogonal/outer"] = new State(11, this);
-    
-    // state /parallel/orthogonal_tester
-    this.states["/parallel/orthogonal_tester"] = new State(12, this);
-    
-    // state /parallel/orthogonal_tester/start
-    this.states["/parallel/orthogonal_tester/start"] = new State(13, this);
-    
-    // state /parallel/orthogonal_tester/step1
-    this.states["/parallel/orthogonal_tester/step1"] = new State(14, this);
-    
-    // state /parallel/orthogonal_tester/step2
-    this.states["/parallel/orthogonal_tester/step2"] = new State(15, this);
-    
-    // state /parallel/orthogonal_tester/step3
-    this.states["/parallel/orthogonal_tester/step3"] = new State(16, this);
-    
-    // state /parallel/orthogonal_tester/end
-    this.states["/parallel/orthogonal_tester/end"] = new State(17, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_tester"]);
-    this.states["/parallel/orthogonal"].addChild(this.states["/parallel/orthogonal/wrapper"]);
-    this.states["/parallel/orthogonal"].addChild(this.states["/parallel/orthogonal/outer"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/state_1"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/state_2"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/history"]);
-    this.states["/parallel/orthogonal/wrapper/state_1"].addChild(this.states["/parallel/orthogonal/wrapper/state_1/inner_1"]);
-    this.states["/parallel/orthogonal/wrapper/state_1"].addChild(this.states["/parallel/orthogonal/wrapper/state_1/inner_2"]);
-    this.states["/parallel/orthogonal/wrapper/state_2"].addChild(this.states["/parallel/orthogonal/wrapper/state_2/inner_3"]);
-    this.states["/parallel/orthogonal/wrapper/state_2"].addChild(this.states["/parallel/orthogonal/wrapper/state_2/inner_4"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/start"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step1"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step2"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step3"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/end"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel"];
-    this.states["/parallel/orthogonal"].default_state = this.states["/parallel/orthogonal/wrapper"];
-    this.states["/parallel/orthogonal/wrapper"].default_state = this.states["/parallel/orthogonal/wrapper/state_1"];
-    this.states["/parallel/orthogonal/wrapper/state_1"].default_state = this.states["/parallel/orthogonal/wrapper/state_1/inner_1"];
-    this.states["/parallel/orthogonal/wrapper/state_2"].default_state = this.states["/parallel/orthogonal/wrapper/state_2/inner_3"];
-    this.states["/parallel/orthogonal_tester"].default_state = this.states["/parallel/orthogonal_tester/start"];
-    
-    // transition /parallel/orthogonal/wrapper/state_2/inner_3
-    var _parallel_orthogonal_wrapper_state_2_inner_3_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper/state_2/inner_3"], [this.states["/parallel/orthogonal/wrapper/state_2/inner_4"]]);
-    _parallel_orthogonal_wrapper_state_2_inner_3_0.setTrigger(new Event("to_inner_4", null));
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_3"].addTransition(_parallel_orthogonal_wrapper_state_2_inner_3_0);
-    
-    // transition /parallel/orthogonal/outer
-    var _parallel_orthogonal_outer_0 = new Transition(this, this.states["/parallel/orthogonal/outer"], [this.states["/parallel/orthogonal/wrapper/history"]]);
-    _parallel_orthogonal_outer_0.setTrigger(new Event("to_history", null));
-    this.states["/parallel/orthogonal/outer"].addTransition(_parallel_orthogonal_outer_0);
-    
-    // transition /parallel/orthogonal_tester/start
-    var _parallel_orthogonal_tester_start_0 = new Transition(this, this.states["/parallel/orthogonal_tester/start"], [this.states["/parallel/orthogonal_tester/step1"]]);
-    _parallel_orthogonal_tester_start_0.setAction(this._parallel_orthogonal_tester_start_0_exec);
-    _parallel_orthogonal_tester_start_0.setTrigger(null);
-    this.states["/parallel/orthogonal_tester/start"].addTransition(_parallel_orthogonal_tester_start_0);
-    
-    // transition /parallel/orthogonal_tester/step1
-    var _parallel_orthogonal_tester_step1_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step1"], [this.states["/parallel/orthogonal_tester/step2"]]);
-    _parallel_orthogonal_tester_step1_0.setAction(this._parallel_orthogonal_tester_step1_0_exec);
-    _parallel_orthogonal_tester_step1_0.setTrigger(null);
-    _parallel_orthogonal_tester_step1_0.setGuard(this._parallel_orthogonal_tester_step1_0_guard);
-    this.states["/parallel/orthogonal_tester/step1"].addTransition(_parallel_orthogonal_tester_step1_0);
-    
-    // transition /parallel/orthogonal_tester/step2
-    var _parallel_orthogonal_tester_step2_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step2"], [this.states["/parallel/orthogonal_tester/step3"]]);
-    _parallel_orthogonal_tester_step2_0.setAction(this._parallel_orthogonal_tester_step2_0_exec);
-    _parallel_orthogonal_tester_step2_0.setTrigger(null);
-    _parallel_orthogonal_tester_step2_0.setGuard(this._parallel_orthogonal_tester_step2_0_guard);
-    this.states["/parallel/orthogonal_tester/step2"].addTransition(_parallel_orthogonal_tester_step2_0);
-    
-    // transition /parallel/orthogonal_tester/step3
-    var _parallel_orthogonal_tester_step3_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step3"], [this.states["/parallel/orthogonal_tester/end"]]);
-    _parallel_orthogonal_tester_step3_0.setAction(this._parallel_orthogonal_tester_step3_0_exec);
-    _parallel_orthogonal_tester_step3_0.setTrigger(null);
-    _parallel_orthogonal_tester_step3_0.setGuard(this._parallel_orthogonal_tester_step3_0_guard);
-    this.states["/parallel/orthogonal_tester/step3"].addTransition(_parallel_orthogonal_tester_step3_0);
-    
-    // transition /parallel/orthogonal/wrapper
-    var _parallel_orthogonal_wrapper_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper"], [this.states["/parallel/orthogonal/outer"]]);
-    _parallel_orthogonal_wrapper_0.setTrigger(new Event("to_outer", null));
-    this.states["/parallel/orthogonal/wrapper"].addTransition(_parallel_orthogonal_wrapper_0);
-    
-    // transition /parallel/orthogonal/wrapper/state_1
-    var _parallel_orthogonal_wrapper_state_1_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper/state_1"], [this.states["/parallel/orthogonal/wrapper/state_2"]]);
-    _parallel_orthogonal_wrapper_state_1_0.setTrigger(new Event("to_state_2", null));
-    this.states["/parallel/orthogonal/wrapper/state_1"].addTransition(_parallel_orthogonal_wrapper_state_1_0);
-};
-
-Class1.prototype._parallel_orthogonal_tester_start_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("to_state_2", null, new Array()));
-    this.raiseInternalEvent(new Event("to_inner_4", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step1_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check1", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_outer", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step1_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/wrapper/state_2/inner_4"]);
-};
-
-Class1.prototype._parallel_orthogonal_tester_step2_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check2", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_history", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step2_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/outer"]);
-};
-
-Class1.prototype._parallel_orthogonal_tester_step3_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check3", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step3_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/wrapper/state_2/inner_4"]);
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestHistoryDeep'
-TestHistoryDeep.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestHistoryDeep'
-TestHistoryDeep.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestHistoryDeep'
-TestHistoryDeep.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestHistoryDeep'
-TestHistoryDeep.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("check1", "test_output", new Array())], [new Event("check2", "test_output", new Array())], [new Event("check3", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestHistoryDeep'
-TestHistoryDeep.Test = Test;
-})();

+ 0 - 274
test/target_js/original_semantics/history_parallel_deep.js

@@ -1,274 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistoryParallelDeep
-Model description:
-Testing history deep.*/
-
-
-// package "TestHistoryParallelDeep"
-var TestHistoryParallelDeep = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal
-    this.states["/parallel/orthogonal"] = new State(2, this);
-    
-    // state /parallel/orthogonal/wrapper
-    this.states["/parallel/orthogonal/wrapper"] = new ParallelState(3, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1
-    this.states["/parallel/orthogonal/wrapper/state_1"] = new State(4, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1/inner_1
-    this.states["/parallel/orthogonal/wrapper/state_1/inner_1"] = new State(5, this);
-    
-    // state /parallel/orthogonal/wrapper/state_1/inner_2
-    this.states["/parallel/orthogonal/wrapper/state_1/inner_2"] = new State(6, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2
-    this.states["/parallel/orthogonal/wrapper/state_2"] = new State(7, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2/inner_3
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_3"] = new State(8, this);
-    
-    // state /parallel/orthogonal/wrapper/state_2/inner_4
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_4"] = new State(9, this);
-    
-    // state /parallel/orthogonal/wrapper/history
-    this.states["/parallel/orthogonal/wrapper/history"] = new DeepHistoryState(10, this);
-    
-    // state /parallel/orthogonal/outer
-    this.states["/parallel/orthogonal/outer"] = new State(11, this);
-    
-    // state /parallel/orthogonal_tester
-    this.states["/parallel/orthogonal_tester"] = new State(12, this);
-    
-    // state /parallel/orthogonal_tester/start
-    this.states["/parallel/orthogonal_tester/start"] = new State(13, this);
-    
-    // state /parallel/orthogonal_tester/step1
-    this.states["/parallel/orthogonal_tester/step1"] = new State(14, this);
-    
-    // state /parallel/orthogonal_tester/step2
-    this.states["/parallel/orthogonal_tester/step2"] = new State(15, this);
-    
-    // state /parallel/orthogonal_tester/step3
-    this.states["/parallel/orthogonal_tester/step3"] = new State(16, this);
-    
-    // state /parallel/orthogonal_tester/end
-    this.states["/parallel/orthogonal_tester/end"] = new State(17, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_tester"]);
-    this.states["/parallel/orthogonal"].addChild(this.states["/parallel/orthogonal/wrapper"]);
-    this.states["/parallel/orthogonal"].addChild(this.states["/parallel/orthogonal/outer"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/state_1"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/state_2"]);
-    this.states["/parallel/orthogonal/wrapper"].addChild(this.states["/parallel/orthogonal/wrapper/history"]);
-    this.states["/parallel/orthogonal/wrapper/state_1"].addChild(this.states["/parallel/orthogonal/wrapper/state_1/inner_1"]);
-    this.states["/parallel/orthogonal/wrapper/state_1"].addChild(this.states["/parallel/orthogonal/wrapper/state_1/inner_2"]);
-    this.states["/parallel/orthogonal/wrapper/state_2"].addChild(this.states["/parallel/orthogonal/wrapper/state_2/inner_3"]);
-    this.states["/parallel/orthogonal/wrapper/state_2"].addChild(this.states["/parallel/orthogonal/wrapper/state_2/inner_4"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/start"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step1"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step2"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/step3"]);
-    this.states["/parallel/orthogonal_tester"].addChild(this.states["/parallel/orthogonal_tester/end"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel"];
-    this.states["/parallel/orthogonal"].default_state = this.states["/parallel/orthogonal/wrapper"];
-    this.states["/parallel/orthogonal/wrapper/state_1"].default_state = this.states["/parallel/orthogonal/wrapper/state_1/inner_1"];
-    this.states["/parallel/orthogonal/wrapper/state_2"].default_state = this.states["/parallel/orthogonal/wrapper/state_2/inner_3"];
-    this.states["/parallel/orthogonal_tester"].default_state = this.states["/parallel/orthogonal_tester/start"];
-    
-    // transition /parallel/orthogonal/wrapper/state_1/inner_1
-    var _parallel_orthogonal_wrapper_state_1_inner_1_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper/state_1/inner_1"], [this.states["/parallel/orthogonal/wrapper/state_1/inner_2"]]);
-    _parallel_orthogonal_wrapper_state_1_inner_1_0.setTrigger(new Event("to_inner_2", null));
-    this.states["/parallel/orthogonal/wrapper/state_1/inner_1"].addTransition(_parallel_orthogonal_wrapper_state_1_inner_1_0);
-    
-    // transition /parallel/orthogonal/wrapper/state_2/inner_3
-    var _parallel_orthogonal_wrapper_state_2_inner_3_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper/state_2/inner_3"], [this.states["/parallel/orthogonal/wrapper/state_2/inner_4"]]);
-    _parallel_orthogonal_wrapper_state_2_inner_3_0.setTrigger(new Event("to_inner_4", null));
-    this.states["/parallel/orthogonal/wrapper/state_2/inner_3"].addTransition(_parallel_orthogonal_wrapper_state_2_inner_3_0);
-    
-    // transition /parallel/orthogonal/outer
-    var _parallel_orthogonal_outer_0 = new Transition(this, this.states["/parallel/orthogonal/outer"], [this.states["/parallel/orthogonal/wrapper/history"]]);
-    _parallel_orthogonal_outer_0.setTrigger(new Event("to_history", null));
-    this.states["/parallel/orthogonal/outer"].addTransition(_parallel_orthogonal_outer_0);
-    
-    // transition /parallel/orthogonal_tester/start
-    var _parallel_orthogonal_tester_start_0 = new Transition(this, this.states["/parallel/orthogonal_tester/start"], [this.states["/parallel/orthogonal_tester/step1"]]);
-    _parallel_orthogonal_tester_start_0.setAction(this._parallel_orthogonal_tester_start_0_exec);
-    _parallel_orthogonal_tester_start_0.setTrigger(null);
-    this.states["/parallel/orthogonal_tester/start"].addTransition(_parallel_orthogonal_tester_start_0);
-    
-    // transition /parallel/orthogonal_tester/step1
-    var _parallel_orthogonal_tester_step1_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step1"], [this.states["/parallel/orthogonal_tester/step2"]]);
-    _parallel_orthogonal_tester_step1_0.setAction(this._parallel_orthogonal_tester_step1_0_exec);
-    _parallel_orthogonal_tester_step1_0.setTrigger(null);
-    _parallel_orthogonal_tester_step1_0.setGuard(this._parallel_orthogonal_tester_step1_0_guard);
-    this.states["/parallel/orthogonal_tester/step1"].addTransition(_parallel_orthogonal_tester_step1_0);
-    
-    // transition /parallel/orthogonal_tester/step2
-    var _parallel_orthogonal_tester_step2_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step2"], [this.states["/parallel/orthogonal_tester/step3"]]);
-    _parallel_orthogonal_tester_step2_0.setAction(this._parallel_orthogonal_tester_step2_0_exec);
-    _parallel_orthogonal_tester_step2_0.setTrigger(null);
-    _parallel_orthogonal_tester_step2_0.setGuard(this._parallel_orthogonal_tester_step2_0_guard);
-    this.states["/parallel/orthogonal_tester/step2"].addTransition(_parallel_orthogonal_tester_step2_0);
-    
-    // transition /parallel/orthogonal_tester/step3
-    var _parallel_orthogonal_tester_step3_0 = new Transition(this, this.states["/parallel/orthogonal_tester/step3"], [this.states["/parallel/orthogonal_tester/end"]]);
-    _parallel_orthogonal_tester_step3_0.setAction(this._parallel_orthogonal_tester_step3_0_exec);
-    _parallel_orthogonal_tester_step3_0.setTrigger(null);
-    _parallel_orthogonal_tester_step3_0.setGuard(this._parallel_orthogonal_tester_step3_0_guard);
-    this.states["/parallel/orthogonal_tester/step3"].addTransition(_parallel_orthogonal_tester_step3_0);
-    
-    // transition /parallel/orthogonal/wrapper
-    var _parallel_orthogonal_wrapper_0 = new Transition(this, this.states["/parallel/orthogonal/wrapper"], [this.states["/parallel/orthogonal/outer"]]);
-    _parallel_orthogonal_wrapper_0.setTrigger(new Event("to_outer", null));
-    this.states["/parallel/orthogonal/wrapper"].addTransition(_parallel_orthogonal_wrapper_0);
-};
-
-Class1.prototype._parallel_orthogonal_tester_start_0_exec = function(parameters) {
-    this.raiseInternalEvent(new Event("to_inner_2", null, new Array()));
-    this.raiseInternalEvent(new Event("to_inner_4", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step1_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check1", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_outer", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step1_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/wrapper/state_2/inner_4", "/parallel/orthogonal/wrapper/state_1/inner_2"]);
-};
-
-Class1.prototype._parallel_orthogonal_tester_step2_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check2", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_history", null, new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step2_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/outer"]);
-};
-
-Class1.prototype._parallel_orthogonal_tester_step3_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check3", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_tester_step3_0_guard = function(parameters) {
-    return this.inState(["/parallel/orthogonal/wrapper/state_2/inner_4", "/parallel/orthogonal/wrapper/state_1/inner_2"]);
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestHistoryParallelDeep'
-TestHistoryParallelDeep.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestHistoryParallelDeep'
-TestHistoryParallelDeep.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestHistoryParallelDeep'
-TestHistoryParallelDeep.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestHistoryParallelDeep'
-TestHistoryParallelDeep.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("check1", "test_output", new Array())], [new Event("check2", "test_output", new Array())], [new Event("check3", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestHistoryParallelDeep'
-TestHistoryParallelDeep.Test = Test;
-})();

+ 0 - 162
test/target_js/original_semantics/inner_first.js

@@ -1,162 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestInnerFirst
-Model description:
-Testing inner first.*/
-
-
-// package "TestInnerFirst"
-var TestInnerFirst = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceChild;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /state1
-    this.states["/state1"] = new State(1, this);
-    
-    // state /state1/state1
-    this.states["/state1/state1"] = new State(2, this);
-    
-    // state /state1/statea
-    this.states["/state1/statea"] = new State(3, this);
-    this.states["/state1/statea"].setEnter(this._state1_statea_enter);
-    
-    // state /stateb
-    this.states["/stateb"] = new State(4, this);
-    this.states["/stateb"].setEnter(this._stateb_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/state1"]);
-    this.states[""].addChild(this.states["/stateb"]);
-    this.states["/state1"].addChild(this.states["/state1/state1"]);
-    this.states["/state1"].addChild(this.states["/state1/statea"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/state1"];
-    this.states["/state1"].default_state = this.states["/state1/state1"];
-    
-    // transition /state1/state1
-    var _state1_state1_0 = new Transition(this, this.states["/state1/state1"], [this.states["/state1/statea"]]);
-    _state1_state1_0.setTrigger(new Event("event", "test_input"));
-    this.states["/state1/state1"].addTransition(_state1_state1_0);
-    
-    // transition /state1
-    var _state1_0 = new Transition(this, this.states["/state1"], [this.states["/stateb"]]);
-    _state1_0.setTrigger(new Event("event", "test_input"));
-    this.states["/state1"].addTransition(_state1_0);
-};
-
-Class1.prototype._state1_statea_enter = function() {
-    this.big_step.outputEvent(new Event("in_a", "test_output", new Array()));
-};
-
-Class1.prototype._stateb_enter = function() {
-    this.big_step.outputEvent(new Event("in_b", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/state1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestInnerFirst'
-TestInnerFirst.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestInnerFirst'
-TestInnerFirst.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestInnerFirst'
-TestInnerFirst.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestInnerFirst'
-TestInnerFirst.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("event", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_a", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestInnerFirst'
-TestInnerFirst.Test = Test;
-})();

+ 0 - 216
test/target_js/original_semantics/instate.js

@@ -1,216 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestInstate
-Model description:
-Testing the INSTATE macro.*/
-
-
-// package "TestInstate"
-var TestInstate = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeOne;
-    this.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel_1
-    this.states["/parallel_1"] = new ParallelState(1, this);
-    
-    // state /parallel_1/orthogonal1
-    this.states["/parallel_1/orthogonal1"] = new State(2, this);
-    
-    // state /parallel_1/orthogonal1/state1
-    this.states["/parallel_1/orthogonal1/state1"] = new State(3, this);
-    
-    // state /parallel_1/orthogonal1/inner
-    this.states["/parallel_1/orthogonal1/inner"] = new State(4, this);
-    
-    // state /parallel_1/orthogonal1/inner/state2
-    this.states["/parallel_1/orthogonal1/inner/state2"] = new State(5, this);
-    
-    // state /parallel_1/orthogonal1/inner/state3
-    this.states["/parallel_1/orthogonal1/inner/state3"] = new State(6, this);
-    
-    // state /parallel_1/orthogonal2
-    this.states["/parallel_1/orthogonal2"] = new State(7, this);
-    
-    // state /parallel_1/orthogonal2/tester
-    this.states["/parallel_1/orthogonal2/tester"] = new State(8, this);
-    
-    // state /parallel_1/orthogonal2/stop
-    this.states["/parallel_1/orthogonal2/stop"] = new State(9, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel_1"]);
-    this.states["/parallel_1"].addChild(this.states["/parallel_1/orthogonal1"]);
-    this.states["/parallel_1"].addChild(this.states["/parallel_1/orthogonal2"]);
-    this.states["/parallel_1/orthogonal1"].addChild(this.states["/parallel_1/orthogonal1/state1"]);
-    this.states["/parallel_1/orthogonal1"].addChild(this.states["/parallel_1/orthogonal1/inner"]);
-    this.states["/parallel_1/orthogonal1/inner"].addChild(this.states["/parallel_1/orthogonal1/inner/state2"]);
-    this.states["/parallel_1/orthogonal1/inner"].addChild(this.states["/parallel_1/orthogonal1/inner/state3"]);
-    this.states["/parallel_1/orthogonal2"].addChild(this.states["/parallel_1/orthogonal2/tester"]);
-    this.states["/parallel_1/orthogonal2"].addChild(this.states["/parallel_1/orthogonal2/stop"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel_1"];
-    this.states["/parallel_1/orthogonal1"].default_state = this.states["/parallel_1/orthogonal1/state1"];
-    this.states["/parallel_1/orthogonal1/inner"].default_state = this.states["/parallel_1/orthogonal1/inner/state2"];
-    this.states["/parallel_1/orthogonal2"].default_state = this.states["/parallel_1/orthogonal2/tester"];
-    
-    // transition /parallel_1/orthogonal1/state1
-    var _parallel_1_orthogonal1_state1_0 = new Transition(this, this.states["/parallel_1/orthogonal1/state1"], [this.states["/parallel_1/orthogonal1/inner"]]);
-    _parallel_1_orthogonal1_state1_0.setTrigger(new Event("to_inner", null));
-    this.states["/parallel_1/orthogonal1/state1"].addTransition(_parallel_1_orthogonal1_state1_0);
-    
-    // transition /parallel_1/orthogonal1/inner/state2
-    var _parallel_1_orthogonal1_inner_state2_0 = new Transition(this, this.states["/parallel_1/orthogonal1/inner/state2"], [this.states["/parallel_1/orthogonal1/inner/state3"]]);
-    _parallel_1_orthogonal1_inner_state2_0.setTrigger(new Event("to_state3", null));
-    this.states["/parallel_1/orthogonal1/inner/state2"].addTransition(_parallel_1_orthogonal1_inner_state2_0);
-    
-    // transition /parallel_1/orthogonal2/tester
-    var _parallel_1_orthogonal2_tester_0 = new Transition(this, this.states["/parallel_1/orthogonal2/tester"], [this.states["/parallel_1/orthogonal2/tester"]]);
-    _parallel_1_orthogonal2_tester_0.setAction(this._parallel_1_orthogonal2_tester_0_exec);
-    _parallel_1_orthogonal2_tester_0.setTrigger(null);
-    _parallel_1_orthogonal2_tester_0.setGuard(this._parallel_1_orthogonal2_tester_0_guard);
-    this.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_0);
-    var _parallel_1_orthogonal2_tester_1 = new Transition(this, this.states["/parallel_1/orthogonal2/tester"], [this.states["/parallel_1/orthogonal2/tester"]]);
-    _parallel_1_orthogonal2_tester_1.setAction(this._parallel_1_orthogonal2_tester_1_exec);
-    _parallel_1_orthogonal2_tester_1.setTrigger(null);
-    _parallel_1_orthogonal2_tester_1.setGuard(this._parallel_1_orthogonal2_tester_1_guard);
-    this.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_1);
-    var _parallel_1_orthogonal2_tester_2 = new Transition(this, this.states["/parallel_1/orthogonal2/tester"], [this.states["/parallel_1/orthogonal2/stop"]]);
-    _parallel_1_orthogonal2_tester_2.setAction(this._parallel_1_orthogonal2_tester_2_exec);
-    _parallel_1_orthogonal2_tester_2.setTrigger(null);
-    _parallel_1_orthogonal2_tester_2.setGuard(this._parallel_1_orthogonal2_tester_2_guard);
-    this.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_2);
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check1", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_inner", null, new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_0_guard = function(parameters) {
-    return this.inState(["/parallel_1/orthogonal1/state1"]);
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_1_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check2", "test_output", new Array()));
-    this.raiseInternalEvent(new Event("to_state3", null, new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_1_guard = function(parameters) {
-    return this.inState(["/parallel_1/orthogonal1/inner/state2"]);
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_2_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("check3", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal2_tester_2_guard = function(parameters) {
-    return this.inState(["/parallel_1/orthogonal1/inner/state3"]);
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel_1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestInstate'
-TestInstate.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestInstate'
-TestInstate.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestInstate'
-TestInstate.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestInstate'
-TestInstate.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("check1", "test_output", new Array())], [new Event("check2", "test_output", new Array())], [new Event("check3", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestInstate'
-TestInstate.Test = Test;
-})();

+ 0 - 189
test/target_js/original_semantics/multiple_target.js

@@ -1,189 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestMultipleTarget
-Model description:
-Testing the enter-exit sequence when having a transition that specificies a target state with multiple nodes.*/
-
-
-// package "TestMultipleTarget"
-var TestMultipleTarget = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal_1
-    this.states["/parallel/orthogonal_1"] = new State(2, this);
-    
-    // state /parallel/orthogonal_1/inner_1
-    this.states["/parallel/orthogonal_1/inner_1"] = new State(3, this);
-    this.states["/parallel/orthogonal_1/inner_1"].setEnter(this._parallel_orthogonal_1_inner_1_enter);
-    
-    // state /parallel/orthogonal_1/inner_2
-    this.states["/parallel/orthogonal_1/inner_2"] = new State(4, this);
-    this.states["/parallel/orthogonal_1/inner_2"].setEnter(this._parallel_orthogonal_1_inner_2_enter);
-    
-    // state /parallel/orthogonal_2
-    this.states["/parallel/orthogonal_2"] = new State(5, this);
-    
-    // state /parallel/orthogonal_2/inner_1
-    this.states["/parallel/orthogonal_2/inner_1"] = new State(6, this);
-    this.states["/parallel/orthogonal_2/inner_1"].setEnter(this._parallel_orthogonal_2_inner_1_enter);
-    
-    // state /parallel/orthogonal_2/inner_2
-    this.states["/parallel/orthogonal_2/inner_2"] = new State(7, this);
-    this.states["/parallel/orthogonal_2/inner_2"].setEnter(this._parallel_orthogonal_2_inner_2_enter);
-    
-    // state /next_to_parallel
-    this.states["/next_to_parallel"] = new State(8, this);
-    this.states["/next_to_parallel"].setEnter(this._next_to_parallel_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states[""].addChild(this.states["/next_to_parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_1"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_2"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/inner_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/inner_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/inner_1"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/inner_2"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/next_to_parallel"];
-    this.states["/parallel/orthogonal_1"].default_state = this.states["/parallel/orthogonal_1/inner_1"];
-    this.states["/parallel/orthogonal_2"].default_state = this.states["/parallel/orthogonal_2/inner_1"];
-    
-    // transition /next_to_parallel
-    var _next_to_parallel_0 = new Transition(this, this.states["/next_to_parallel"], [this.states["/parallel/orthogonal_1/inner_2"], this.states["/parallel/orthogonal_2/inner_2"]]);
-    _next_to_parallel_0.setTrigger(null);
-    this.states["/next_to_parallel"].addTransition(_next_to_parallel_0);
-};
-
-Class1.prototype._parallel_orthogonal_1_inner_1_enter = function() {
-    this.big_step.outputEvent(new Event("enter_1_1", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_1_inner_2_enter = function() {
-    this.big_step.outputEvent(new Event("enter_1_2", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_2_inner_1_enter = function() {
-    this.big_step.outputEvent(new Event("enter_2_1", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_orthogonal_2_inner_2_enter = function() {
-    this.big_step.outputEvent(new Event("enter_2_2", "test_output", new Array()));
-};
-
-Class1.prototype._next_to_parallel_enter = function() {
-    this.big_step.outputEvent(new Event("enter_0", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/next_to_parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestMultipleTarget'
-TestMultipleTarget.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestMultipleTarget'
-TestMultipleTarget.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestMultipleTarget'
-TestMultipleTarget.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestMultipleTarget'
-TestMultipleTarget.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("enter_0", "test_output", new Array())], [new Event("enter_1_2", "test_output", new Array()), new Event("enter_2_2", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestMultipleTarget'
-TestMultipleTarget.Test = Test;
-})();

+ 0 - 225
test/target_js/original_semantics/object_manager.js

@@ -1,225 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestObjectManager
-Model description:
-Testing the object manager*/
-
-
-// package "TestObjectManager"
-var TestObjectManager = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /start
-    this.states["/start"] = new State(1, this);
-    
-    // state /wait
-    this.states["/wait"] = new State(2, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/start"]);
-    this.states[""].addChild(this.states["/wait"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/start"];
-    
-    // transition /start
-    var _start_0 = new Transition(this, this.states["/start"], [this.states["/wait"]]);
-    _start_0.setAction(this._start_0_exec);
-    _start_0.setTrigger(new Event("create", "test_input"));
-    this.states["/start"].addTransition(_start_0);
-    
-    // transition /wait
-    var _wait_0 = new Transition(this, this.states["/wait"], [this.states["/start"]]);
-    _wait_0.setAction(this._wait_0_exec);
-    _wait_0.setTrigger(new Event("instance_created", null));
-    this.states["/wait"].addTransition(_wait_0);
-};
-
-Class1.prototype._start_0_exec = function(parameters) {
-    this.big_step.outputEventOM(new Event("create_instance", null, [this, "test2_association"]));
-    this.big_step.outputEvent(new Event("request_send", "test_output", new Array()));
-};
-
-Class1.prototype._wait_0_exec = function(parameters) {
-    var association_name = parameters[0];
-    this.big_step.outputEvent(new Event("instance_created", "test_output", new Array()));
-    this.big_step.outputEventOM(new Event("start_instance", null, [this, "test2_association"]));
-    this.big_step.outputEventOM(new Event("narrow_cast", null, [this, "test2_association", new Event("hello", null, new Array())]));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/start"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestObjectManager'
-TestObjectManager.Class1 = Class1;
-
-var Class2 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class2.prototype.user_defined_constructor.call(this);
-};
-Class2.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class2.prototype[prop] = proto[prop];
-    }
-})();
-
-Class2.prototype.user_defined_constructor = function() {
-};
-
-Class2.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class2.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /start
-    this.states["/start"] = new State(1, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/start"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/start"];
-    
-    // transition /start
-    var _start_0 = new Transition(this, this.states["/start"], [this.states["/start"]]);
-    _start_0.setAction(this._start_0_exec);
-    _start_0.setTrigger(new Event("hello", null));
-    this.states["/start"].addTransition(_start_0);
-};
-
-Class2.prototype._start_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("second_working", "test_output", new Array()));
-};
-
-Class2.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/start"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class2' to package 'TestObjectManager'
-TestObjectManager.Class2 = Class2;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-        instance.associations["test2_association"] = new Association("Class2", 0, -1);
-    } else if (class_name === "Class2") {
-        var instance = new Class2(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestObjectManager'
-TestObjectManager.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestObjectManager'
-TestObjectManager.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestObjectManager'
-TestObjectManager.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("create", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("request_send", "test_output", new Array())], [new Event("instance_created", "test_output", new Array())], [new Event("second_working", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestObjectManager'
-TestObjectManager.Test = Test;
-})();

+ 0 - 162
test/target_js/original_semantics/outer_first.js

@@ -1,162 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestOuterFirst
-Model description:
-Testing outer first.*/
-
-
-// package "TestOuterFirst"
-var TestOuterFirst = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /state1
-    this.states["/state1"] = new State(1, this);
-    
-    // state /state1/state1
-    this.states["/state1/state1"] = new State(2, this);
-    
-    // state /state1/statea
-    this.states["/state1/statea"] = new State(3, this);
-    this.states["/state1/statea"].setEnter(this._state1_statea_enter);
-    
-    // state /stateb
-    this.states["/stateb"] = new State(4, this);
-    this.states["/stateb"].setEnter(this._stateb_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/state1"]);
-    this.states[""].addChild(this.states["/stateb"]);
-    this.states["/state1"].addChild(this.states["/state1/state1"]);
-    this.states["/state1"].addChild(this.states["/state1/statea"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/state1"];
-    this.states["/state1"].default_state = this.states["/state1/state1"];
-    
-    // transition /state1/state1
-    var _state1_state1_0 = new Transition(this, this.states["/state1/state1"], [this.states["/state1/statea"]]);
-    _state1_state1_0.setTrigger(new Event("event", "test_input"));
-    this.states["/state1/state1"].addTransition(_state1_state1_0);
-    
-    // transition /state1
-    var _state1_0 = new Transition(this, this.states["/state1"], [this.states["/stateb"]]);
-    _state1_0.setTrigger(new Event("event", "test_input"));
-    this.states["/state1"].addTransition(_state1_0);
-};
-
-Class1.prototype._state1_statea_enter = function() {
-    this.big_step.outputEvent(new Event("in_a", "test_output", new Array()));
-};
-
-Class1.prototype._stateb_enter = function() {
-    this.big_step.outputEvent(new Event("in_b", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/state1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestOuterFirst'
-TestOuterFirst.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestOuterFirst'
-TestOuterFirst.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestOuterFirst'
-TestOuterFirst.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestOuterFirst'
-TestOuterFirst.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("event", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_b", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestOuterFirst'
-TestOuterFirst.Test = Test;
-})();

+ 0 - 195
test/target_js/original_semantics/parallel.js

@@ -1,195 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:53 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallel
-Model description:
-Testing parallelism.*/
-
-
-// package "TestParallel"
-var TestParallel = {};
-(function() {
-
-var Class1 = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    Class1.prototype.user_defined_constructor.call(this);
-};
-Class1.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        Class1.prototype[prop] = proto[prop];
-    }
-})();
-
-Class1.prototype.user_defined_constructor = function() {
-};
-
-Class1.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-Class1.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel_1
-    this.states["/parallel_1"] = new ParallelState(1, this);
-    
-    // state /parallel_1/orthogonal_1
-    this.states["/parallel_1/orthogonal_1"] = new State(2, this);
-    
-    // state /parallel_1/orthogonal_1/state_1
-    this.states["/parallel_1/orthogonal_1/state_1"] = new State(3, this);
-    this.states["/parallel_1/orthogonal_1/state_1"].setEnter(this._parallel_1_orthogonal_1_state_1_enter);
-    
-    // state /parallel_1/orthogonal_1/state_2
-    this.states["/parallel_1/orthogonal_1/state_2"] = new State(4, this);
-    this.states["/parallel_1/orthogonal_1/state_2"].setEnter(this._parallel_1_orthogonal_1_state_2_enter);
-    
-    // state /parallel_1/orthogonal_2
-    this.states["/parallel_1/orthogonal_2"] = new State(5, this);
-    
-    // state /parallel_1/orthogonal_2/state_3
-    this.states["/parallel_1/orthogonal_2/state_3"] = new State(6, this);
-    this.states["/parallel_1/orthogonal_2/state_3"].setEnter(this._parallel_1_orthogonal_2_state_3_enter);
-    
-    // state /parallel_1/orthogonal_2/state_4
-    this.states["/parallel_1/orthogonal_2/state_4"] = new State(7, this);
-    this.states["/parallel_1/orthogonal_2/state_4"].setEnter(this._parallel_1_orthogonal_2_state_4_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel_1"]);
-    this.states["/parallel_1"].addChild(this.states["/parallel_1/orthogonal_1"]);
-    this.states["/parallel_1"].addChild(this.states["/parallel_1/orthogonal_2"]);
-    this.states["/parallel_1/orthogonal_1"].addChild(this.states["/parallel_1/orthogonal_1/state_1"]);
-    this.states["/parallel_1/orthogonal_1"].addChild(this.states["/parallel_1/orthogonal_1/state_2"]);
-    this.states["/parallel_1/orthogonal_2"].addChild(this.states["/parallel_1/orthogonal_2/state_3"]);
-    this.states["/parallel_1/orthogonal_2"].addChild(this.states["/parallel_1/orthogonal_2/state_4"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel_1"];
-    this.states["/parallel_1/orthogonal_1"].default_state = this.states["/parallel_1/orthogonal_1/state_1"];
-    this.states["/parallel_1/orthogonal_2"].default_state = this.states["/parallel_1/orthogonal_2/state_3"];
-    
-    // transition /parallel_1/orthogonal_1/state_1
-    var _parallel_1_orthogonal_1_state_1_0 = new Transition(this, this.states["/parallel_1/orthogonal_1/state_1"], [this.states["/parallel_1/orthogonal_1/state_2"]]);
-    _parallel_1_orthogonal_1_state_1_0.setTrigger(new Event("to_state_2", "test_input"));
-    this.states["/parallel_1/orthogonal_1/state_1"].addTransition(_parallel_1_orthogonal_1_state_1_0);
-    
-    // transition /parallel_1/orthogonal_1/state_2
-    var _parallel_1_orthogonal_1_state_2_0 = new Transition(this, this.states["/parallel_1/orthogonal_1/state_2"], [this.states["/parallel_1/orthogonal_1/state_1"]]);
-    _parallel_1_orthogonal_1_state_2_0.setTrigger(new Event("to_state_1", "test_input"));
-    this.states["/parallel_1/orthogonal_1/state_2"].addTransition(_parallel_1_orthogonal_1_state_2_0);
-    
-    // transition /parallel_1/orthogonal_2/state_3
-    var _parallel_1_orthogonal_2_state_3_0 = new Transition(this, this.states["/parallel_1/orthogonal_2/state_3"], [this.states["/parallel_1/orthogonal_2/state_4"]]);
-    _parallel_1_orthogonal_2_state_3_0.setTrigger(new Event("to_state_4", "test_input"));
-    this.states["/parallel_1/orthogonal_2/state_3"].addTransition(_parallel_1_orthogonal_2_state_3_0);
-    
-    // transition /parallel_1/orthogonal_2/state_4
-    var _parallel_1_orthogonal_2_state_4_0 = new Transition(this, this.states["/parallel_1/orthogonal_2/state_4"], [this.states["/parallel_1/orthogonal_2/state_3"]]);
-    _parallel_1_orthogonal_2_state_4_0.setTrigger(new Event("to_state_3", "test_input"));
-    this.states["/parallel_1/orthogonal_2/state_4"].addTransition(_parallel_1_orthogonal_2_state_4_0);
-};
-
-Class1.prototype._parallel_1_orthogonal_1_state_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_1", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal_1_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal_2_state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-Class1.prototype._parallel_1_orthogonal_2_state_4_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_4", "test_output", new Array()));
-};
-
-Class1.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel_1"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'Class1' to package 'TestParallel'
-TestParallel.Class1 = Class1;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "Class1") {
-        var instance = new Class1(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestParallel'
-TestParallel.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("Class1", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestParallel'
-TestParallel.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestParallel'
-TestParallel.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("to_state_2", "test_input", new Array(), 0.0), new InputEvent("to_state_4", "test_input", new Array(), 0.0), new InputEvent("to_state_1", "test_input", new Array(), 0.0), new InputEvent("to_state_2", "test_input", new Array(), 0.0), new InputEvent("to_state_3", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_state_1", "test_output", new Array()), new Event("in_state_3", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())], [new Event("in_state_4", "test_output", new Array())], [new Event("in_state_1", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())], [new Event("in_state_3", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestParallel'
-TestParallel.Test = Test;
-})();

+ 0 - 241
test/target_js/original_semantics/parallel_history.js

@@ -1,241 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallelHistory
-Model description:
-Testing history in parallel.*/
-
-
-// package "TestParallelHistory"
-var TestParallelHistory = {};
-(function() {
-
-var TestClass = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    TestClass.prototype.user_defined_constructor.call(this);
-};
-TestClass.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        TestClass.prototype[prop] = proto[prop];
-    }
-})();
-
-TestClass.prototype.user_defined_constructor = function() {
-};
-
-TestClass.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-TestClass.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal_1
-    this.states["/parallel/orthogonal_1"] = new State(2, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"] = new State(3, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"] = new State(4, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_2
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"] = new State(5, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/history_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"] = new ShallowHistoryState(6, this);
-    
-    // state /parallel/orthogonal_1/outer_1
-    this.states["/parallel/orthogonal_1/outer_1"] = new State(7, this);
-    this.states["/parallel/orthogonal_1/outer_1"].setEnter(this._parallel_orthogonal_1_outer_1_enter);
-    
-    // state /parallel/orthogonal_2
-    this.states["/parallel/orthogonal_2"] = new State(8, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"] = new State(9, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"] = new State(10, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_4
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"] = new State(11, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/history_2
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"] = new ShallowHistoryState(12, this);
-    
-    // state /parallel/orthogonal_2/outer_2
-    this.states["/parallel/orthogonal_2/outer_2"] = new State(13, this);
-    this.states["/parallel/orthogonal_2/outer_2"].setEnter(this._parallel_orthogonal_2_outer_2_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_1"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_2"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/outer_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/outer_2"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel"];
-    this.states["/parallel/orthogonal_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1"];
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"];
-    this.states["/parallel/orthogonal_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2"];
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"];
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_state_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"], [this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_state_1_0.setTrigger(new Event("to_state_2", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_state_1_0);
-    
-    // transition /parallel/orthogonal_1/outer_1
-    var _parallel_orthogonal_1_outer_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/outer_1"], [this.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"]]);
-    _parallel_orthogonal_1_outer_1_0.setTrigger(new Event("to_history_1", "test_input"));
-    this.states["/parallel/orthogonal_1/outer_1"].addTransition(_parallel_orthogonal_1_outer_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    var _parallel_orthogonal_2_orthogonal_inner_2_state_3_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"], [this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_state_3_0.setTrigger(new Event("to_state_4", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_state_3_0);
-    
-    // transition /parallel/orthogonal_2/outer_2
-    var _parallel_orthogonal_2_outer_2_0 = new Transition(this, this.states["/parallel/orthogonal_2/outer_2"], [this.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"]]);
-    _parallel_orthogonal_2_outer_2_0.setTrigger(new Event("to_history_2", "test_input"));
-    this.states["/parallel/orthogonal_2/outer_2"].addTransition(_parallel_orthogonal_2_outer_2_0);
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1"], [this.states["/parallel/orthogonal_1/outer_1"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_0.setTrigger(new Event("to_outer_1", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2
-    var _parallel_orthogonal_2_orthogonal_inner_2_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2"], [this.states["/parallel/orthogonal_2/outer_2"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_0.setTrigger(new Event("to_outer_2", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_0);
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_outer_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_4", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_outer_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_2", "test_output", new Array()));
-};
-
-TestClass.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'TestClass' to package 'TestParallelHistory'
-TestParallelHistory.TestClass = TestClass;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "TestClass") {
-        var instance = new TestClass(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestParallelHistory'
-TestParallelHistory.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("TestClass", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestParallelHistory'
-TestParallelHistory.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestParallelHistory'
-TestParallelHistory.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("to_state_2", "test_input", new Array(), 0.0), new InputEvent("to_state_4", "test_input", new Array(), 0.0), new InputEvent("to_outer_1", "test_input", new Array(), 0.0), new InputEvent("to_outer_2", "test_input", new Array(), 0.0), new InputEvent("to_history_1", "test_input", new Array(), 0.0), new InputEvent("to_history_2", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_state_1", "test_output", new Array()), new Event("in_state_3", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())], [new Event("in_state_4", "test_output", new Array())], [new Event("in_outer_1", "test_output", new Array())], [new Event("in_outer_2", "test_output", new Array())], [new Event("in_state_2", "test_output", new Array())], [new Event("in_state_4", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestParallelHistory'
-TestParallelHistory.Test = Test;
-})();

+ 0 - 246
test/target_js/original_semantics/parallel_history_2.js

@@ -1,246 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallelHistory2
-Model description:
-Testing history where the history state is directly inside a parallel element (deep).*/
-
-
-// package "TestParallelHistory2"
-var TestParallelHistory2 = {};
-(function() {
-
-var TestClass = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    TestClass.prototype.user_defined_constructor.call(this);
-};
-TestClass.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        TestClass.prototype[prop] = proto[prop];
-    }
-})();
-
-TestClass.prototype.user_defined_constructor = function() {
-};
-
-TestClass.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-TestClass.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal_1
-    this.states["/parallel/orthogonal_1"] = new State(2, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"] = new State(3, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"] = new State(4, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_2
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"] = new State(5, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter);
-    
-    // state /parallel/orthogonal_1/outer_1
-    this.states["/parallel/orthogonal_1/outer_1"] = new State(6, this);
-    this.states["/parallel/orthogonal_1/outer_1"].setEnter(this._parallel_orthogonal_1_outer_1_enter);
-    
-    // state /parallel/orthogonal_2
-    this.states["/parallel/orthogonal_2"] = new State(7, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"] = new State(8, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"] = new State(9, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_4
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"] = new State(10, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter);
-    
-    // state /parallel/orthogonal_2/outer_2
-    this.states["/parallel/orthogonal_2/outer_2"] = new State(11, this);
-    this.states["/parallel/orthogonal_2/outer_2"].setEnter(this._parallel_orthogonal_2_outer_2_enter);
-    
-    // state /parallel/history_1
-    this.states["/parallel/history_1"] = new DeepHistoryState(12, this);
-    
-    // state /next_to_parallel
-    this.states["/next_to_parallel"] = new State(13, this);
-    this.states["/next_to_parallel"].setEnter(this._next_to_parallel_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states[""].addChild(this.states["/next_to_parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_1"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_2"]);
-    this.states["/parallel"].addChild(this.states["/parallel/history_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/outer_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/outer_2"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel"];
-    this.states["/parallel/orthogonal_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1"];
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"];
-    this.states["/parallel/orthogonal_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2"];
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"];
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_state_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"], [this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_state_1_0.setTrigger(new Event("to_state_2", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_state_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    var _parallel_orthogonal_2_orthogonal_inner_2_state_3_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"], [this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_state_3_0.setTrigger(new Event("to_state_4", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_state_3_0);
-    
-    // transition /next_to_parallel
-    var _next_to_parallel_0 = new Transition(this, this.states["/next_to_parallel"], [this.states["/parallel/history_1"]]);
-    _next_to_parallel_0.setTrigger(new Event("to_history_1", "test_input"));
-    this.states["/next_to_parallel"].addTransition(_next_to_parallel_0);
-    
-    // transition /parallel
-    var _parallel_0 = new Transition(this, this.states["/parallel"], [this.states["/next_to_parallel"]]);
-    _parallel_0.setTrigger(new Event("exit", "test_input"));
-    this.states["/parallel"].addTransition(_parallel_0);
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1"], [this.states["/parallel/orthogonal_1/outer_1"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_0.setTrigger(new Event("to_outer_1", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2
-    var _parallel_orthogonal_2_orthogonal_inner_2_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2"], [this.states["/parallel/orthogonal_2/outer_2"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_0.setTrigger(new Event("to_outer_2", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_0);
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_outer_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_4", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_outer_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_2", "test_output", new Array()));
-};
-
-TestClass.prototype._next_to_parallel_enter = function() {
-    this.big_step.outputEvent(new Event("outside", "test_output", new Array()));
-};
-
-TestClass.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'TestClass' to package 'TestParallelHistory2'
-TestParallelHistory2.TestClass = TestClass;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "TestClass") {
-        var instance = new TestClass(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestParallelHistory2'
-TestParallelHistory2.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("TestClass", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestParallelHistory2'
-TestParallelHistory2.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestParallelHistory2'
-TestParallelHistory2.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("to_outer_1", "test_input", new Array(), 0.0), new InputEvent("to_outer_2", "test_input", new Array(), 0.0), new InputEvent("exit", "test_input", new Array(), 0.0), new InputEvent("to_history_1", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_state_1", "test_output", new Array()), new Event("in_state_3", "test_output", new Array())], [new Event("in_outer_1", "test_output", new Array())], [new Event("in_outer_2", "test_output", new Array())], [new Event("outside", "test_output", new Array())], [new Event("in_outer_1", "test_output", new Array()), new Event("in_outer_2", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestParallelHistory2'
-TestParallelHistory2.Test = Test;
-})();

+ 0 - 246
test/target_js/original_semantics/parallel_history_3.js

@@ -1,246 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallelHistory2
-Model description:
-Testing history where the history state is directly inside a parallel element (shallow).*/
-
-
-// package "TestParallelHistory2"
-var TestParallelHistory2 = {};
-(function() {
-
-var TestClass = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    TestClass.prototype.user_defined_constructor.call(this);
-};
-TestClass.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        TestClass.prototype[prop] = proto[prop];
-    }
-})();
-
-TestClass.prototype.user_defined_constructor = function() {
-};
-
-TestClass.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-TestClass.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parallel
-    this.states["/parallel"] = new ParallelState(1, this);
-    
-    // state /parallel/orthogonal_1
-    this.states["/parallel/orthogonal_1"] = new State(2, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"] = new State(3, this);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"] = new State(4, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter);
-    
-    // state /parallel/orthogonal_1/orthogonal_inner_1/state_2
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"] = new State(5, this);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"].setEnter(this._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter);
-    
-    // state /parallel/orthogonal_1/outer_1
-    this.states["/parallel/orthogonal_1/outer_1"] = new State(6, this);
-    this.states["/parallel/orthogonal_1/outer_1"].setEnter(this._parallel_orthogonal_1_outer_1_enter);
-    
-    // state /parallel/orthogonal_2
-    this.states["/parallel/orthogonal_2"] = new State(7, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"] = new State(8, this);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"] = new State(9, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter);
-    
-    // state /parallel/orthogonal_2/orthogonal_inner_2/state_4
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"] = new State(10, this);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"].setEnter(this._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter);
-    
-    // state /parallel/orthogonal_2/outer_2
-    this.states["/parallel/orthogonal_2/outer_2"] = new State(11, this);
-    this.states["/parallel/orthogonal_2/outer_2"].setEnter(this._parallel_orthogonal_2_outer_2_enter);
-    
-    // state /parallel/history_1
-    this.states["/parallel/history_1"] = new ShallowHistoryState(12, this);
-    
-    // state /next_to_parallel
-    this.states["/next_to_parallel"] = new State(13, this);
-    this.states["/next_to_parallel"].setEnter(this._next_to_parallel_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parallel"]);
-    this.states[""].addChild(this.states["/next_to_parallel"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_1"]);
-    this.states["/parallel"].addChild(this.states["/parallel/orthogonal_2"]);
-    this.states["/parallel"].addChild(this.states["/parallel/history_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1"]);
-    this.states["/parallel/orthogonal_1"].addChild(this.states["/parallel/orthogonal_1/outer_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"]);
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2"]);
-    this.states["/parallel/orthogonal_2"].addChild(this.states["/parallel/orthogonal_2/outer_2"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"]);
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parallel"];
-    this.states["/parallel/orthogonal_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1"];
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].default_state = this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"];
-    this.states["/parallel/orthogonal_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2"];
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].default_state = this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"];
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1/state_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_state_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"], [this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_state_1_0.setTrigger(new Event("to_state_2", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_state_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2/state_3
-    var _parallel_orthogonal_2_orthogonal_inner_2_state_3_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"], [this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_state_3_0.setTrigger(new Event("to_state_4", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_state_3_0);
-    
-    // transition /next_to_parallel
-    var _next_to_parallel_0 = new Transition(this, this.states["/next_to_parallel"], [this.states["/parallel/history_1"]]);
-    _next_to_parallel_0.setTrigger(new Event("to_history_1", "test_input"));
-    this.states["/next_to_parallel"].addTransition(_next_to_parallel_0);
-    
-    // transition /parallel
-    var _parallel_0 = new Transition(this, this.states["/parallel"], [this.states["/next_to_parallel"]]);
-    _parallel_0.setTrigger(new Event("exit", "test_input"));
-    this.states["/parallel"].addTransition(_parallel_0);
-    
-    // transition /parallel/orthogonal_1/orthogonal_inner_1
-    var _parallel_orthogonal_1_orthogonal_inner_1_0 = new Transition(this, this.states["/parallel/orthogonal_1/orthogonal_inner_1"], [this.states["/parallel/orthogonal_1/outer_1"]]);
-    _parallel_orthogonal_1_orthogonal_inner_1_0.setTrigger(new Event("to_outer_1", "test_input"));
-    this.states["/parallel/orthogonal_1/orthogonal_inner_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_0);
-    
-    // transition /parallel/orthogonal_2/orthogonal_inner_2
-    var _parallel_orthogonal_2_orthogonal_inner_2_0 = new Transition(this, this.states["/parallel/orthogonal_2/orthogonal_inner_2"], [this.states["/parallel/orthogonal_2/outer_2"]]);
-    _parallel_orthogonal_2_orthogonal_inner_2_0.setTrigger(new Event("to_outer_2", "test_input"));
-    this.states["/parallel/orthogonal_2/orthogonal_inner_2"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_0);
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_2", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_1_outer_1_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_1", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_3", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter = function() {
-    this.big_step.outputEvent(new Event("in_state_4", "test_output", new Array()));
-};
-
-TestClass.prototype._parallel_orthogonal_2_outer_2_enter = function() {
-    this.big_step.outputEvent(new Event("in_outer_2", "test_output", new Array()));
-};
-
-TestClass.prototype._next_to_parallel_enter = function() {
-    this.big_step.outputEvent(new Event("outside", "test_output", new Array()));
-};
-
-TestClass.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parallel"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'TestClass' to package 'TestParallelHistory2'
-TestParallelHistory2.TestClass = TestClass;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "TestClass") {
-        var instance = new TestClass(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'TestParallelHistory2'
-TestParallelHistory2.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("test_input");
-    this.addOutputPort("test_output");
-    this.object_manager.createInstance("TestClass", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'TestParallelHistory2'
-TestParallelHistory2.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'TestParallelHistory2'
-TestParallelHistory2.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("to_outer_1", "test_input", new Array(), 0.0), new InputEvent("to_outer_2", "test_input", new Array(), 0.0), new InputEvent("exit", "test_input", new Array(), 0.0), new InputEvent("to_history_1", "test_input", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("in_state_1", "test_output", new Array()), new Event("in_state_3", "test_output", new Array())], [new Event("in_outer_1", "test_output", new Array())], [new Event("in_outer_2", "test_output", new Array())], [new Event("outside", "test_output", new Array())], [new Event("in_state_1", "test_output", new Array()), new Event("in_state_3", "test_output", new Array())]];
-
-// add symbol 'Test' to package 'TestParallelHistory2'
-TestParallelHistory2.Test = Test;
-})();

+ 0 - 172
test/target_js/priority/00_source_parent.js

@@ -1,172 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   source_parent
-Model description:
-'Source Parent' priority-semantics: If 2 transitions are enabled, and the source state of the first is an ancestor of the second, only the first is executed.*/
-
-
-// package "source_parent"
-var source_parent = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parent
-    this.states["/parent"] = new State(1, this);
-    this.states["/parent"].setEnter(this._parent_enter);
-    
-    // state /parent/a
-    this.states["/parent/a"] = new State(2, this);
-    this.states["/parent/a"].setEnter(this._parent_a_enter);
-    
-    // state /parent/b
-    this.states["/parent/b"] = new State(3, this);
-    this.states["/parent/b"].setEnter(this._parent_b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(4, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parent"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states["/parent"].addChild(this.states["/parent/a"]);
-    this.states["/parent"].addChild(this.states["/parent/b"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parent"];
-    this.states["/parent"].default_state = this.states["/parent/a"];
-    
-    // transition /parent/a
-    var _parent_a_0 = new Transition(this, this.states["/parent/a"], [this.states["/parent/b"]]);
-    _parent_a_0.setTrigger(null);
-    this.states["/parent/a"].addTransition(_parent_a_0);
-    
-    // transition /parent
-    var _parent_0 = new Transition(this, this.states["/parent"], [this.states["/c"]]);
-    _parent_0.setTrigger(null);
-    this.states["/parent"].addTransition(_parent_0);
-};
-
-c.prototype._parent_enter = function() {
-    this.big_step.outputEvent(new Event("entered_parent", "out", new Array()));
-};
-
-c.prototype._parent_a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._parent_b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parent"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'source_parent'
-source_parent.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'source_parent'
-source_parent.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'source_parent'
-source_parent.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'source_parent'
-source_parent.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_parent", "out", new Array()), new Event("entered_a", "out", new Array())], [new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'source_parent'
-source_parent.Test = Test;
-})();

+ 0 - 172
test/target_js/priority/01_source_child.js

@@ -1,172 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   source_child
-Model description:
-'Source Child' priority-semantics: If 2 transitions are enabled, and the source state of the first is an ancestor of the second, only the second is executed.*/
-
-
-// package "source_child"
-var source_child = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceChild;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /parent
-    this.states["/parent"] = new State(1, this);
-    this.states["/parent"].setEnter(this._parent_enter);
-    
-    // state /parent/a
-    this.states["/parent/a"] = new State(2, this);
-    this.states["/parent/a"].setEnter(this._parent_a_enter);
-    
-    // state /parent/b
-    this.states["/parent/b"] = new State(3, this);
-    this.states["/parent/b"].setEnter(this._parent_b_enter);
-    
-    // state /c
-    this.states["/c"] = new State(4, this);
-    this.states["/c"].setEnter(this._c_enter);
-    
-    // add children
-    this.states[""].addChild(this.states["/parent"]);
-    this.states[""].addChild(this.states["/c"]);
-    this.states["/parent"].addChild(this.states["/parent/a"]);
-    this.states["/parent"].addChild(this.states["/parent/b"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/parent"];
-    this.states["/parent"].default_state = this.states["/parent/a"];
-    
-    // transition /parent/a
-    var _parent_a_0 = new Transition(this, this.states["/parent/a"], [this.states["/parent/b"]]);
-    _parent_a_0.setTrigger(null);
-    this.states["/parent/a"].addTransition(_parent_a_0);
-    
-    // transition /parent
-    var _parent_0 = new Transition(this, this.states["/parent"], [this.states["/c"]]);
-    _parent_0.setTrigger(null);
-    this.states["/parent"].addTransition(_parent_0);
-};
-
-c.prototype._parent_enter = function() {
-    this.big_step.outputEvent(new Event("entered_parent", "out", new Array()));
-};
-
-c.prototype._parent_a_enter = function() {
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._parent_b_enter = function() {
-    this.big_step.outputEvent(new Event("entered_b", "out", new Array()));
-};
-
-c.prototype._c_enter = function() {
-    this.big_step.outputEvent(new Event("entered_c", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/parent"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'source_child'
-source_child.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'source_child'
-source_child.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'source_child'
-source_child.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'source_child'
-source_child.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_parent", "out", new Array()), new Event("entered_a", "out", new Array())], [new Event("entered_b", "out", new Array()), new Event("entered_c", "out", new Array())]];
-
-// add symbol 'Test' to package 'source_child'
-source_child.Test = Test;
-})();

+ 0 - 161
test/target_js/priority/10_source_parent_history.js

@@ -1,161 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   source_parent_history
-*/
-
-
-// package "source_parent_history"
-var source_parent_history = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /main
-    this.states["/main"] = new State(1, this);
-    
-    // state /main/history
-    this.states["/main/history"] = new ShallowHistoryState(2, this);
-    
-    // state /main/A
-    this.states["/main/A"] = new State(3, this);
-    
-    // state /main/B
-    this.states["/main/B"] = new State(4, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/main"]);
-    this.states["/main"].addChild(this.states["/main/history"]);
-    this.states["/main"].addChild(this.states["/main/A"]);
-    this.states["/main"].addChild(this.states["/main/B"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/main"];
-    this.states["/main"].default_state = this.states["/main/A"];
-    
-    // transition /main/A
-    var _main_A_0 = new Transition(this, this.states["/main/A"], [this.states["/main/B"]]);
-    _main_A_0.setAction(this._main_A_0_exec);
-    _main_A_0.setTrigger(new Event("e", "in"));
-    this.states["/main/A"].addTransition(_main_A_0);
-    
-    // transition /main
-    var _main_0 = new Transition(this, this.states["/main"], [this.states["/main/history"]]);
-    _main_0.setAction(this._main_0_exec);
-    _main_0.setTrigger(new Event("e", "in"));
-    this.states["/main"].addTransition(_main_0);
-};
-
-c.prototype._main_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("to_history", "out", new Array()));
-};
-
-c.prototype._main_A_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("to_B", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/main"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'source_parent_history'
-source_parent_history.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'source_parent_history'
-source_parent_history.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'source_parent_history'
-source_parent_history.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'source_parent_history'
-source_parent_history.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("to_history", "out", new Array())]];
-
-// add symbol 'Test' to package 'source_parent_history'
-source_parent_history.Test = Test;
-})();

+ 0 - 161
test/target_js/priority/11_source_child_history.js

@@ -1,161 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   source_child_history
-*/
-
-
-// package "source_child_history"
-var source_child_history = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceChild;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /main
-    this.states["/main"] = new State(1, this);
-    
-    // state /main/history
-    this.states["/main/history"] = new ShallowHistoryState(2, this);
-    
-    // state /main/A
-    this.states["/main/A"] = new State(3, this);
-    
-    // state /main/B
-    this.states["/main/B"] = new State(4, this);
-    
-    // add children
-    this.states[""].addChild(this.states["/main"]);
-    this.states["/main"].addChild(this.states["/main/history"]);
-    this.states["/main"].addChild(this.states["/main/A"]);
-    this.states["/main"].addChild(this.states["/main/B"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/main"];
-    this.states["/main"].default_state = this.states["/main/A"];
-    
-    // transition /main/A
-    var _main_A_0 = new Transition(this, this.states["/main/A"], [this.states["/main/B"]]);
-    _main_A_0.setAction(this._main_A_0_exec);
-    _main_A_0.setTrigger(new Event("e", "in"));
-    this.states["/main/A"].addTransition(_main_A_0);
-    
-    // transition /main
-    var _main_0 = new Transition(this, this.states["/main"], [this.states["/main/history"]]);
-    _main_0.setAction(this._main_0_exec);
-    _main_0.setTrigger(new Event("e", "in"));
-    this.states["/main"].addTransition(_main_0);
-};
-
-c.prototype._main_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("to_history", "out", new Array()));
-};
-
-c.prototype._main_A_0_exec = function(parameters) {
-    this.big_step.outputEvent(new Event("to_B", "out", new Array()));
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/main"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'source_child_history'
-source_child_history.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'source_child_history'
-source_child_history.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'source_child_history'
-source_child_history.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'source_child_history'
-source_child_history.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = [new InputEvent("e", "in", new Array(), 0.0)];
-Test.prototype.expected_events = [[new Event("to_B", "out", new Array())]];
-
-// add symbol 'Test' to package 'source_child_history'
-source_child_history.Test = Test;
-})();

+ 0 - 159
test/target_js/timing/00_rapid_js.js

@@ -1,159 +0,0 @@
-/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:54 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   rapid
-Model description:
-After event with a very small timeout.*/
-
-
-// package "rapid"
-var rapid = {};
-(function() {
-
-var c = function(controller) {
-    RuntimeClassBase.call(this, controller);
-    
-    this.semantics.big_step_maximality = StatechartSemantics.TakeMany;
-    this.semantics.internal_event_lifeline = StatechartSemantics.Queue;
-    this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep;
-    this.semantics.priority = StatechartSemantics.SourceParent;
-    this.semantics.concurrency = StatechartSemantics.Single;
-    
-    // build Statechart structure
-    this.build_statechart_structure();
-    
-    // user defined attributes
-    this.i = null;
-    
-    // call user defined constructor
-    c.prototype.user_defined_constructor.call(this);
-};
-c.prototype = new Object();
-(function() {
-    var proto = new RuntimeClassBase();
-    for (prop in proto) {
-        c.prototype[prop] = proto[prop];
-    }
-})();
-
-c.prototype.user_defined_constructor = function() {
-    this.i = 0;
-};
-
-c.prototype.user_defined_destructor = function() {
-};
-
-
-// builds Statechart structure
-c.prototype.build_statechart_structure = function() {
-    
-    // state <root>
-    this.states[""] = new State(0, this);
-    
-    // state /a
-    this.states["/a"] = new State(1, this);
-    this.states["/a"].setEnter(this._a_enter);
-    this.states["/a"].setExit(this._a_exit);
-    
-    // add children
-    this.states[""].addChild(this.states["/a"]);
-    this.states[""].fixTree();
-    this.states[""].default_state = this.states["/a"];
-    
-    // transition /a
-    var _a_0 = new Transition(this, this.states["/a"], [this.states["/a"]]);
-    _a_0.setAction(this._a_0_exec);
-    _a_0.setTrigger(new Event("_0after"));
-    _a_0.setGuard(this._a_0_guard);
-    this.states["/a"].addTransition(_a_0);
-};
-
-c.prototype._a_enter = function() {
-    this.addTimer(0, 1e-10);
-    this.big_step.outputEvent(new Event("entered_a", "out", new Array()));
-};
-
-c.prototype._a_exit = function() {
-    this.removeTimer(0);
-};
-
-c.prototype._a_0_exec = function(parameters) {
-    this.i++;
-};
-
-c.prototype._a_0_guard = function(parameters) {
-    return this.i < 2;
-};
-
-c.prototype.initializeStatechart = function() {
-    // enter default state
-    this.default_targets = this.states["/a"].getEffectiveTargetStates();
-    RuntimeClassBase.prototype.initializeStatechart.call(this);
-};
-
-// add symbol 'c' to package 'rapid'
-rapid.c = c;
-
-var ObjectManager = function(controller) {
-    ObjectManagerBase.call(this, controller);
-};
-ObjectManager.prototype = new Object();
-(function() {
-    var proto = new ObjectManagerBase();
-    for (prop in proto) {
-        ObjectManager.prototype[prop] = proto[prop];
-    }
-})();
-
-ObjectManager.prototype.instantiate = function(class_name, construct_params) {
-    if (class_name === "c") {
-        var instance = new c(this.controller);
-        instance.associations = new Object();
-    } else  {
-        throw new Error("Cannot instantiate class " + class_name);
-    }
-    return instance;
-};
-
-// add symbol 'ObjectManager' to package 'rapid'
-rapid.ObjectManager = ObjectManager;
-
-var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) {
-    if (finished_callback === undefined) finished_callback = null;
-    if (behind_schedule_callback === undefined) behind_schedule_callback = null;
-    EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback);
-    this.addInputPort("in");
-    this.addOutputPort("out");
-    this.object_manager.createInstance("c", new Array());
-};
-Controller.prototype = new Object();
-(function() {
-    var proto = new EventLoopControllerBase();
-    for (prop in proto) {
-        Controller.prototype[prop] = proto[prop];
-    }
-})();
-
-// add symbol 'Controller' to package 'rapid'
-rapid.Controller = Controller;
-
-var InputEvent = function(name, port, parameters, time_offset) {
-    this.name = name;
-    this.port = port;
-    this.parameters = parameters;
-    this.time_offset = time_offset;
-};
-
-// add symbol 'InputEvent' to package 'rapid'
-rapid.InputEvent = InputEvent;
-
-var Test = function() {
-};
-Test.prototype.input_events = new Array();
-Test.prototype.expected_events = [[new Event("entered_a", "out", new Array())], [new Event("entered_a", "out", new Array())], [new Event("entered_a", "out", new Array())]];
-
-// add symbol 'Test' to package 'rapid'
-rapid.Test = Test;
-})();

+ 0 - 0
test/target_py/__init__.py


+ 0 - 120
test/target_py/big_step_maximality/00_take_one.py

@@ -1,120 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_one
-Model description:
-Take One-semantics: Each big step, only one transition can be made (per orthogonal component).
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_one"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeOne
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setTrigger(None)
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(None)
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", [])], [Event("entered_c", "out", [])]]

+ 0 - 120
test/target_py/big_step_maximality/01_take_many.py

@@ -1,120 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many
-Model description:
-Take Many-semantics: A big step doesn't end until there are no more enabled transitions.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_many"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setTrigger(None)
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(None)
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", []), Event("entered_c", "out", [])]]

+ 0 - 168
test/target_py/big_step_maximality/10_orthogonal_take_one.py

@@ -1,168 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_one
-Model description:
-Take One-semantics: Each big step, a transition in each orthogonal component is made.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_one"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeOne
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o0/sc
-        self.states["/p/o0/sc"] = State(5, self)
-        self.states["/p/o0/sc"].setEnter(self._p_o0_sc_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(6, self)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # state /p/o1/sf
-        self.states["/p/o1/sf"] = State(9, self)
-        self.states["/p/o1/sf"].setEnter(self._p_o1_sf_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sf"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sd"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setTrigger(None)
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sc"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(None)
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-        
-        # transition /p/o1/se
-        _p_o1_se_0 = Transition(self, self.states["/p/o1/se"], [self.states["/p/o1/sf"]])
-        _p_o1_se_0.setTrigger(None)
-        self.states["/p/o1/se"].addTransition(_p_o1_se_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o0_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o1_sf_enter(self):
-        self.big_step.outputEvent(Event("entered_sf", "out", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sd", "out", [])], [Event("entered_sb", "out", []), Event("entered_se", "out", [])], [Event("entered_sc", "out", []), Event("entered_sf", "out", [])]]

+ 0 - 168
test/target_py/big_step_maximality/11_orthogonal_take_many.py

@@ -1,168 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many
-Model description:
-Take Many-semantics: In both components, transitions keep firing until there are no more enabled transitions.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_many"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o0/sc
-        self.states["/p/o0/sc"] = State(5, self)
-        self.states["/p/o0/sc"].setEnter(self._p_o0_sc_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(6, self)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # state /p/o1/sf
-        self.states["/p/o1/sf"] = State(9, self)
-        self.states["/p/o1/sf"].setEnter(self._p_o1_sf_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sf"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sd"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setTrigger(None)
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sc"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(None)
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-        
-        # transition /p/o1/se
-        _p_o1_se_0 = Transition(self, self.states["/p/o1/se"], [self.states["/p/o1/sf"]])
-        _p_o1_se_0.setTrigger(None)
-        self.states["/p/o1/se"].addTransition(_p_o1_se_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o0_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o1_sf_enter(self):
-        self.big_step.outputEvent(Event("entered_sf", "out", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sd", "out", [])], [Event("entered_sb", "out", []), Event("entered_se", "out", []), Event("entered_sc", "out", []), Event("entered_sf", "out", [])]]

+ 0 - 0
test/target_py/big_step_maximality/__init__.py


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 124
test/target_py/event_lifeline/00_take_one_next_small_step.py


+ 0 - 124
test/target_py/event_lifeline/02_take_one_queue.py

@@ -1,124 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_one_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internal events are treated just like external events: They are added to the object's event queue and will be sensed in another big step. This way, a raised internal event will always be sensed at some point later in time, but it is possible that other (external) events in the object's event queue are treated first.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_one_queue"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeOne
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setAction(self._a_0_exec)
-        _a_0.setTrigger(Event("e", "in"))
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(Event("f", None))
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def _a_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", [])], [Event("entered_c", "out", [])]]

+ 0 - 124
test/target_py/event_lifeline/10_take_many_next_small_step.py

@@ -1,124 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_next_small_step
-Model description:
-Internal event lifeline - Next Small Step-semantics: Internally raised events become present in the next small step.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_many_next_small_step"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setAction(self._a_0_exec)
-        _a_0.setTrigger(Event("e", "in"))
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(Event("f", None))
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def _a_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", []), Event("entered_c", "out", [])]]

+ 0 - 124
test/target_py/event_lifeline/11_take_many_next_combo_step.py

@@ -1,124 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_next_combo_step
-Model description:
-Internal event lifeline - Next Combo Step-semantics: Internally raised events become present in and throughout the next combo step.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_many_next_combo_step"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.NextComboStep
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setAction(self._a_0_exec)
-        _a_0.setTrigger(Event("e", "in"))
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(Event("f", None))
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def _a_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", []), Event("entered_c", "out", [])]]

+ 0 - 124
test/target_py/event_lifeline/12_take_many_queue.py

@@ -1,124 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:55 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   take_many_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internally raised events are treated like external events and are added to the object's event queue. They become present in another big step later on.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "take_many_queue"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        
-        # state /c
-        self.states["/c"] = State(3, self)
-        self.states["/c"].setEnter(self._c_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].addChild(self.states["/c"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setAction(self._a_0_exec)
-        _a_0.setTrigger(Event("e", "in"))
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/c"]])
-        _b_0.setTrigger(Event("f", None))
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.big_step.outputEvent(Event("entered_a", "out", []))
-    
-    def _b_enter(self):
-        self.big_step.outputEvent(Event("entered_b", "out", []))
-    
-    def _c_enter(self):
-        self.big_step.outputEvent(Event("entered_c", "out", []))
-    
-    def _a_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_a", "out", [])], [Event("entered_b", "out", [])], [Event("entered_c", "out", [])]]

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 170
test/target_py/event_lifeline/20_orthogonal_take_one_next_small_step.py


+ 0 - 168
test/target_py/event_lifeline/21_orthogonal_take_one_queue.py

@@ -1,168 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_one_queue
-Model description:
-Internal event lifeline - Queue-semantics: Internal events are treated just like external events: They are added to the object's event queue and will be sensed in another big step. This way, a raised internal event will always be sensed at some point later in time, but it is possible that other (external) events in the object's event queue are treated first.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_one_queue"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeOne
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(5, self)
-        
-        # state /p/o1/sc
-        self.states["/p/o1/sc"] = State(6, self)
-        self.states["/p/o1/sc"].setEnter(self._p_o1_sc_enter)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sc"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setAction(self._p_o0_sa_0_exec)
-        _p_o0_sa_0.setTrigger(Event("f", None))
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sa"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sc
-        _p_o1_sc_0 = Transition(self, self.states["/p/o1/sc"], [self.states["/p/o1/sd"]])
-        _p_o1_sc_0.setAction(self._p_o1_sc_0_exec)
-        _p_o1_sc_0.setTrigger(Event("e", "in"))
-        self.states["/p/o1/sc"].addTransition(_p_o1_sc_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(Event("g", None))
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o1_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o0_sa_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("g", None, []))
-    
-    def _p_o1_sc_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sc", "out", [])], [Event("entered_sd", "out", [])], [Event("entered_sb", "out", [])], [Event("entered_sa", "out", []), Event("entered_se", "out", [])]]

+ 0 - 172
test/target_py/event_lifeline/30_orthogonal_take_many_next_small_step.py

@@ -1,172 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_next_small_step
-Model description:
-This test is a variation of 'orthogonal_next_small_step', but instead we use 'Take Many' big-step maximality semantics, allowing a big step to consist of as many small steps as possible (i.e. keep on executing transitions until there are no longer any enabled transitions).
-
-		In this configuration, internally raised events cannot be lost: if there is a transition that is triggered by an internal event that was raised by a transition from the previous small step, the transition will have a chance of being executed, *but* if there are other transitions (e.g. in other orthogonal components) that are enabled as well, it is possible for one of those to "occupy" the small step and the transition to "miss" it's event. There are 2 solutions to this problem:
-			1) Combine 'Take One' and 'Take Many' semantics, by using 'Take Many' for big step maximality, and 'Take One' for combo step maximality. An internally raised event then becomes present in the next combo step. These semantics are used in Statemate.
-			2) Use concurrency semantics: multiple (orthogonal) transitions are allowed to be executed in a single small step.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_many_next_small_step"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(5, self)
-        
-        # state /p/o1/sc
-        self.states["/p/o1/sc"] = State(6, self)
-        self.states["/p/o1/sc"].setEnter(self._p_o1_sc_enter)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sc"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setAction(self._p_o0_sa_0_exec)
-        _p_o0_sa_0.setTrigger(Event("f", None))
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sa"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sc
-        _p_o1_sc_0 = Transition(self, self.states["/p/o1/sc"], [self.states["/p/o1/sd"]])
-        _p_o1_sc_0.setAction(self._p_o1_sc_0_exec)
-        _p_o1_sc_0.setTrigger(Event("e", "in"))
-        self.states["/p/o1/sc"].addTransition(_p_o1_sc_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(Event("g", None))
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o1_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o0_sa_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("g", None, []))
-    
-    def _p_o1_sc_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sc", "out", [])], [Event("entered_sd", "out", []), Event("entered_sb", "out", []), Event("entered_sa", "out", [])]]

+ 0 - 167
test/target_py/event_lifeline/31_orthogonal_take_many_next_combo_step.py

@@ -1,167 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_next_combo_step
-
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_many_next_combo_step"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.NextComboStep
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(5, self)
-        
-        # state /p/o1/sc
-        self.states["/p/o1/sc"] = State(6, self)
-        self.states["/p/o1/sc"].setEnter(self._p_o1_sc_enter)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sc"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setAction(self._p_o0_sa_0_exec)
-        _p_o0_sa_0.setTrigger(Event("f", None))
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sa"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sc
-        _p_o1_sc_0 = Transition(self, self.states["/p/o1/sc"], [self.states["/p/o1/sd"]])
-        _p_o1_sc_0.setAction(self._p_o1_sc_0_exec)
-        _p_o1_sc_0.setTrigger(Event("e", "in"))
-        self.states["/p/o1/sc"].addTransition(_p_o1_sc_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(Event("g", None))
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o1_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o0_sa_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("g", None, []))
-    
-    def _p_o1_sc_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sc", "out", [])], [Event("entered_sd", "out", []), Event("entered_sb", "out", []), Event("entered_sa", "out", []), Event("entered_se", "out", [])]]

+ 0 - 168
test/target_py/event_lifeline/32_orthogonal_take_many_queue.py

@@ -1,168 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   orthogonal_take_many_queue
-Model description:
-This test is a variation of 'orthogonal_queue', using 'Take Many' semantics instead of 'Take One'. Because 'Queue' internal event lifeline-semantics already does not suffer from events getting "lost", the combination of 'Take Many' and 'Queue' is not very useful. But it is included as a test for the sake of completeness.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "orthogonal_take_many_queue"
-
-class c(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        c.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /p
-        self.states["/p"] = ParallelState(1, self)
-        
-        # state /p/o0
-        self.states["/p/o0"] = State(2, self)
-        
-        # state /p/o0/sa
-        self.states["/p/o0/sa"] = State(3, self)
-        self.states["/p/o0/sa"].setEnter(self._p_o0_sa_enter)
-        
-        # state /p/o0/sb
-        self.states["/p/o0/sb"] = State(4, self)
-        self.states["/p/o0/sb"].setEnter(self._p_o0_sb_enter)
-        
-        # state /p/o1
-        self.states["/p/o1"] = State(5, self)
-        
-        # state /p/o1/sc
-        self.states["/p/o1/sc"] = State(6, self)
-        self.states["/p/o1/sc"].setEnter(self._p_o1_sc_enter)
-        
-        # state /p/o1/sd
-        self.states["/p/o1/sd"] = State(7, self)
-        self.states["/p/o1/sd"].setEnter(self._p_o1_sd_enter)
-        
-        # state /p/o1/se
-        self.states["/p/o1/se"] = State(8, self)
-        self.states["/p/o1/se"].setEnter(self._p_o1_se_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/p"])
-        self.states["/p"].addChild(self.states["/p/o0"])
-        self.states["/p"].addChild(self.states["/p/o1"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sa"])
-        self.states["/p/o0"].addChild(self.states["/p/o0/sb"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sc"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/sd"])
-        self.states["/p/o1"].addChild(self.states["/p/o1/se"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/p"]
-        self.states["/p/o0"].default_state = self.states["/p/o0/sa"]
-        self.states["/p/o1"].default_state = self.states["/p/o1/sc"]
-        
-        # transition /p/o0/sa
-        _p_o0_sa_0 = Transition(self, self.states["/p/o0/sa"], [self.states["/p/o0/sb"]])
-        _p_o0_sa_0.setAction(self._p_o0_sa_0_exec)
-        _p_o0_sa_0.setTrigger(Event("f", None))
-        self.states["/p/o0/sa"].addTransition(_p_o0_sa_0)
-        
-        # transition /p/o0/sb
-        _p_o0_sb_0 = Transition(self, self.states["/p/o0/sb"], [self.states["/p/o0/sa"]])
-        _p_o0_sb_0.setTrigger(None)
-        self.states["/p/o0/sb"].addTransition(_p_o0_sb_0)
-        
-        # transition /p/o1/sc
-        _p_o1_sc_0 = Transition(self, self.states["/p/o1/sc"], [self.states["/p/o1/sd"]])
-        _p_o1_sc_0.setAction(self._p_o1_sc_0_exec)
-        _p_o1_sc_0.setTrigger(Event("e", "in"))
-        self.states["/p/o1/sc"].addTransition(_p_o1_sc_0)
-        
-        # transition /p/o1/sd
-        _p_o1_sd_0 = Transition(self, self.states["/p/o1/sd"], [self.states["/p/o1/se"]])
-        _p_o1_sd_0.setTrigger(Event("g", None))
-        self.states["/p/o1/sd"].addTransition(_p_o1_sd_0)
-    
-    def _p_o0_sa_enter(self):
-        self.big_step.outputEvent(Event("entered_sa", "out", []))
-    
-    def _p_o0_sb_enter(self):
-        self.big_step.outputEvent(Event("entered_sb", "out", []))
-    
-    def _p_o1_sc_enter(self):
-        self.big_step.outputEvent(Event("entered_sc", "out", []))
-    
-    def _p_o1_sd_enter(self):
-        self.big_step.outputEvent(Event("entered_sd", "out", []))
-    
-    def _p_o1_se_enter(self):
-        self.big_step.outputEvent(Event("entered_se", "out", []))
-    
-    def _p_o0_sa_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("g", None, []))
-    
-    def _p_o1_sc_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("f", None, []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/p"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "c":
-            instance = c(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("c", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("e", "in", [], 0.0)]
-    expected_events = [[Event("entered_sa", "out", []), Event("entered_sc", "out", [])], [Event("entered_sd", "out", [])], [Event("entered_sb", "out", []), Event("entered_sa", "out", [])], [Event("entered_se", "out", [])]]

+ 0 - 0
test/target_py/event_lifeline/__init__.py


+ 0 - 158
test/target_py/no_statechart/00_no_statechart_py.py

@@ -1,158 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Herr Joeri Exelmans
-Model name:   no_statechart
-Model description:
-Test to see what happens when a class with no statechart is defined.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "no_statechart"
-
-class my_struct:
-    def __init__(self, x, y):
-        
-        # user defined attributes
-        self.x = None
-        self.y = None
-        
-        # call user defined constructor
-        my_struct.user_defined_constructor(self, x, y)
-    
-    def user_defined_constructor(self, x, y):
-        self.x = x
-        self.y = y
-    
-    def user_defined_destructor(self):
-        pass
-
-class my_class(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        my_class.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.data = my_struct(0, 0)
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /a
-        self.states["/a"] = State(1, self)
-        self.states["/a"].setEnter(self._a_enter)
-        self.states["/a"].setExit(self._a_exit)
-        
-        # state /b
-        self.states["/b"] = State(2, self)
-        self.states["/b"].setEnter(self._b_enter)
-        self.states["/b"].setExit(self._b_exit)
-        
-        # add children
-        self.states[""].addChild(self.states["/a"])
-        self.states[""].addChild(self.states["/b"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/a"]
-        
-        # transition /a
-        _a_0 = Transition(self, self.states["/a"], [self.states["/b"]])
-        _a_0.setAction(self._a_0_exec)
-        _a_0.setTrigger(Event("_0after"))
-        _a_0.setGuard(self._a_0_guard)
-        self.states["/a"].addTransition(_a_0)
-        
-        # transition /b
-        _b_0 = Transition(self, self.states["/b"], [self.states["/a"]])
-        _b_0.setAction(self._b_0_exec)
-        _b_0.setTrigger(Event("_1after"))
-        _b_0.setGuard(self._b_0_guard)
-        self.states["/b"].addTransition(_b_0)
-    
-    def _a_enter(self):
-        self.addTimer(0, 0.1)
-    
-    def _a_exit(self):
-        self.removeTimer(0)
-    
-    def _b_enter(self):
-        self.addTimer(1, 0.1)
-    
-    def _b_exit(self):
-        self.removeTimer(1)
-    
-    def _a_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("to_b", "out", [self.data.x]))
-        self.data.x += 1
-    
-    def _a_0_guard(self, parameters):
-        return self.data.x < 2
-    
-    def _b_0_exec(self, parameters):
-        self.data.y += 1
-        self.big_step.outputEvent(Event("to_a", "out", [self.data.y]))
-    
-    def _b_0_guard(self, parameters):
-        return self.data.y < 2
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/a"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "my_struct":
-            instance = my_struct(self.controller, construct_params[0], construct_params[1])
-            instance.associations = {}
-        elif class_name == "my_class":
-            instance = my_class(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("in")
-        self.addOutputPort("out")
-        self.object_manager.createInstance("my_class", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("to_b", "out", [0])], [Event("to_a", "out", [1])], [Event("to_b", "out", [1])], [Event("to_a", "out", [2])]]

+ 0 - 0
test/target_py/no_statechart/__init__.py


+ 0 - 0
test/target_py/original_semantics/__init__.py


+ 0 - 129
test/target_py/original_semantics/after.py

@@ -1,129 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestAfter
-Model description:
-Used for testing the AFTER event.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestAfter"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /composite
-        self.states["/composite"] = State(1, self)
-        
-        # state /composite/state_1
-        self.states["/composite/state_1"] = State(2, self)
-        self.states["/composite/state_1"].setEnter(self._composite_state_1_enter)
-        self.states["/composite/state_1"].setExit(self._composite_state_1_exit)
-        
-        # state /composite/state_2
-        self.states["/composite/state_2"] = State(3, self)
-        self.states["/composite/state_2"].setEnter(self._composite_state_2_enter)
-        
-        # state /composite/state_3
-        self.states["/composite/state_3"] = State(4, self)
-        self.states["/composite/state_3"].setEnter(self._composite_state_3_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/composite"])
-        self.states["/composite"].addChild(self.states["/composite/state_1"])
-        self.states["/composite"].addChild(self.states["/composite/state_2"])
-        self.states["/composite"].addChild(self.states["/composite/state_3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/composite"]
-        self.states["/composite"].default_state = self.states["/composite/state_1"]
-        
-        # transition /composite/state_1
-        _composite_state_1_0 = Transition(self, self.states["/composite/state_1"], [self.states["/composite/state_2"]])
-        _composite_state_1_0.setTrigger(Event("_0after"))
-        self.states["/composite/state_1"].addTransition(_composite_state_1_0)
-        _composite_state_1_1 = Transition(self, self.states["/composite/state_1"], [self.states["/composite/state_3"]])
-        _composite_state_1_1.setTrigger(Event("_1after"))
-        self.states["/composite/state_1"].addTransition(_composite_state_1_1)
-    
-    def _composite_state_1_enter(self):
-        self.addTimer(0, 0.1)
-        self.addTimer(1, 0.2)
-    
-    def _composite_state_1_exit(self):
-        self.removeTimer(0)
-        self.removeTimer(1)
-    
-    def _composite_state_2_enter(self):
-        self.big_step.outputEvent(Event("in_state_2", "test_output", []))
-    
-    def _composite_state_3_enter(self):
-        self.big_step.outputEvent(Event("in_state_3", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/composite"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("in_state_2", "test_output", [])]]

+ 0 - 187
test/target_py/original_semantics/after_0.py

@@ -1,187 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:56 2016
-
-Model author: Yentl Van Tendeloo
-Model name:   after_0
-Model description:
-Used for testing the AFTER(0) event---which should not block the deletion of the B instance.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "after_0"
-
-class A(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        A.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /x
-        self.states["/x"] = State(1, self)
-        self.states["/x"].setEnter(self._x_enter)
-        
-        # state /ready
-        self.states["/ready"] = State(2, self)
-        self.states["/ready"].setEnter(self._ready_enter)
-        
-        # state /done
-        self.states["/done"] = State(3, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/x"])
-        self.states[""].addChild(self.states["/ready"])
-        self.states[""].addChild(self.states["/done"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/x"]
-        
-        # transition /x
-        _x_0 = Transition(self, self.states["/x"], [self.states["/ready"]])
-        _x_0.setTrigger(Event("instance_created", None))
-        self.states["/x"].addTransition(_x_0)
-        
-        # transition /ready
-        _ready_0 = Transition(self, self.states["/ready"], [self.states["/done"]])
-        _ready_0.setAction(self._ready_0_exec)
-        _ready_0.setTrigger(Event("close", None))
-        self.states["/ready"].addTransition(_ready_0)
-    
-    def _x_enter(self):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, 'child', 'B']))
-        self.big_step.outputEvent(Event("creating_instance", "test_output", []))
-    
-    def _ready_enter(self):
-        self.big_step.outputEventOM(Event("start_instance", None, [self, 'child[0]']))
-        self.big_step.outputEvent(Event("starting_instance", "test_output", []))
-    
-    def _ready_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("delete_instance", None, [self, 'child[0]']))
-        self.big_step.outputEvent(Event("deleting_instance", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/x"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class B(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        B.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /z
-        self.states["/z"] = State(1, self)
-        self.states["/z"].setEnter(self._z_enter)
-        self.states["/z"].setExit(self._z_exit)
-        
-        # add children
-        self.states[""].addChild(self.states["/z"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/z"]
-        
-        # transition /z
-        _z_0 = Transition(self, self.states["/z"], [self.states["/z"]])
-        _z_0.setAction(self._z_0_exec)
-        _z_0.setTrigger(Event("_0after"))
-        self.states["/z"].addTransition(_z_0)
-    
-    def _z_enter(self):
-        self.addTimer(0, 0)
-    
-    def _z_exit(self):
-        self.removeTimer(0)
-    
-    def _z_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("broad_cast", None, [Event("close", None, [])]))
-        self.big_step.outputEvent(Event("after_0", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/z"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "A":
-            instance = A(self.controller)
-            instance.associations = {}
-            instance.associations["child"] = Association("B", 0, 1)
-        elif class_name == "B":
-            instance = B(self.controller)
-            instance.associations = {}
-            instance.associations["parent"] = Association("A", 1, 1)
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("A", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("creating_instance", "test_output", [])], [Event("starting_instance", "test_output", [])], [Event("after_0", "test_output", [])], [Event("deleting_instance", "test_output", []), Event("after_0", "test_output", [])]]

+ 0 - 173
test/target_py/original_semantics/associate_event.py

@@ -1,173 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestAssociateEvent
-Model description:
-Testing the object manager
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestAssociateEvent"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /start
-        self.states["/start"] = State(1, self)
-        
-        # state /wait
-        self.states["/wait"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/start"])
-        self.states[""].addChild(self.states["/wait"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/start"]
-        
-        # transition /start
-        _start_0 = Transition(self, self.states["/start"], [self.states["/wait"]])
-        _start_0.setAction(self._start_0_exec)
-        _start_0.setTrigger(Event("create", "test_input"))
-        self.states["/start"].addTransition(_start_0)
-        
-        # transition /wait
-        _wait_0 = Transition(self, self.states["/wait"], [self.states["/start"]])
-        _wait_0.setAction(self._wait_0_exec)
-        _wait_0.setTrigger(Event("instance_created", None))
-        self.states["/wait"].addTransition(_wait_0)
-    
-    def _start_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "test2_association"]))
-        self.big_step.outputEvent(Event("request_send", "test_output", []))
-    
-    def _wait_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_created", "test_output", []))
-        self.big_step.outputEventOM(Event("start_instance", None, [self, "test2_association"]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, "test2_association", Event("hello", None, [])]))
-        self.big_step.outputEventOM(Event("associate_instance", None, [self, "test2_association", "test3_association"]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/start"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Class2(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class2.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /start
-        self.states["/start"] = State(1, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/start"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/start"]
-        
-        # transition /start
-        _start_0 = Transition(self, self.states["/start"], [self.states["/start"]])
-        _start_0.setAction(self._start_0_exec)
-        _start_0.setTrigger(Event("hello", None))
-        self.states["/start"].addTransition(_start_0)
-    
-    def _start_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("second_working", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/start"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-            instance.associations["test2_association"] = Association("Class2", 0, -1)
-            instance.associations["test3_association"] = Association("Class2", 0, -1)
-        elif class_name == "Class2":
-            instance = Class2(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("create", "test_input", [], 0.0)]
-    expected_events = [[Event("request_send", "test_output", [])], [Event("instance_created", "test_output", [])], [Event("second_working", "test_output", [])]]

+ 0 - 110
test/target_py/original_semantics/correct_duplicate_state_id.py

@@ -1,110 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestCorrectDuplicateStateId
-Model description:
-Testing duplicate id's.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestCorrectDuplicateStateId"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /state0
-        self.states["/state0"] = State(1, self)
-        
-        # state /state0/state1
-        self.states["/state0/state1"] = State(2, self)
-        
-        # state /state0/state0
-        self.states["/state0/state0"] = State(3, self)
-        
-        # state /state1
-        self.states["/state1"] = State(4, self)
-        
-        # state /state1/state1
-        self.states["/state1/state1"] = State(5, self)
-        
-        # state /state1/state0
-        self.states["/state1/state0"] = State(6, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state0"])
-        self.states[""].addChild(self.states["/state1"])
-        self.states["/state0"].addChild(self.states["/state0/state1"])
-        self.states["/state0"].addChild(self.states["/state0/state0"])
-        self.states["/state1"].addChild(self.states["/state1/state1"])
-        self.states["/state1"].addChild(self.states["/state1/state0"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state0"].default_state = self.states["/state0/state1"]
-        self.states["/state1"].default_state = self.states["/state1/state1"]
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = []

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 190
test/target_py/original_semantics/enter_exit_hierarchy.py


+ 0 - 129
test/target_py/original_semantics/guard.py

@@ -1,129 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestGuard
-Model description:
-Testing the guard.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestGuard"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # user defined attributes
-        self.member1 = 0
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /state_1
-        self.states["/state_1"] = State(1, self)
-        self.states["/state_1"].setEnter(self._state_1_enter)
-        
-        # state /state_2
-        self.states["/state_2"] = State(2, self)
-        
-        # state /state_3
-        self.states["/state_3"] = State(3, self)
-        self.states["/state_3"].setEnter(self._state_3_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/state_1"])
-        self.states[""].addChild(self.states["/state_2"])
-        self.states[""].addChild(self.states["/state_3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state_1"]
-        
-        # transition /state_1
-        _state_1_0 = Transition(self, self.states["/state_1"], [self.states["/state_2"]])
-        _state_1_0.setTrigger(None)
-        self.states["/state_1"].addTransition(_state_1_0)
-        
-        # transition /state_2
-        _state_2_0 = Transition(self, self.states["/state_2"], [self.states["/state_1"]])
-        _state_2_0.setTrigger(None)
-        _state_2_0.setGuard(self._state_2_0_guard)
-        self.states["/state_2"].addTransition(_state_2_0)
-        _state_2_1 = Transition(self, self.states["/state_2"], [self.states["/state_3"]])
-        _state_2_1.setTrigger(None)
-        _state_2_1.setGuard(self._state_2_1_guard)
-        self.states["/state_2"].addTransition(_state_2_1)
-    
-    def _state_1_enter(self):
-        self.member1 = self.member1 + 1
-    
-    def _state_3_enter(self):
-        self.big_step.outputEvent(Event("received", "test_output", [self.member1]))
-    
-    def _state_2_0_guard(self, parameters):
-        return self.member1 < 3
-    
-    def _state_2_1_guard(self, parameters):
-        return self.member1 >= 3
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state_1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("received", "test_output", [3])]]

+ 0 - 134
test/target_py/original_semantics/history.py

@@ -1,134 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistory
-Model description:
-Testing the History state.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestHistory"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /composite_1
-        self.states["/composite_1"] = State(1, self)
-        
-        # state /composite_1/state_1
-        self.states["/composite_1/state_1"] = State(2, self)
-        self.states["/composite_1/state_1"].setEnter(self._composite_1_state_1_enter)
-        
-        # state /composite_1/state_2
-        self.states["/composite_1/state_2"] = State(3, self)
-        self.states["/composite_1/state_2"].setEnter(self._composite_1_state_2_enter)
-        
-        # state /composite_1/composite_history
-        self.states["/composite_1/composite_history"] = ShallowHistoryState(4, self)
-        
-        # state /state_3
-        self.states["/state_3"] = State(5, self)
-        self.states["/state_3"].setEnter(self._state_3_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/composite_1"])
-        self.states[""].addChild(self.states["/state_3"])
-        self.states["/composite_1"].addChild(self.states["/composite_1/state_1"])
-        self.states["/composite_1"].addChild(self.states["/composite_1/state_2"])
-        self.states["/composite_1"].addChild(self.states["/composite_1/composite_history"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/composite_1"]
-        self.states["/composite_1"].default_state = self.states["/composite_1/state_1"]
-        
-        # transition /composite_1/state_1
-        _composite_1_state_1_0 = Transition(self, self.states["/composite_1/state_1"], [self.states["/composite_1/state_2"]])
-        _composite_1_state_1_0.setTrigger(Event("to_state_2", "test_input"))
-        self.states["/composite_1/state_1"].addTransition(_composite_1_state_1_0)
-        
-        # transition /state_3
-        _state_3_0 = Transition(self, self.states["/state_3"], [self.states["/composite_1/composite_history"]])
-        _state_3_0.setTrigger(None)
-        self.states["/state_3"].addTransition(_state_3_0)
-        
-        # transition /composite_1
-        _composite_1_0 = Transition(self, self.states["/composite_1"], [self.states["/state_3"]])
-        _composite_1_0.setTrigger(Event("to_state_3", "test_input"))
-        self.states["/composite_1"].addTransition(_composite_1_0)
-    
-    def _composite_1_state_1_enter(self):
-        self.big_step.outputEvent(Event("in_state_1", "test_output", []))
-    
-    def _composite_1_state_2_enter(self):
-        self.big_step.outputEvent(Event("in_state_2", "test_output", []))
-    
-    def _state_3_enter(self):
-        self.big_step.outputEvent(Event("in_state_3", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/composite_1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("to_state_2", "test_input", [], 0.0), InputEvent("to_state_3", "test_input", [], 0.0)]
-    expected_events = [[Event("in_state_1", "test_output", [])], [Event("in_state_2", "test_output", [])], [Event("in_state_3", "test_output", [])], [Event("in_state_2", "test_output", [])]]

+ 0 - 229
test/target_py/original_semantics/history_deep.py

@@ -1,229 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistoryDeep
-Model description:
-Testing history deep.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestHistoryDeep"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel
-        self.states["/parallel"] = ParallelState(1, self)
-        
-        # state /parallel/orthogonal
-        self.states["/parallel/orthogonal"] = State(2, self)
-        
-        # state /parallel/orthogonal/wrapper
-        self.states["/parallel/orthogonal/wrapper"] = State(3, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1
-        self.states["/parallel/orthogonal/wrapper/state_1"] = State(4, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1/inner_1
-        self.states["/parallel/orthogonal/wrapper/state_1/inner_1"] = State(5, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1/inner_2
-        self.states["/parallel/orthogonal/wrapper/state_1/inner_2"] = State(6, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2
-        self.states["/parallel/orthogonal/wrapper/state_2"] = State(7, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2/inner_3
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_3"] = State(8, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2/inner_4
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_4"] = State(9, self)
-        
-        # state /parallel/orthogonal/wrapper/history
-        self.states["/parallel/orthogonal/wrapper/history"] = DeepHistoryState(10, self)
-        
-        # state /parallel/orthogonal/outer
-        self.states["/parallel/orthogonal/outer"] = State(11, self)
-        
-        # state /parallel/orthogonal_tester
-        self.states["/parallel/orthogonal_tester"] = State(12, self)
-        
-        # state /parallel/orthogonal_tester/start
-        self.states["/parallel/orthogonal_tester/start"] = State(13, self)
-        
-        # state /parallel/orthogonal_tester/step1
-        self.states["/parallel/orthogonal_tester/step1"] = State(14, self)
-        
-        # state /parallel/orthogonal_tester/step2
-        self.states["/parallel/orthogonal_tester/step2"] = State(15, self)
-        
-        # state /parallel/orthogonal_tester/step3
-        self.states["/parallel/orthogonal_tester/step3"] = State(16, self)
-        
-        # state /parallel/orthogonal_tester/end
-        self.states["/parallel/orthogonal_tester/end"] = State(17, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_tester"])
-        self.states["/parallel/orthogonal"].addChild(self.states["/parallel/orthogonal/wrapper"])
-        self.states["/parallel/orthogonal"].addChild(self.states["/parallel/orthogonal/outer"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/state_1"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/state_2"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/history"])
-        self.states["/parallel/orthogonal/wrapper/state_1"].addChild(self.states["/parallel/orthogonal/wrapper/state_1/inner_1"])
-        self.states["/parallel/orthogonal/wrapper/state_1"].addChild(self.states["/parallel/orthogonal/wrapper/state_1/inner_2"])
-        self.states["/parallel/orthogonal/wrapper/state_2"].addChild(self.states["/parallel/orthogonal/wrapper/state_2/inner_3"])
-        self.states["/parallel/orthogonal/wrapper/state_2"].addChild(self.states["/parallel/orthogonal/wrapper/state_2/inner_4"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/start"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step1"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step2"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step3"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/end"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel"]
-        self.states["/parallel/orthogonal"].default_state = self.states["/parallel/orthogonal/wrapper"]
-        self.states["/parallel/orthogonal/wrapper"].default_state = self.states["/parallel/orthogonal/wrapper/state_1"]
-        self.states["/parallel/orthogonal/wrapper/state_1"].default_state = self.states["/parallel/orthogonal/wrapper/state_1/inner_1"]
-        self.states["/parallel/orthogonal/wrapper/state_2"].default_state = self.states["/parallel/orthogonal/wrapper/state_2/inner_3"]
-        self.states["/parallel/orthogonal_tester"].default_state = self.states["/parallel/orthogonal_tester/start"]
-        
-        # transition /parallel/orthogonal/wrapper/state_2/inner_3
-        _parallel_orthogonal_wrapper_state_2_inner_3_0 = Transition(self, self.states["/parallel/orthogonal/wrapper/state_2/inner_3"], [self.states["/parallel/orthogonal/wrapper/state_2/inner_4"]])
-        _parallel_orthogonal_wrapper_state_2_inner_3_0.setTrigger(Event("to_inner_4", None))
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_3"].addTransition(_parallel_orthogonal_wrapper_state_2_inner_3_0)
-        
-        # transition /parallel/orthogonal/outer
-        _parallel_orthogonal_outer_0 = Transition(self, self.states["/parallel/orthogonal/outer"], [self.states["/parallel/orthogonal/wrapper/history"]])
-        _parallel_orthogonal_outer_0.setTrigger(Event("to_history", None))
-        self.states["/parallel/orthogonal/outer"].addTransition(_parallel_orthogonal_outer_0)
-        
-        # transition /parallel/orthogonal_tester/start
-        _parallel_orthogonal_tester_start_0 = Transition(self, self.states["/parallel/orthogonal_tester/start"], [self.states["/parallel/orthogonal_tester/step1"]])
-        _parallel_orthogonal_tester_start_0.setAction(self._parallel_orthogonal_tester_start_0_exec)
-        _parallel_orthogonal_tester_start_0.setTrigger(None)
-        self.states["/parallel/orthogonal_tester/start"].addTransition(_parallel_orthogonal_tester_start_0)
-        
-        # transition /parallel/orthogonal_tester/step1
-        _parallel_orthogonal_tester_step1_0 = Transition(self, self.states["/parallel/orthogonal_tester/step1"], [self.states["/parallel/orthogonal_tester/step2"]])
-        _parallel_orthogonal_tester_step1_0.setAction(self._parallel_orthogonal_tester_step1_0_exec)
-        _parallel_orthogonal_tester_step1_0.setTrigger(None)
-        _parallel_orthogonal_tester_step1_0.setGuard(self._parallel_orthogonal_tester_step1_0_guard)
-        self.states["/parallel/orthogonal_tester/step1"].addTransition(_parallel_orthogonal_tester_step1_0)
-        
-        # transition /parallel/orthogonal_tester/step2
-        _parallel_orthogonal_tester_step2_0 = Transition(self, self.states["/parallel/orthogonal_tester/step2"], [self.states["/parallel/orthogonal_tester/step3"]])
-        _parallel_orthogonal_tester_step2_0.setAction(self._parallel_orthogonal_tester_step2_0_exec)
-        _parallel_orthogonal_tester_step2_0.setTrigger(None)
-        _parallel_orthogonal_tester_step2_0.setGuard(self._parallel_orthogonal_tester_step2_0_guard)
-        self.states["/parallel/orthogonal_tester/step2"].addTransition(_parallel_orthogonal_tester_step2_0)
-        
-        # transition /parallel/orthogonal_tester/step3
-        _parallel_orthogonal_tester_step3_0 = Transition(self, self.states["/parallel/orthogonal_tester/step3"], [self.states["/parallel/orthogonal_tester/end"]])
-        _parallel_orthogonal_tester_step3_0.setAction(self._parallel_orthogonal_tester_step3_0_exec)
-        _parallel_orthogonal_tester_step3_0.setTrigger(None)
-        _parallel_orthogonal_tester_step3_0.setGuard(self._parallel_orthogonal_tester_step3_0_guard)
-        self.states["/parallel/orthogonal_tester/step3"].addTransition(_parallel_orthogonal_tester_step3_0)
-        
-        # transition /parallel/orthogonal/wrapper
-        _parallel_orthogonal_wrapper_0 = Transition(self, self.states["/parallel/orthogonal/wrapper"], [self.states["/parallel/orthogonal/outer"]])
-        _parallel_orthogonal_wrapper_0.setTrigger(Event("to_outer", None))
-        self.states["/parallel/orthogonal/wrapper"].addTransition(_parallel_orthogonal_wrapper_0)
-        
-        # transition /parallel/orthogonal/wrapper/state_1
-        _parallel_orthogonal_wrapper_state_1_0 = Transition(self, self.states["/parallel/orthogonal/wrapper/state_1"], [self.states["/parallel/orthogonal/wrapper/state_2"]])
-        _parallel_orthogonal_wrapper_state_1_0.setTrigger(Event("to_state_2", None))
-        self.states["/parallel/orthogonal/wrapper/state_1"].addTransition(_parallel_orthogonal_wrapper_state_1_0)
-    
-    def _parallel_orthogonal_tester_start_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("to_state_2", None, []))
-        self.raiseInternalEvent(Event("to_inner_4", None, []))
-    
-    def _parallel_orthogonal_tester_step1_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check1", "test_output", []))
-        self.raiseInternalEvent(Event("to_outer", None, []))
-    
-    def _parallel_orthogonal_tester_step1_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/wrapper/state_2/inner_4"])
-    
-    def _parallel_orthogonal_tester_step2_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check2", "test_output", []))
-        self.raiseInternalEvent(Event("to_history", None, []))
-    
-    def _parallel_orthogonal_tester_step2_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/outer"])
-    
-    def _parallel_orthogonal_tester_step3_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check3", "test_output", []))
-    
-    def _parallel_orthogonal_tester_step3_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/wrapper/state_2/inner_4"])
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("check1", "test_output", [])], [Event("check2", "test_output", [])], [Event("check3", "test_output", [])]]

+ 0 - 228
test/target_py/original_semantics/history_parallel_deep.py

@@ -1,228 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestHistoryParallelDeep
-Model description:
-Testing history deep.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestHistoryParallelDeep"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel
-        self.states["/parallel"] = ParallelState(1, self)
-        
-        # state /parallel/orthogonal
-        self.states["/parallel/orthogonal"] = State(2, self)
-        
-        # state /parallel/orthogonal/wrapper
-        self.states["/parallel/orthogonal/wrapper"] = ParallelState(3, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1
-        self.states["/parallel/orthogonal/wrapper/state_1"] = State(4, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1/inner_1
-        self.states["/parallel/orthogonal/wrapper/state_1/inner_1"] = State(5, self)
-        
-        # state /parallel/orthogonal/wrapper/state_1/inner_2
-        self.states["/parallel/orthogonal/wrapper/state_1/inner_2"] = State(6, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2
-        self.states["/parallel/orthogonal/wrapper/state_2"] = State(7, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2/inner_3
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_3"] = State(8, self)
-        
-        # state /parallel/orthogonal/wrapper/state_2/inner_4
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_4"] = State(9, self)
-        
-        # state /parallel/orthogonal/wrapper/history
-        self.states["/parallel/orthogonal/wrapper/history"] = DeepHistoryState(10, self)
-        
-        # state /parallel/orthogonal/outer
-        self.states["/parallel/orthogonal/outer"] = State(11, self)
-        
-        # state /parallel/orthogonal_tester
-        self.states["/parallel/orthogonal_tester"] = State(12, self)
-        
-        # state /parallel/orthogonal_tester/start
-        self.states["/parallel/orthogonal_tester/start"] = State(13, self)
-        
-        # state /parallel/orthogonal_tester/step1
-        self.states["/parallel/orthogonal_tester/step1"] = State(14, self)
-        
-        # state /parallel/orthogonal_tester/step2
-        self.states["/parallel/orthogonal_tester/step2"] = State(15, self)
-        
-        # state /parallel/orthogonal_tester/step3
-        self.states["/parallel/orthogonal_tester/step3"] = State(16, self)
-        
-        # state /parallel/orthogonal_tester/end
-        self.states["/parallel/orthogonal_tester/end"] = State(17, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_tester"])
-        self.states["/parallel/orthogonal"].addChild(self.states["/parallel/orthogonal/wrapper"])
-        self.states["/parallel/orthogonal"].addChild(self.states["/parallel/orthogonal/outer"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/state_1"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/state_2"])
-        self.states["/parallel/orthogonal/wrapper"].addChild(self.states["/parallel/orthogonal/wrapper/history"])
-        self.states["/parallel/orthogonal/wrapper/state_1"].addChild(self.states["/parallel/orthogonal/wrapper/state_1/inner_1"])
-        self.states["/parallel/orthogonal/wrapper/state_1"].addChild(self.states["/parallel/orthogonal/wrapper/state_1/inner_2"])
-        self.states["/parallel/orthogonal/wrapper/state_2"].addChild(self.states["/parallel/orthogonal/wrapper/state_2/inner_3"])
-        self.states["/parallel/orthogonal/wrapper/state_2"].addChild(self.states["/parallel/orthogonal/wrapper/state_2/inner_4"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/start"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step1"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step2"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/step3"])
-        self.states["/parallel/orthogonal_tester"].addChild(self.states["/parallel/orthogonal_tester/end"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel"]
-        self.states["/parallel/orthogonal"].default_state = self.states["/parallel/orthogonal/wrapper"]
-        self.states["/parallel/orthogonal/wrapper/state_1"].default_state = self.states["/parallel/orthogonal/wrapper/state_1/inner_1"]
-        self.states["/parallel/orthogonal/wrapper/state_2"].default_state = self.states["/parallel/orthogonal/wrapper/state_2/inner_3"]
-        self.states["/parallel/orthogonal_tester"].default_state = self.states["/parallel/orthogonal_tester/start"]
-        
-        # transition /parallel/orthogonal/wrapper/state_1/inner_1
-        _parallel_orthogonal_wrapper_state_1_inner_1_0 = Transition(self, self.states["/parallel/orthogonal/wrapper/state_1/inner_1"], [self.states["/parallel/orthogonal/wrapper/state_1/inner_2"]])
-        _parallel_orthogonal_wrapper_state_1_inner_1_0.setTrigger(Event("to_inner_2", None))
-        self.states["/parallel/orthogonal/wrapper/state_1/inner_1"].addTransition(_parallel_orthogonal_wrapper_state_1_inner_1_0)
-        
-        # transition /parallel/orthogonal/wrapper/state_2/inner_3
-        _parallel_orthogonal_wrapper_state_2_inner_3_0 = Transition(self, self.states["/parallel/orthogonal/wrapper/state_2/inner_3"], [self.states["/parallel/orthogonal/wrapper/state_2/inner_4"]])
-        _parallel_orthogonal_wrapper_state_2_inner_3_0.setTrigger(Event("to_inner_4", None))
-        self.states["/parallel/orthogonal/wrapper/state_2/inner_3"].addTransition(_parallel_orthogonal_wrapper_state_2_inner_3_0)
-        
-        # transition /parallel/orthogonal/outer
-        _parallel_orthogonal_outer_0 = Transition(self, self.states["/parallel/orthogonal/outer"], [self.states["/parallel/orthogonal/wrapper/history"]])
-        _parallel_orthogonal_outer_0.setTrigger(Event("to_history", None))
-        self.states["/parallel/orthogonal/outer"].addTransition(_parallel_orthogonal_outer_0)
-        
-        # transition /parallel/orthogonal_tester/start
-        _parallel_orthogonal_tester_start_0 = Transition(self, self.states["/parallel/orthogonal_tester/start"], [self.states["/parallel/orthogonal_tester/step1"]])
-        _parallel_orthogonal_tester_start_0.setAction(self._parallel_orthogonal_tester_start_0_exec)
-        _parallel_orthogonal_tester_start_0.setTrigger(None)
-        self.states["/parallel/orthogonal_tester/start"].addTransition(_parallel_orthogonal_tester_start_0)
-        
-        # transition /parallel/orthogonal_tester/step1
-        _parallel_orthogonal_tester_step1_0 = Transition(self, self.states["/parallel/orthogonal_tester/step1"], [self.states["/parallel/orthogonal_tester/step2"]])
-        _parallel_orthogonal_tester_step1_0.setAction(self._parallel_orthogonal_tester_step1_0_exec)
-        _parallel_orthogonal_tester_step1_0.setTrigger(None)
-        _parallel_orthogonal_tester_step1_0.setGuard(self._parallel_orthogonal_tester_step1_0_guard)
-        self.states["/parallel/orthogonal_tester/step1"].addTransition(_parallel_orthogonal_tester_step1_0)
-        
-        # transition /parallel/orthogonal_tester/step2
-        _parallel_orthogonal_tester_step2_0 = Transition(self, self.states["/parallel/orthogonal_tester/step2"], [self.states["/parallel/orthogonal_tester/step3"]])
-        _parallel_orthogonal_tester_step2_0.setAction(self._parallel_orthogonal_tester_step2_0_exec)
-        _parallel_orthogonal_tester_step2_0.setTrigger(None)
-        _parallel_orthogonal_tester_step2_0.setGuard(self._parallel_orthogonal_tester_step2_0_guard)
-        self.states["/parallel/orthogonal_tester/step2"].addTransition(_parallel_orthogonal_tester_step2_0)
-        
-        # transition /parallel/orthogonal_tester/step3
-        _parallel_orthogonal_tester_step3_0 = Transition(self, self.states["/parallel/orthogonal_tester/step3"], [self.states["/parallel/orthogonal_tester/end"]])
-        _parallel_orthogonal_tester_step3_0.setAction(self._parallel_orthogonal_tester_step3_0_exec)
-        _parallel_orthogonal_tester_step3_0.setTrigger(None)
-        _parallel_orthogonal_tester_step3_0.setGuard(self._parallel_orthogonal_tester_step3_0_guard)
-        self.states["/parallel/orthogonal_tester/step3"].addTransition(_parallel_orthogonal_tester_step3_0)
-        
-        # transition /parallel/orthogonal/wrapper
-        _parallel_orthogonal_wrapper_0 = Transition(self, self.states["/parallel/orthogonal/wrapper"], [self.states["/parallel/orthogonal/outer"]])
-        _parallel_orthogonal_wrapper_0.setTrigger(Event("to_outer", None))
-        self.states["/parallel/orthogonal/wrapper"].addTransition(_parallel_orthogonal_wrapper_0)
-    
-    def _parallel_orthogonal_tester_start_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("to_inner_2", None, []))
-        self.raiseInternalEvent(Event("to_inner_4", None, []))
-    
-    def _parallel_orthogonal_tester_step1_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check1", "test_output", []))
-        self.raiseInternalEvent(Event("to_outer", None, []))
-    
-    def _parallel_orthogonal_tester_step1_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/wrapper/state_2/inner_4", "/parallel/orthogonal/wrapper/state_1/inner_2"])
-    
-    def _parallel_orthogonal_tester_step2_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check2", "test_output", []))
-        self.raiseInternalEvent(Event("to_history", None, []))
-    
-    def _parallel_orthogonal_tester_step2_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/outer"])
-    
-    def _parallel_orthogonal_tester_step3_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check3", "test_output", []))
-    
-    def _parallel_orthogonal_tester_step3_0_guard(self, parameters):
-        return self.inState(["/parallel/orthogonal/wrapper/state_2/inner_4", "/parallel/orthogonal/wrapper/state_1/inner_2"])
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("check1", "test_output", [])], [Event("check2", "test_output", [])], [Event("check3", "test_output", [])]]

+ 0 - 121
test/target_py/original_semantics/inner_first.py

@@ -1,121 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestInnerFirst
-Model description:
-Testing inner first.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestInnerFirst"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceChild
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, self)
-        
-        # state /state1/state1
-        self.states["/state1/state1"] = State(2, self)
-        
-        # state /state1/statea
-        self.states["/state1/statea"] = State(3, self)
-        self.states["/state1/statea"].setEnter(self._state1_statea_enter)
-        
-        # state /stateb
-        self.states["/stateb"] = State(4, self)
-        self.states["/stateb"].setEnter(self._stateb_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/stateb"])
-        self.states["/state1"].addChild(self.states["/state1/state1"])
-        self.states["/state1"].addChild(self.states["/state1/statea"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1"].default_state = self.states["/state1/state1"]
-        
-        # transition /state1/state1
-        _state1_state1_0 = Transition(self, self.states["/state1/state1"], [self.states["/state1/statea"]])
-        _state1_state1_0.setTrigger(Event("event", "test_input"))
-        self.states["/state1/state1"].addTransition(_state1_state1_0)
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/stateb"]])
-        _state1_0.setTrigger(Event("event", "test_input"))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_statea_enter(self):
-        self.big_step.outputEvent(Event("in_a", "test_output", []))
-    
-    def _stateb_enter(self):
-        self.big_step.outputEvent(Event("in_b", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("event", "test_input", [], 0.0)]
-    expected_events = [[Event("in_a", "test_output", [])]]

+ 0 - 171
test/target_py/original_semantics/instate.py

@@ -1,171 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestInstate
-Model description:
-Testing the INSTATE macro.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestInstate"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeOne
-        self.semantics.internal_event_lifeline = StatechartSemantics.NextSmallStep
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel_1
-        self.states["/parallel_1"] = ParallelState(1, self)
-        
-        # state /parallel_1/orthogonal1
-        self.states["/parallel_1/orthogonal1"] = State(2, self)
-        
-        # state /parallel_1/orthogonal1/state1
-        self.states["/parallel_1/orthogonal1/state1"] = State(3, self)
-        
-        # state /parallel_1/orthogonal1/inner
-        self.states["/parallel_1/orthogonal1/inner"] = State(4, self)
-        
-        # state /parallel_1/orthogonal1/inner/state2
-        self.states["/parallel_1/orthogonal1/inner/state2"] = State(5, self)
-        
-        # state /parallel_1/orthogonal1/inner/state3
-        self.states["/parallel_1/orthogonal1/inner/state3"] = State(6, self)
-        
-        # state /parallel_1/orthogonal2
-        self.states["/parallel_1/orthogonal2"] = State(7, self)
-        
-        # state /parallel_1/orthogonal2/tester
-        self.states["/parallel_1/orthogonal2/tester"] = State(8, self)
-        
-        # state /parallel_1/orthogonal2/stop
-        self.states["/parallel_1/orthogonal2/stop"] = State(9, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel_1"])
-        self.states["/parallel_1"].addChild(self.states["/parallel_1/orthogonal1"])
-        self.states["/parallel_1"].addChild(self.states["/parallel_1/orthogonal2"])
-        self.states["/parallel_1/orthogonal1"].addChild(self.states["/parallel_1/orthogonal1/state1"])
-        self.states["/parallel_1/orthogonal1"].addChild(self.states["/parallel_1/orthogonal1/inner"])
-        self.states["/parallel_1/orthogonal1/inner"].addChild(self.states["/parallel_1/orthogonal1/inner/state2"])
-        self.states["/parallel_1/orthogonal1/inner"].addChild(self.states["/parallel_1/orthogonal1/inner/state3"])
-        self.states["/parallel_1/orthogonal2"].addChild(self.states["/parallel_1/orthogonal2/tester"])
-        self.states["/parallel_1/orthogonal2"].addChild(self.states["/parallel_1/orthogonal2/stop"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel_1"]
-        self.states["/parallel_1/orthogonal1"].default_state = self.states["/parallel_1/orthogonal1/state1"]
-        self.states["/parallel_1/orthogonal1/inner"].default_state = self.states["/parallel_1/orthogonal1/inner/state2"]
-        self.states["/parallel_1/orthogonal2"].default_state = self.states["/parallel_1/orthogonal2/tester"]
-        
-        # transition /parallel_1/orthogonal1/state1
-        _parallel_1_orthogonal1_state1_0 = Transition(self, self.states["/parallel_1/orthogonal1/state1"], [self.states["/parallel_1/orthogonal1/inner"]])
-        _parallel_1_orthogonal1_state1_0.setTrigger(Event("to_inner", None))
-        self.states["/parallel_1/orthogonal1/state1"].addTransition(_parallel_1_orthogonal1_state1_0)
-        
-        # transition /parallel_1/orthogonal1/inner/state2
-        _parallel_1_orthogonal1_inner_state2_0 = Transition(self, self.states["/parallel_1/orthogonal1/inner/state2"], [self.states["/parallel_1/orthogonal1/inner/state3"]])
-        _parallel_1_orthogonal1_inner_state2_0.setTrigger(Event("to_state3", None))
-        self.states["/parallel_1/orthogonal1/inner/state2"].addTransition(_parallel_1_orthogonal1_inner_state2_0)
-        
-        # transition /parallel_1/orthogonal2/tester
-        _parallel_1_orthogonal2_tester_0 = Transition(self, self.states["/parallel_1/orthogonal2/tester"], [self.states["/parallel_1/orthogonal2/tester"]])
-        _parallel_1_orthogonal2_tester_0.setAction(self._parallel_1_orthogonal2_tester_0_exec)
-        _parallel_1_orthogonal2_tester_0.setTrigger(None)
-        _parallel_1_orthogonal2_tester_0.setGuard(self._parallel_1_orthogonal2_tester_0_guard)
-        self.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_0)
-        _parallel_1_orthogonal2_tester_1 = Transition(self, self.states["/parallel_1/orthogonal2/tester"], [self.states["/parallel_1/orthogonal2/tester"]])
-        _parallel_1_orthogonal2_tester_1.setAction(self._parallel_1_orthogonal2_tester_1_exec)
-        _parallel_1_orthogonal2_tester_1.setTrigger(None)
-        _parallel_1_orthogonal2_tester_1.setGuard(self._parallel_1_orthogonal2_tester_1_guard)
-        self.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_1)
-        _parallel_1_orthogonal2_tester_2 = Transition(self, self.states["/parallel_1/orthogonal2/tester"], [self.states["/parallel_1/orthogonal2/stop"]])
-        _parallel_1_orthogonal2_tester_2.setAction(self._parallel_1_orthogonal2_tester_2_exec)
-        _parallel_1_orthogonal2_tester_2.setTrigger(None)
-        _parallel_1_orthogonal2_tester_2.setGuard(self._parallel_1_orthogonal2_tester_2_guard)
-        self.states["/parallel_1/orthogonal2/tester"].addTransition(_parallel_1_orthogonal2_tester_2)
-    
-    def _parallel_1_orthogonal2_tester_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("check1", "test_output", []))
-        self.raiseInternalEvent(Event("to_inner", None, []))
-    
-    def _parallel_1_orthogonal2_tester_0_guard(self, parameters):
-        return self.inState(["/parallel_1/orthogonal1/state1"])
-    
-    def _parallel_1_orthogonal2_tester_1_exec(self, parameters):
-        self.big_step.outputEvent(Event("check2", "test_output", []))
-        self.raiseInternalEvent(Event("to_state3", None, []))
-    
-    def _parallel_1_orthogonal2_tester_1_guard(self, parameters):
-        return self.inState(["/parallel_1/orthogonal1/inner/state2"])
-    
-    def _parallel_1_orthogonal2_tester_2_exec(self, parameters):
-        self.big_step.outputEvent(Event("check3", "test_output", []))
-    
-    def _parallel_1_orthogonal2_tester_2_guard(self, parameters):
-        return self.inState(["/parallel_1/orthogonal1/inner/state3"])
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel_1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("check1", "test_output", [])], [Event("check2", "test_output", [])], [Event("check3", "test_output", [])]]

+ 0 - 145
test/target_py/original_semantics/multiple_target.py

@@ -1,145 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:57 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestMultipleTarget
-Model description:
-Testing the enter-exit sequence when having a transition that specificies a target state with multiple nodes.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestMultipleTarget"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel
-        self.states["/parallel"] = ParallelState(1, self)
-        
-        # state /parallel/orthogonal_1
-        self.states["/parallel/orthogonal_1"] = State(2, self)
-        
-        # state /parallel/orthogonal_1/inner_1
-        self.states["/parallel/orthogonal_1/inner_1"] = State(3, self)
-        self.states["/parallel/orthogonal_1/inner_1"].setEnter(self._parallel_orthogonal_1_inner_1_enter)
-        
-        # state /parallel/orthogonal_1/inner_2
-        self.states["/parallel/orthogonal_1/inner_2"] = State(4, self)
-        self.states["/parallel/orthogonal_1/inner_2"].setEnter(self._parallel_orthogonal_1_inner_2_enter)
-        
-        # state /parallel/orthogonal_2
-        self.states["/parallel/orthogonal_2"] = State(5, self)
-        
-        # state /parallel/orthogonal_2/inner_1
-        self.states["/parallel/orthogonal_2/inner_1"] = State(6, self)
-        self.states["/parallel/orthogonal_2/inner_1"].setEnter(self._parallel_orthogonal_2_inner_1_enter)
-        
-        # state /parallel/orthogonal_2/inner_2
-        self.states["/parallel/orthogonal_2/inner_2"] = State(7, self)
-        self.states["/parallel/orthogonal_2/inner_2"].setEnter(self._parallel_orthogonal_2_inner_2_enter)
-        
-        # state /next_to_parallel
-        self.states["/next_to_parallel"] = State(8, self)
-        self.states["/next_to_parallel"].setEnter(self._next_to_parallel_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel"])
-        self.states[""].addChild(self.states["/next_to_parallel"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_1"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_2"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/inner_1"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/inner_2"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/inner_1"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/inner_2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/next_to_parallel"]
-        self.states["/parallel/orthogonal_1"].default_state = self.states["/parallel/orthogonal_1/inner_1"]
-        self.states["/parallel/orthogonal_2"].default_state = self.states["/parallel/orthogonal_2/inner_1"]
-        
-        # transition /next_to_parallel
-        _next_to_parallel_0 = Transition(self, self.states["/next_to_parallel"], [self.states["/parallel/orthogonal_1/inner_2"], self.states["/parallel/orthogonal_2/inner_2"]])
-        _next_to_parallel_0.setTrigger(None)
-        self.states["/next_to_parallel"].addTransition(_next_to_parallel_0)
-    
-    def _parallel_orthogonal_1_inner_1_enter(self):
-        self.big_step.outputEvent(Event("enter_1_1", "test_output", []))
-    
-    def _parallel_orthogonal_1_inner_2_enter(self):
-        self.big_step.outputEvent(Event("enter_1_2", "test_output", []))
-    
-    def _parallel_orthogonal_2_inner_1_enter(self):
-        self.big_step.outputEvent(Event("enter_2_1", "test_output", []))
-    
-    def _parallel_orthogonal_2_inner_2_enter(self):
-        self.big_step.outputEvent(Event("enter_2_2", "test_output", []))
-    
-    def _next_to_parallel_enter(self):
-        self.big_step.outputEvent(Event("enter_0", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/next_to_parallel"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = []
-    expected_events = [[Event("enter_0", "test_output", [])], [Event("enter_1_2", "test_output", []), Event("enter_2_2", "test_output", [])]]

+ 0 - 171
test/target_py/original_semantics/object_manager.py

@@ -1,171 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:58 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestObjectManager
-Model description:
-Testing the object manager
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestObjectManager"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /start
-        self.states["/start"] = State(1, self)
-        
-        # state /wait
-        self.states["/wait"] = State(2, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/start"])
-        self.states[""].addChild(self.states["/wait"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/start"]
-        
-        # transition /start
-        _start_0 = Transition(self, self.states["/start"], [self.states["/wait"]])
-        _start_0.setAction(self._start_0_exec)
-        _start_0.setTrigger(Event("create", "test_input"))
-        self.states["/start"].addTransition(_start_0)
-        
-        # transition /wait
-        _wait_0 = Transition(self, self.states["/wait"], [self.states["/start"]])
-        _wait_0.setAction(self._wait_0_exec)
-        _wait_0.setTrigger(Event("instance_created", None))
-        self.states["/wait"].addTransition(_wait_0)
-    
-    def _start_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("create_instance", None, [self, "test2_association"]))
-        self.big_step.outputEvent(Event("request_send", "test_output", []))
-    
-    def _wait_0_exec(self, parameters):
-        association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_created", "test_output", []))
-        self.big_step.outputEventOM(Event("start_instance", None, [self, "test2_association"]))
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, "test2_association", Event("hello", None, [])]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/start"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class Class2(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class2.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /start
-        self.states["/start"] = State(1, self)
-        
-        # add children
-        self.states[""].addChild(self.states["/start"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/start"]
-        
-        # transition /start
-        _start_0 = Transition(self, self.states["/start"], [self.states["/start"]])
-        _start_0.setAction(self._start_0_exec)
-        _start_0.setTrigger(Event("hello", None))
-        self.states["/start"].addTransition(_start_0)
-    
-    def _start_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("second_working", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/start"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-            instance.associations["test2_association"] = Association("Class2", 0, -1)
-        elif class_name == "Class2":
-            instance = Class2(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("create", "test_input", [], 0.0)]
-    expected_events = [[Event("request_send", "test_output", [])], [Event("instance_created", "test_output", [])], [Event("second_working", "test_output", [])]]

+ 0 - 121
test/target_py/original_semantics/outer_first.py

@@ -1,121 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:58 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestOuterFirst
-Model description:
-Testing outer first.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestOuterFirst"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, self)
-        
-        # state /state1/state1
-        self.states["/state1/state1"] = State(2, self)
-        
-        # state /state1/statea
-        self.states["/state1/statea"] = State(3, self)
-        self.states["/state1/statea"].setEnter(self._state1_statea_enter)
-        
-        # state /stateb
-        self.states["/stateb"] = State(4, self)
-        self.states["/stateb"].setEnter(self._stateb_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/stateb"])
-        self.states["/state1"].addChild(self.states["/state1/state1"])
-        self.states["/state1"].addChild(self.states["/state1/statea"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1"].default_state = self.states["/state1/state1"]
-        
-        # transition /state1/state1
-        _state1_state1_0 = Transition(self, self.states["/state1/state1"], [self.states["/state1/statea"]])
-        _state1_state1_0.setTrigger(Event("event", "test_input"))
-        self.states["/state1/state1"].addTransition(_state1_state1_0)
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/stateb"]])
-        _state1_0.setTrigger(Event("event", "test_input"))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_statea_enter(self):
-        self.big_step.outputEvent(Event("in_a", "test_output", []))
-    
-    def _stateb_enter(self):
-        self.big_step.outputEvent(Event("in_b", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("event", "test_input", [], 0.0)]
-    expected_events = [[Event("in_b", "test_output", [])]]

+ 0 - 152
test/target_py/original_semantics/parallel.py

@@ -1,152 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:58 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallel
-Model description:
-Testing parallelism.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestParallel"
-
-class Class1(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        Class1.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel_1
-        self.states["/parallel_1"] = ParallelState(1, self)
-        
-        # state /parallel_1/orthogonal_1
-        self.states["/parallel_1/orthogonal_1"] = State(2, self)
-        
-        # state /parallel_1/orthogonal_1/state_1
-        self.states["/parallel_1/orthogonal_1/state_1"] = State(3, self)
-        self.states["/parallel_1/orthogonal_1/state_1"].setEnter(self._parallel_1_orthogonal_1_state_1_enter)
-        
-        # state /parallel_1/orthogonal_1/state_2
-        self.states["/parallel_1/orthogonal_1/state_2"] = State(4, self)
-        self.states["/parallel_1/orthogonal_1/state_2"].setEnter(self._parallel_1_orthogonal_1_state_2_enter)
-        
-        # state /parallel_1/orthogonal_2
-        self.states["/parallel_1/orthogonal_2"] = State(5, self)
-        
-        # state /parallel_1/orthogonal_2/state_3
-        self.states["/parallel_1/orthogonal_2/state_3"] = State(6, self)
-        self.states["/parallel_1/orthogonal_2/state_3"].setEnter(self._parallel_1_orthogonal_2_state_3_enter)
-        
-        # state /parallel_1/orthogonal_2/state_4
-        self.states["/parallel_1/orthogonal_2/state_4"] = State(7, self)
-        self.states["/parallel_1/orthogonal_2/state_4"].setEnter(self._parallel_1_orthogonal_2_state_4_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel_1"])
-        self.states["/parallel_1"].addChild(self.states["/parallel_1/orthogonal_1"])
-        self.states["/parallel_1"].addChild(self.states["/parallel_1/orthogonal_2"])
-        self.states["/parallel_1/orthogonal_1"].addChild(self.states["/parallel_1/orthogonal_1/state_1"])
-        self.states["/parallel_1/orthogonal_1"].addChild(self.states["/parallel_1/orthogonal_1/state_2"])
-        self.states["/parallel_1/orthogonal_2"].addChild(self.states["/parallel_1/orthogonal_2/state_3"])
-        self.states["/parallel_1/orthogonal_2"].addChild(self.states["/parallel_1/orthogonal_2/state_4"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel_1"]
-        self.states["/parallel_1/orthogonal_1"].default_state = self.states["/parallel_1/orthogonal_1/state_1"]
-        self.states["/parallel_1/orthogonal_2"].default_state = self.states["/parallel_1/orthogonal_2/state_3"]
-        
-        # transition /parallel_1/orthogonal_1/state_1
-        _parallel_1_orthogonal_1_state_1_0 = Transition(self, self.states["/parallel_1/orthogonal_1/state_1"], [self.states["/parallel_1/orthogonal_1/state_2"]])
-        _parallel_1_orthogonal_1_state_1_0.setTrigger(Event("to_state_2", "test_input"))
-        self.states["/parallel_1/orthogonal_1/state_1"].addTransition(_parallel_1_orthogonal_1_state_1_0)
-        
-        # transition /parallel_1/orthogonal_1/state_2
-        _parallel_1_orthogonal_1_state_2_0 = Transition(self, self.states["/parallel_1/orthogonal_1/state_2"], [self.states["/parallel_1/orthogonal_1/state_1"]])
-        _parallel_1_orthogonal_1_state_2_0.setTrigger(Event("to_state_1", "test_input"))
-        self.states["/parallel_1/orthogonal_1/state_2"].addTransition(_parallel_1_orthogonal_1_state_2_0)
-        
-        # transition /parallel_1/orthogonal_2/state_3
-        _parallel_1_orthogonal_2_state_3_0 = Transition(self, self.states["/parallel_1/orthogonal_2/state_3"], [self.states["/parallel_1/orthogonal_2/state_4"]])
-        _parallel_1_orthogonal_2_state_3_0.setTrigger(Event("to_state_4", "test_input"))
-        self.states["/parallel_1/orthogonal_2/state_3"].addTransition(_parallel_1_orthogonal_2_state_3_0)
-        
-        # transition /parallel_1/orthogonal_2/state_4
-        _parallel_1_orthogonal_2_state_4_0 = Transition(self, self.states["/parallel_1/orthogonal_2/state_4"], [self.states["/parallel_1/orthogonal_2/state_3"]])
-        _parallel_1_orthogonal_2_state_4_0.setTrigger(Event("to_state_3", "test_input"))
-        self.states["/parallel_1/orthogonal_2/state_4"].addTransition(_parallel_1_orthogonal_2_state_4_0)
-    
-    def _parallel_1_orthogonal_1_state_1_enter(self):
-        self.big_step.outputEvent(Event("in_state_1", "test_output", []))
-    
-    def _parallel_1_orthogonal_1_state_2_enter(self):
-        self.big_step.outputEvent(Event("in_state_2", "test_output", []))
-    
-    def _parallel_1_orthogonal_2_state_3_enter(self):
-        self.big_step.outputEvent(Event("in_state_3", "test_output", []))
-    
-    def _parallel_1_orthogonal_2_state_4_enter(self):
-        self.big_step.outputEvent(Event("in_state_4", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel_1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "Class1":
-            instance = Class1(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("Class1", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("to_state_2", "test_input", [], 0.0), InputEvent("to_state_4", "test_input", [], 0.0), InputEvent("to_state_1", "test_input", [], 0.0), InputEvent("to_state_2", "test_input", [], 0.0), InputEvent("to_state_3", "test_input", [], 0.0)]
-    expected_events = [[Event("in_state_1", "test_output", []), Event("in_state_3", "test_output", [])], [Event("in_state_2", "test_output", [])], [Event("in_state_4", "test_output", [])], [Event("in_state_1", "test_output", [])], [Event("in_state_2", "test_output", [])], [Event("in_state_3", "test_output", [])]]

+ 0 - 196
test/target_py/original_semantics/parallel_history.py

@@ -1,196 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:58 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallelHistory
-Model description:
-Testing history in parallel.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestParallelHistory"
-
-class TestClass(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        TestClass.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel
-        self.states["/parallel"] = ParallelState(1, self)
-        
-        # state /parallel/orthogonal_1
-        self.states["/parallel/orthogonal_1"] = State(2, self)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"] = State(3, self)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1/state_1
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"] = State(4, self)
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].setEnter(self._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1/state_2
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"] = State(5, self)
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"].setEnter(self._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1/history_1
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"] = ShallowHistoryState(6, self)
-        
-        # state /parallel/orthogonal_1/outer_1
-        self.states["/parallel/orthogonal_1/outer_1"] = State(7, self)
-        self.states["/parallel/orthogonal_1/outer_1"].setEnter(self._parallel_orthogonal_1_outer_1_enter)
-        
-        # state /parallel/orthogonal_2
-        self.states["/parallel/orthogonal_2"] = State(8, self)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"] = State(9, self)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2/state_3
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"] = State(10, self)
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].setEnter(self._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2/state_4
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"] = State(11, self)
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"].setEnter(self._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2/history_2
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"] = ShallowHistoryState(12, self)
-        
-        # state /parallel/orthogonal_2/outer_2
-        self.states["/parallel/orthogonal_2/outer_2"] = State(13, self)
-        self.states["/parallel/orthogonal_2/outer_2"].setEnter(self._parallel_orthogonal_2_outer_2_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_1"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_2"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/outer_1"])
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"])
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"])
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/outer_2"])
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"])
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"])
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel"]
-        self.states["/parallel/orthogonal_1"].default_state = self.states["/parallel/orthogonal_1/orthogonal_inner_1"]
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].default_state = self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"]
-        self.states["/parallel/orthogonal_2"].default_state = self.states["/parallel/orthogonal_2/orthogonal_inner_2"]
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].default_state = self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"]
-        
-        # transition /parallel/orthogonal_1/orthogonal_inner_1/state_1
-        _parallel_orthogonal_1_orthogonal_inner_1_state_1_0 = Transition(self, self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"], [self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]])
-        _parallel_orthogonal_1_orthogonal_inner_1_state_1_0.setTrigger(Event("to_state_2", "test_input"))
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_state_1_0)
-        
-        # transition /parallel/orthogonal_1/outer_1
-        _parallel_orthogonal_1_outer_1_0 = Transition(self, self.states["/parallel/orthogonal_1/outer_1"], [self.states["/parallel/orthogonal_1/orthogonal_inner_1/history_1"]])
-        _parallel_orthogonal_1_outer_1_0.setTrigger(Event("to_history_1", "test_input"))
-        self.states["/parallel/orthogonal_1/outer_1"].addTransition(_parallel_orthogonal_1_outer_1_0)
-        
-        # transition /parallel/orthogonal_2/orthogonal_inner_2/state_3
-        _parallel_orthogonal_2_orthogonal_inner_2_state_3_0 = Transition(self, self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"], [self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]])
-        _parallel_orthogonal_2_orthogonal_inner_2_state_3_0.setTrigger(Event("to_state_4", "test_input"))
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_state_3_0)
-        
-        # transition /parallel/orthogonal_2/outer_2
-        _parallel_orthogonal_2_outer_2_0 = Transition(self, self.states["/parallel/orthogonal_2/outer_2"], [self.states["/parallel/orthogonal_2/orthogonal_inner_2/history_2"]])
-        _parallel_orthogonal_2_outer_2_0.setTrigger(Event("to_history_2", "test_input"))
-        self.states["/parallel/orthogonal_2/outer_2"].addTransition(_parallel_orthogonal_2_outer_2_0)
-        
-        # transition /parallel/orthogonal_1/orthogonal_inner_1
-        _parallel_orthogonal_1_orthogonal_inner_1_0 = Transition(self, self.states["/parallel/orthogonal_1/orthogonal_inner_1"], [self.states["/parallel/orthogonal_1/outer_1"]])
-        _parallel_orthogonal_1_orthogonal_inner_1_0.setTrigger(Event("to_outer_1", "test_input"))
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_0)
-        
-        # transition /parallel/orthogonal_2/orthogonal_inner_2
-        _parallel_orthogonal_2_orthogonal_inner_2_0 = Transition(self, self.states["/parallel/orthogonal_2/orthogonal_inner_2"], [self.states["/parallel/orthogonal_2/outer_2"]])
-        _parallel_orthogonal_2_orthogonal_inner_2_0.setTrigger(Event("to_outer_2", "test_input"))
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_0)
-    
-    def _parallel_orthogonal_1_orthogonal_inner_1_state_1_enter(self):
-        self.big_step.outputEvent(Event("in_state_1", "test_output", []))
-    
-    def _parallel_orthogonal_1_orthogonal_inner_1_state_2_enter(self):
-        self.big_step.outputEvent(Event("in_state_2", "test_output", []))
-    
-    def _parallel_orthogonal_1_outer_1_enter(self):
-        self.big_step.outputEvent(Event("in_outer_1", "test_output", []))
-    
-    def _parallel_orthogonal_2_orthogonal_inner_2_state_3_enter(self):
-        self.big_step.outputEvent(Event("in_state_3", "test_output", []))
-    
-    def _parallel_orthogonal_2_orthogonal_inner_2_state_4_enter(self):
-        self.big_step.outputEvent(Event("in_state_4", "test_output", []))
-    
-    def _parallel_orthogonal_2_outer_2_enter(self):
-        self.big_step.outputEvent(Event("in_outer_2", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "TestClass":
-            instance = TestClass(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("TestClass", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("to_state_2", "test_input", [], 0.0), InputEvent("to_state_4", "test_input", [], 0.0), InputEvent("to_outer_1", "test_input", [], 0.0), InputEvent("to_outer_2", "test_input", [], 0.0), InputEvent("to_history_1", "test_input", [], 0.0), InputEvent("to_history_2", "test_input", [], 0.0)]
-    expected_events = [[Event("in_state_1", "test_output", []), Event("in_state_3", "test_output", [])], [Event("in_state_2", "test_output", [])], [Event("in_state_4", "test_output", [])], [Event("in_outer_1", "test_output", [])], [Event("in_outer_2", "test_output", [])], [Event("in_state_2", "test_output", [])], [Event("in_state_4", "test_output", [])]]

+ 0 - 200
test/target_py/original_semantics/parallel_history_2.py

@@ -1,200 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Date:   Tue Aug 09 09:35:58 2016
-
-Model author: Glenn De Jonghe
-Model name:   TestParallelHistory2
-Model description:
-Testing history where the history state is directly inside a parallel element (deep).
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "TestParallelHistory2"
-
-class TestClass(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
-        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
-        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
-        self.semantics.priority = StatechartSemantics.SourceParent
-        self.semantics.concurrency = StatechartSemantics.Single
-        
-        # build Statechart structure
-        self.build_statechart_structure()
-        
-        # call user defined constructor
-        TestClass.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, self)
-        
-        # state /parallel
-        self.states["/parallel"] = ParallelState(1, self)
-        
-        # state /parallel/orthogonal_1
-        self.states["/parallel/orthogonal_1"] = State(2, self)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"] = State(3, self)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1/state_1
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"] = State(4, self)
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].setEnter(self._parallel_orthogonal_1_orthogonal_inner_1_state_1_enter)
-        
-        # state /parallel/orthogonal_1/orthogonal_inner_1/state_2
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"] = State(5, self)
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"].setEnter(self._parallel_orthogonal_1_orthogonal_inner_1_state_2_enter)
-        
-        # state /parallel/orthogonal_1/outer_1
-        self.states["/parallel/orthogonal_1/outer_1"] = State(6, self)
-        self.states["/parallel/orthogonal_1/outer_1"].setEnter(self._parallel_orthogonal_1_outer_1_enter)
-        
-        # state /parallel/orthogonal_2
-        self.states["/parallel/orthogonal_2"] = State(7, self)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"] = State(8, self)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2/state_3
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"] = State(9, self)
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].setEnter(self._parallel_orthogonal_2_orthogonal_inner_2_state_3_enter)
-        
-        # state /parallel/orthogonal_2/orthogonal_inner_2/state_4
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"] = State(10, self)
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"].setEnter(self._parallel_orthogonal_2_orthogonal_inner_2_state_4_enter)
-        
-        # state /parallel/orthogonal_2/outer_2
-        self.states["/parallel/orthogonal_2/outer_2"] = State(11, self)
-        self.states["/parallel/orthogonal_2/outer_2"].setEnter(self._parallel_orthogonal_2_outer_2_enter)
-        
-        # state /parallel/history_1
-        self.states["/parallel/history_1"] = DeepHistoryState(12, self)
-        
-        # state /next_to_parallel
-        self.states["/next_to_parallel"] = State(13, self)
-        self.states["/next_to_parallel"].setEnter(self._next_to_parallel_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/parallel"])
-        self.states[""].addChild(self.states["/next_to_parallel"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_1"])
-        self.states["/parallel"].addChild(self.states["/parallel/orthogonal_2"])
-        self.states["/parallel"].addChild(self.states["/parallel/history_1"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1"])
-        self.states["/parallel/orthogonal_1"].addChild(self.states["/parallel/orthogonal_1/outer_1"])
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"])
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addChild(self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2"])
-        self.states["/parallel/orthogonal_2"].addChild(self.states["/parallel/orthogonal_2/outer_2"])
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"])
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addChild(self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/parallel"]
-        self.states["/parallel/orthogonal_1"].default_state = self.states["/parallel/orthogonal_1/orthogonal_inner_1"]
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].default_state = self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"]
-        self.states["/parallel/orthogonal_2"].default_state = self.states["/parallel/orthogonal_2/orthogonal_inner_2"]
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].default_state = self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"]
-        
-        # transition /parallel/orthogonal_1/orthogonal_inner_1/state_1
-        _parallel_orthogonal_1_orthogonal_inner_1_state_1_0 = Transition(self, self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"], [self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_2"]])
-        _parallel_orthogonal_1_orthogonal_inner_1_state_1_0.setTrigger(Event("to_state_2", "test_input"))
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1/state_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_state_1_0)
-        
-        # transition /parallel/orthogonal_2/orthogonal_inner_2/state_3
-        _parallel_orthogonal_2_orthogonal_inner_2_state_3_0 = Transition(self, self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"], [self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_4"]])
-        _parallel_orthogonal_2_orthogonal_inner_2_state_3_0.setTrigger(Event("to_state_4", "test_input"))
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2/state_3"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_state_3_0)
-        
-        # transition /next_to_parallel
-        _next_to_parallel_0 = Transition(self, self.states["/next_to_parallel"], [self.states["/parallel/history_1"]])
-        _next_to_parallel_0.setTrigger(Event("to_history_1", "test_input"))
-        self.states["/next_to_parallel"].addTransition(_next_to_parallel_0)
-        
-        # transition /parallel
-        _parallel_0 = Transition(self, self.states["/parallel"], [self.states["/next_to_parallel"]])
-        _parallel_0.setTrigger(Event("exit", "test_input"))
-        self.states["/parallel"].addTransition(_parallel_0)
-        
-        # transition /parallel/orthogonal_1/orthogonal_inner_1
-        _parallel_orthogonal_1_orthogonal_inner_1_0 = Transition(self, self.states["/parallel/orthogonal_1/orthogonal_inner_1"], [self.states["/parallel/orthogonal_1/outer_1"]])
-        _parallel_orthogonal_1_orthogonal_inner_1_0.setTrigger(Event("to_outer_1", "test_input"))
-        self.states["/parallel/orthogonal_1/orthogonal_inner_1"].addTransition(_parallel_orthogonal_1_orthogonal_inner_1_0)
-        
-        # transition /parallel/orthogonal_2/orthogonal_inner_2
-        _parallel_orthogonal_2_orthogonal_inner_2_0 = Transition(self, self.states["/parallel/orthogonal_2/orthogonal_inner_2"], [self.states["/parallel/orthogonal_2/outer_2"]])
-        _parallel_orthogonal_2_orthogonal_inner_2_0.setTrigger(Event("to_outer_2", "test_input"))
-        self.states["/parallel/orthogonal_2/orthogonal_inner_2"].addTransition(_parallel_orthogonal_2_orthogonal_inner_2_0)
-    
-    def _parallel_orthogonal_1_orthogonal_inner_1_state_1_enter(self):
-        self.big_step.outputEvent(Event("in_state_1", "test_output", []))
-    
-    def _parallel_orthogonal_1_orthogonal_inner_1_state_2_enter(self):
-        self.big_step.outputEvent(Event("in_state_2", "test_output", []))
-    
-    def _parallel_orthogonal_1_outer_1_enter(self):
-        self.big_step.outputEvent(Event("in_outer_1", "test_output", []))
-    
-    def _parallel_orthogonal_2_orthogonal_inner_2_state_3_enter(self):
-        self.big_step.outputEvent(Event("in_state_3", "test_output", []))
-    
-    def _parallel_orthogonal_2_orthogonal_inner_2_state_4_enter(self):
-        self.big_step.outputEvent(Event("in_state_4", "test_output", []))
-    
-    def _parallel_orthogonal_2_outer_2_enter(self):
-        self.big_step.outputEvent(Event("in_outer_2", "test_output", []))
-    
-    def _next_to_parallel_enter(self):
-        self.big_step.outputEvent(Event("outside", "test_output", []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/parallel"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, controller):
-        ObjectManagerBase.__init__(self, controller)
-    
-    def instantiate(self, class_name, construct_params):
-        if class_name == "TestClass":
-            instance = TestClass(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, keep_running = None, behind_schedule_callback = None):
-        if keep_running == None: keep_running = True
-        if behind_schedule_callback == None: behind_schedule_callback = None
-        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
-        self.addInputPort("test_input")
-        self.addOutputPort("test_output")
-        self.object_manager.createInstance("TestClass", [])
-
-class InputEvent:
-    def __init__(self, name, port, parameters, time_offset):
-        self.name = name
-        self.port = port
-        self.parameters = parameters
-        self.time_offset = time_offset
-
-class Test:
-    def __init__(self):
-        pass
-    input_events = [InputEvent("to_outer_1", "test_input", [], 0.0), InputEvent("to_outer_2", "test_input", [], 0.0), InputEvent("exit", "test_input", [], 0.0), InputEvent("to_history_1", "test_input", [], 0.0)]
-    expected_events = [[Event("in_state_1", "test_output", []), Event("in_state_3", "test_output", [])], [Event("in_outer_1", "test_output", [])], [Event("in_outer_2", "test_output", [])], [Event("outside", "test_output", [])], [Event("in_outer_1", "test_output", []), Event("in_outer_2", "test_output", [])]]

+ 0 - 0
test/target_py/original_semantics/parallel_history_3.py


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels