Next: 8.2.5 Importation
Up: 8.2 Transformation Strategies
Previous: 8.2.3 History
Contents
Index
Method handleEvent handles events by comparing their IDs with
accepted event IDs. It uses a switch-case structure to test those
events, and invokes the changeState method to change the current
state.
Method changeState usually makes the following three calls:
- recordHistory() records the necessary history in
the path from
to the bottom of the state
hierarchy.
is computed statically and stored in
a 2-dimensional array. If
does not exist
(because and are or belong to two different top-level
states), recordHistory(-1) is called.
- removeOutStates() causes the model to leave state
by removing that state and all its substates
from the current state list. If
does not exist,
the code generator simply writes statement state=null; to
clean up the current state list.
- generateStates(, ) generates new states in the
path from
to , and adds them to the
current state list.
Next: 8.2.5 Importation
Up: 8.2 Transformation Strategies
Previous: 8.2.3 History
Contents
Index
Thomas Huining Feng
2004-04-28