O'Reilly logo

Learn More Python 3 the Hard Way: The Next Step for New Python Programmers by Zed A. Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercise 30. Finite State Machines

Whenever you read a book on parsing there’s this scary chapter on finite state machines (FSMs). They go into great detail of “edges” and “nodes” with every combination of possible “automata” being converted into other automata and frankly it’s a bit much. There’s a simpler explanation of FSMs that makes them practical and understandable while not violating the purist theoretical version of the same topic. Sure, you won’t get a paper submitted to the ACM, because you don’t know all of the mathematics behind FSM, but if you just want to use them in your applications then they are simple enough.

An FSM is a way to organize events happening to a set of states. Another way to define an event is an “input trigger,” ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required