Would there be something that goes the other way? Given a JSON input generates C structs and efficient serialization/deserialization for given input? It could be useful for C++ too but generate classes instead. I'm aware of gsoap which did this for wsdl and generated code for use by SOAP xml clients and servers but not sure if anyone has done this for json
I've used gcc-xml (apparently has been superseded by another tool now) when I've needed this sort of thing in the past. It has the advantage of being a real C parser rather than a jumble of regexes.
A mess of regexes and splits... yeah, no. You should probably get introduced to the wonderful world of parsers (and compilers):<p><a href="https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools" rel="nofollow">https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniq...</a>
This is a bad name, another cproto library has been in use for over 20 years:<p><a href="http://invisible-island.net/cproto/cproto.html" rel="nofollow">http://invisible-island.net/cproto/cproto.html</a>