This repository contains code for a homemade recursive JSON parser in C. Because this is a toy parser, not all standard JSON features are meant to be supported. I do not intend this to be a production-ready, blazingly fast parser, but I made this for fun. Feel free to fork my work in progress project.
- Build:
make all
- Run:
./myjson <test number>
- Test 1: Access Array in an Object.
- Test 2: Access the first item in a plain Array.
- Test 3: Access a property of the second Object in a list of Objects.
- Clean:
make clean
- No backslash escaped characters.
- No Unicode support.
- No booleans yet. (I should add this!)
- The JSON source is copied into a memory buffer which is inefficient use of memory for larger files if I intend to later support those file sizes.
- The parser code has some ugly spaghetti in the parse object function.
Implement JSON data structures!Implement Lexer.Implement recursive token parser.Test run parse result and do structure function tests.Refactor helper function for reading JSON file.- Refactor
Parser_Parse_Obj(...)
, specifically the "expect" flags. - Add another test for
null
property values.