-
Notifications
You must be signed in to change notification settings - Fork 35
Enter State Machine Symbols
This algorithm traverses a state machine definition and enters state machine symbols into their scopes.
-
A state machine definition smd.
-
A state machine analysis data structure sma representing the results of analysis so far.
Visit each state machine member smm of smd as follows:
-
Action, guard, junction, and signal definitions: If smm is an action, guard, junction, or signal definition d with name n, then
-
Construct the unique state machine symbol s of the correct kind for d.
-
Add the mapping from n to s in the nested scope of sma in the name group for the definition kind.
-
If smm is a junction definition that appears inside a state definition, then add s to the parent symbol map of sma.
-
-
State definitions: If smm is a state definition d with name n, then
-
Construct the unique state definition symbol sym for d.
-
Add the mapping from n to sym in the innermost nested scope of sma in the state name group.
-
Add sym to the parent symbol map of sma.
-
Create a fresh state machine scope s.
-
Push s onto the nested scope of sma.
-
Add n to the scope name list of sma.
-
Visit each state member of d, yielding a new state machine analysis sma.
-
Remove n from the scope name list of a.
-
Let s' be the innermost nested scope of sma.
-
Add the mapping from sym to s' in the symbol-scope map of sma.
-
Pop s' off the nested scope of sma.
-