comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Hierarchical States Machines
Date: Thu, 29 Apr 2004 03:58:08 GMT
Date: 2004-04-29T03:58:08+00:00	[thread overview]
Message-ID: <k3%jc.11226$lz5.1111351@attbi_s53> (raw)
In-Reply-To: fed2d60.0404281048.41d6c549@posting.google.com

I don't have anything against using goto's for state machines... but...

I usually set up an enumeration for each state:

  type my_states is ( start_state, initializing, etc, end_state );

And then use a loop with an enclosed case statement:

  state := start_state;
  loop
    case state is
      when start_state =>
         ...
         state := initializing;
      when initializing =>
      when etc =>
      when end_state =>
    end case;
  end loop;

In my opinion it makes things easier to follow since the entry
to a new state always happens from the same place.

Steve
(The Duck)

"Fabien" <fab_lio@yahoo.fr> wrote in message
news:fed2d60.0404281048.41d6c549@posting.google.com...
> Hi everyone !!!
>
> Pretty new to ADA dev., i am currently trying to implement a
> hierarchical state machine for my application. So far, i must confess
> that i do not really get on well with it. I am thus looking for some
> people who might have tried to do it and who could give me some useful
> tips .
>
> Fabien
>
> pS : I don't look for a ready-to-use solution, just some help !!!!!





  parent reply	other threads:[~2004-04-29  3:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-28 18:48 Hierarchical States Machines Fabien
2004-04-28 19:39 ` Marius Amado Alves
2004-04-28 19:57 ` Robert I. Eachus
2004-04-29  3:00   ` Randy Brukardt
2004-04-29  7:25     ` Martin Krischik
2004-04-29 20:37       ` Randy Brukardt
2004-04-29 12:10   ` Wojtek Narczynski
2004-04-29  3:58 ` Steve [this message]
2004-04-29  5:14   ` Robert I. Eachus
2004-04-29  6:36     ` tmoran
2004-04-29 16:36       ` Robert I. Eachus
2004-04-29 15:41   ` Marius Amado Alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox