Build your own JSON parser
Read the language every web app speaks, one character at a time.
Every browser, phone app and server parses JSON millions of times a day. JSON.parse in JavaScript and json.loads in Python are exactly this.
About 90 minutes across 6 stages. Skills: Recursion, Parsing, State machines, Edge cases.
The guides are part of licode Club.
Stages
- Accept exactly {} (with optional whitespace).
- Parse "key": "value" pairs separated by commas.
- Values can be numbers, true, false or null.
- Arrays, and nesting to any depth.
- Handle escapes and reject sneaky invalid input.
- Print the minified document.