State machines are a powerful approach for programming, but often expressing them in structured languages can be inelegant- state machines and error handling are the primary applications of "goto" in C. They aren't an impassible obstacle, though, if you're working with a language that can define new syntax easily.
I am reminded of a particularly interesting DSL[1] for Forth that makes state machines look like their transition tables:
4 WIDE FSM: <Fixed.Pt#>
\ input: | other? | num? | minus? | dp? |
\ state: ---------------------------------------------
( 0 ) DROP >0 EMIT >1 EMIT >1 EMIT >2
( 1 ) DROP >1 EMIT >1 DROP >1 EMIT >2
( 2 ) DROP >2 EMIT >2 DROP >2 DROP >2 ;
[1]http://galileo.phys.virginia.edu/classes/551.jvn.fall01/fsm....