Another project we had during my first Winter quarter at Rose-Hulman was to use a finite state machine to colorize / perform syntax highlighting on Java source code. It’s easy enough as there are really 3 special cases that we are looking for (strings, comments, and keywords) and we only need 9 states to recognize them all (at least in my implementation).