123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- include "primitives.alh"
- Diagram my_SCCD {
- name = "SimpleSCCD"
- author = "Yentl"
- }
- Class main {
- name = "Main"
- default = True
- }
- Attribute attr_a {
- name = "a"
- }
- Attribute attr_b {
- name = "b"
- }
- class_attributes (main, attr_a) {}
- class_attributes (main, attr_b) {}
- CompositeState main_statechart {
- name = "root"
- isInitial = True
- {composite_children} BasicState init {
- name = "initial"
- isInitial = True
- }
- {composite_children} ParallelState main_parallel {
- name = "parallel"
- isInitial = False
- {parallel_children} CompositeState parallel_x {
- {composite_children} BasicState x_a {
- name = "xa"
- isInitial = True
- }
- {composite_children} BasicState x_b {
- name = "xb"
- isInitial = False
- }
- {composite_children} BasicState x_c {
- name = "xc"
- isInitial = False
- }
- {composite_children} BasicState x_d {
- name = "xd"
- isInitial = False
- }
- }
- {parallel_children} CompositeState parallel_y {
- {composite_children} BasicState y_a {
- name = "ya"
- isInitial = True
- }
- {composite_children} BasicState y_b {
- name = "yb"
- isInitial = False
- }
- }
- }
- }
- transition (x_a, x_b) {
- name = "X"
- event = "X"
- script = $
- Void function script(attributes : Element):
- log("In script")
- dict_overwrite(attributes, "a", 1)
- dict_overwrite(attributes, "b", 2)
- return!
- $
- }
- transition (x_a, x_d) {
- name = "timeout"
- after = $
- Float function after(attributes : Element):
- log("In after")
- return 3.0!
- $
- }
- transition (x_b, x_c) {
- name = "Z"
- cond = $
- Boolean function cond(attributes : Element):
- log("In condition")
- return integer_lt(attributes["a"], attributes["b"])!
- $
- }
- transition (y_a, y_b) {
- name = "Y"
- event = "Y"
- }
- transition (init, main_parallel) {
- name = "init"
- event = "init"
- }
- diagram_classes (my_SCCD, main) {}
- behaviour (main, main_statechart) {}
|