StateMachineInit creates a new, empty state machine ready to accept state transitions, and containing states states (numbers 1 to states) and chars characters (numbered 1 to chars). All the state machine information must be stored in the real Mac memory manager handle - it will be disposed with DisposeHandle and that must release all memory, so dont store any extra information outside the handle. Also, you must be able to deal with having multiple state machine instantiated simultaneously.
AddTransition adds a transition from state1 to state2 for characters between (inclusive) first_char and last_char. When you get to state1 and get a character between first_char and last_char you should proceed to state2. The new transition overrides and previous transitions for these characters from state1 (ie, if you get transition 1->2 for chars 1-10, and then 1->3 for chars 5-6, you now have transition 1->2 for chars 1-4 and 7-10 and transition 1->3 for chars 5-6).
RunStateMachine starts in start_state and calls GetNextChar repeatedly until either it returns 0 or until it returns a character for which there is no transition at the current state. Each time it gets a character, the state is moved to the state for which there is a transition from that state with that character [blerg :-]. The final state is returned in stop_state.
*/
#include "Solution.h"
// Fill in your solution and then submit this folder