The Parser Function is a giant Switch-Case statement.
//The current state of the State Machine Expecting parseState = startOfArray; /* Parses a JSon array of records of name value pairs */ BOOL ParseJsonString(char c) { switch (parseState) { case startOfArray: result = Expect(c); if (result) { //Start of array so no records yet. RecordNo = 0; output.println(F("\r\n1: Starting parse of array.")); } ... ... ... }