News for hackers. Stuff that matters.

0fa2

Re:State Machines on Tuesday May 15, 2012 @12:11AM (#3974845)
You can use coroutines as long as your state machine can be structured like code. Loops are Kleene closures, Ifs are alternation, and lists of statements are concatenation.

I used nested C# Enumerators to implement a parser which didn't turn into too much of a mess, but it was a small project.

Structured programming limits you in the state machines you can construct, but probably in a good way.