comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: References on encoding (Hierarchical) State Machines / Automata in Ada?
Date: Wed, 13 Feb 2013 22:28:40 +0000
Date: 2013-02-13T22:28:40+00:00	[thread overview]
Message-ID: <lyliarrgpz.fsf@pushface.org> (raw)
In-Reply-To: kfgsqt$5ll$1@dont-email.me

Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org> writes:

>> david.mentre@gmail.com writes:
>>
>> Would somebody have references on the encoding of State Machines or
>> Hierarchical State Machines in Ada?
>
> I recall someone named Robert Dewar (whoever he is :) saying that the
> mechanical implementation of STDs is a place where one should use
> "goto". That was here on c.l.a:
>
> https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.ada/tFlS5d7bfpo

I can understand that if the FSM is a task - you're implementing the
states in terms of the program counter, nothing wrong with goto for
that. But if you've inverted this, so that the FSM is a passive
construct, you're going to need an enumeration of the possible states,
and some way of representing the possible events (I made an abstract
type Event_Base with an abstract Handler, then each concrete event that
could be received by a particular FSM has a case statement over the
possible states; the whole thing generated from a UML model [1]).

[1] http://coldframe.sourceforge.net/coldframe/events.html



  reply	other threads:[~2013-02-13 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 10:42 References on encoding (Hierarchical) State Machines / Automata in Ada? david.mentre
2013-02-13 15:30 ` Eryndlia Mavourneen
2013-02-13 16:02 ` rrr.eee.27
2013-02-13 18:05 ` Simon Wright
2013-02-13 20:25   ` Jeffrey Carter
2013-02-13 22:28     ` Simon Wright [this message]
2013-02-14  8:34       ` Dmitry A. Kazakov
2013-02-14  0:00 ` jpwoodruff
replies disabled

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