next up previous contents index
Next: 4.2.3 State Properties Up: 4.2 Textual Syntax Previous: 4.2.1 Descriptors   Contents   Index

4.2.2 State Hierarchy

The state hierarchy of a model is written using indentation so it is easily understood by designers. Descriptor STATECHART starts the definition of the state hierarchy. If there are multiple STATECHART descriptors in a single model, the definitions under all of them are literally combined.

Under the STATECHART descriptor, the names of the states are written on separate lines. The indentation of those names represents the parent-children relationship. A name with more leading spaces becomes a child state of the state defined in the previous line. For example, the graphical model in Figure 4.1 is written as the textual representation in Table 4.1.


Table 4.1: An example of the textual representation of a simple state hierarchy
\begin{table}\begin{center}
\begin{minipage}{4cm}
\begin{verbatim}
A
B
C
D
F
E
G
H
I
J
K\end{verbatim}
\end{minipage} \end{center}
\end{table}


The amount of indentation spaces for the first child of a composite state is not important, as long as all its children have exactly the same indentation. From this example, B.C is the first child of B with 4 more leading spaces. For B.D and B.E to be children of B, they should have exactly the same indentation.

The use of TAB is not recommended, since different text editors display a TAB character with different numbers of spaces. In SVM, a TAB is always equivalent to 4 spaces.

The naming convention is the same as the graphical syntax. Different states may have the same name, provided that their path names are different (i.e., they have globally unique fully qualified names).


next up previous contents index
Next: 4.2.3 State Properties Up: 4.2 Textual Syntax Previous: 4.2.1 Descriptors   Contents   Index
Thomas Huining Feng 2004-04-28