-
Notifications
You must be signed in to change notification settings - Fork 34
Constructing Flattened Transitions
This algorithm constructs a flattened transition to a state or junction.
-
A state or junction soj1 representing the source of the transition in the hierarchical state machine.
-
The optional state definition sdo1 where soj1 is defined. If soj1 is defined at the top level of the state machine, then sdo1 is None.
-
A transition t.
-
A transition that records all actions specified in the source model together with all entry and exit actions implied by the state machine hierarchy.
-
If t is an internal transition, then return t.
-
Otherwise
-
Let sdo2 be the optional state definition where soj2 is defined. If soj2 is defined at the top level of the state machine, then sdo2 is None.
-
Compute the optional state definition sdo which is the lowest common ancestor of sdo1 and sdo2 in the AST. If the lowest common ancestor is the top level of the state machine, then sdo is None.
-
Let L' be the list of state definitions in the state hierarchy connecting sdo1 to sdo, not including sdo, lowest first. Let A' be the concatenation of the exit action lists of the elements of L'.
-
Let L'' be the list of state definitions in the state hierarchy connecting sdo to sdo2, not including sdo, highest first. Let A'' be the concatenation of the entry action lists of the elements of L''.
-
Return the external transition whose actions are the concatenation of A', A, and A'', and whose destination is soj2.
-