Main
AutoGen
Pages
Home
Announce
FAQ
docs
XML Defs
testimonials
downloads
Automated
Options
AutoOpts
Comparison
Man example
Redistribute
Licensing
local use
using getopt
GCC's
Fixincludes
fixincludes
Automated
FSM
description
example
usagefsm
Addons
addon
Automated
XDR
xdr project
AutoFSM is an add-on package to AutoGen.
AutoGen actually includes AutoFSM because it uses its functionality itself.
When you install AutoGen, the Finite State Machine templates
will be installed in ${datadir}/autogen/fsm*.tpl.
Finite state machines can be constructed in a variety of ways. Some of them can be assisted with generated text and others cannot. Or, at least, they cannot be generated very well. What can be generated very well are the transition tables derived from the machine definition.
Here is the list of attributes that various flavors of software finite state machines may have.
AutoFSM supports all four variations of the state-independent or nearly-state-independent transition machines, plus the transition table only output. To use this, you must set up a Finite State Machine AutoGen definitions file that defines:
events,states, andtransitions.The events and states are simply names you
provide for the transition types and processing states. The transition entries are entries that specify an initial state, the
result state and a transition type. By default, the transition type is
named after the original state and the transition event. However, you may
also specify a name in order to allow several different transitions to be
handled with the same code.
The output is currently a set of defines, a transition table suitable for compiling into a C or C++ program, and, optionally, a prototype implementation. There is nothing to restrict output in another language, there just happens not to be any templates to produce other languages at the moment. Watch this space if you have interest in finite state machines in other languages.
Here is an example of a case
method machine, and a usage page for a description
of the FSM attributes. AutoGen itself uses AutoFSM for three parsing
functions. Only the two .c files are linked to here as the
generated .h header files are not archived under CVS:
top Viewable With Any Browser Valid XHTML 1.0!