is there anything concise and compact to describe a finite state machine?
Yup, the request sounds and smells "DSL" (domain specific language).
Or something good to help programming
I am used to describe fsm-s in C, and my whole lib_tokenizer is *FULL* of fsm-s, but some are very long, so the code looks like driving in a nail with the screwdriver
switch (status.curr)
{
case ...:
if (False)
{
panic();
}
else if (input isEqualTo ...)
{
status.next = ...;
output = ...;
}
else if (input isEqualTo ...)
{
status.next = ...;
output = ...;
}
else
{
status.next = ...;
output = ...;
}
break;
default:
if (False)
{
panic();
}
else if (input isEqualTo ...)
{
status.next = ...;
output = ...;
}
else if (input isEqualTo ...)
{
status.next = ...;
output = ...;
}
else
{
status.next = ...;
output = ...;
}
break;
}
(
Oh, I am - "modestly" - a master in driving a nail with the screwdriver
I've practiced so long you wouldn't believe how good I am!
Just, ... results are that ... nails often enter so crooked that I have to spend much more time to straighten them
So, hey, you guessed right, DSL needs because I spent a lot of time to straighten the code
)