Setting up state machine to parse file index