Recently I committed the great sin of working on web development stuff. To atone for my transgressions, I’m posting the json parser I wrote for the project.

This is a completely thread safe parser written in flex/bison and compiled in c++. Nothing else is necessary to run it. No boost crap, extraneous templating, or c++11, 14, or 6.02e23 or whatever. No cmake or configure tools. It is straight make.

Under 1k lines.

Further, this parser takes in a std::string and not a file. I need to handle requests coming in live from a website, and those messages show up as json. So I needed a thread safe string parser for json…

Here’s the repo for anyone interested: Microsjon repo

I may or may not update it. It is really meant so people can have a reference for the stuff to build threadsafe parsers in one place and not have to fish around a bunch of things to figure it out.

submitted by /u/vxmdesign
[link] [comments]