/cfsm

simple FSM compiler

Primary LanguageCOtherNOASSERTION

Finite state machine compiler

This program compiles a high-level textual description of a finite
state machine into a C source file, header and/or a graphviz dot file.
It requires all state transitions to be explicitly labelled and will
disallow transitions that aren't permitted. It supports "precondition"
functions that are required to succeed before a state transition is
allowed to occur and "transition functions" that are called upon
transitions. Both the preconditions and transition functions are
per-state, and can be defined to fire at state entry or exit.

A reasonably well documented example state machines that shows off
the currently supported directives are included as "example.fsm" in
this directory. The following command line will compile one to generate
a C source and header as well as a graph in "dot" format:

./cfsm -t . -d example.fsm # Generate fsm.[ch]
./cfsm -t . -g example.fsm # Generate fsm.dot

The FSM is very self-contained; a handful of functions, an opaque
struct and one or two enums (you get to pick their names). They are
reasonably self-documenting too - please have a look at the comments in
the generated header file for API usage.

Damien Miller <djm@mindrot.org> 2007-02-07

$Id: README,v 1.7 2007/11/18 09:52:28 djm Exp $