state
, event
and
transition
attributes are required. The rest
(method
, type
, prefix
and
cookie
) are optional, as noted.
Please see the example page to see exactly how many of these machine attributes are used.
Every transition must specify one or more initial state attributes
(tst
) and one or more transition events (tev
).
switch
statement in C. A procedure will
be emitted that contains a giant switch statement. Each case element
will have stylized comments that will enable any code that has been
inserted there to be carried forward to new generations of the code.
You can see an example of this here.
case
version, above, does.
#define
the DEFINE_FSM
name. See the file
agen5/pseudo-fsm.h in the AutoGen sources for an example of this.step
or
loop
, unless you are not choosing an implementation
method.
INVALID
or DONE
. Sometimes, external code
must control the loop and it must call a transition `step' when a
transition event is detected. For these situations, choose the `step'
machine type. The procedure emitted will return the current state
at the end of each call.
void* cookie
'' will pass a void pointer named `cookie'.
Note: the name must be preceeded by a space character
in order to be correctly separated from the type.