Kulkarni provides a detailed simulation of Finite State Machines (FSMs), which are used for pattern matching and lexical analysis. Google Books DFA and NFA: