12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- 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
- }
- }
- {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_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) {}
|