Quick Start

Drawing a simple automata

  1. Run FSME
  2. Click New button or select it from menu
  3. You will see a tree browser for your Finite State Machine. Click anywhere in this tree (on some item, of course :-)
  4. If the selected element can be edited, you will see an editor in the lower right part of the application. Move somewhere to achieve it. You should see something like this.
You should see something like this

Almost everything except load/save operations is done with embedded editors. I hate dialogs :-). Just click and do.

Making source code from automata

Use fsmc for this purpose. This is a program simular to QT uic. Here is an example:

fsmc file.fsm -o file.h
fsmc file.fsm -i file.h -o file.cpp

or, if you prefer python,

pyfsmc file.fsm -o file.py

Output of fsmc are C++ header and source code of the automata.

The mkfsm is a simple utility written in Python. If you cannot make rules in your Makefile, run this program from the directory where your automatas are located. It will run fsmc when needed. It is very simple, so all help you need is available with fsmc -h.

Here's an example generated automata header

#ifndef SampleFSM818378331
#define SampleFSM818378331
#include <queue> // for event queue

class SampleFSM {
  enum Event { Event };
   virtual bool input() const = 0; 

   virtual void output1() = 0; 
   virtual void output2() = 0; 

  enum States { InitialState, WorkState }; // states

   States __Y;
   bool __recurseLock;
   std::queue<Event> __events; 
   void __processEvent( Event e );
   SampleFSM() : __events() { __Y = InitialState; __recurseLock = false; }
   virtual ~SampleFSM() {}
   States currentState() { return __Y; }
   static const char* eventName( Event e );
   static const char* stateName( States s );
   void A( Event e );


To make something sensible, proceed here.