Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
Creations
Programming
Advice for writing/porting a JSON parser to C++ using nall?
1
Print
Topic: Advice for writing/porting a JSON parser to C++ using nall?
(Read 4345 times)
previous topic
-
next topic
0 Members and 1 Guest are viewing this topic.
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Advice for writing/porting a JSON parser to C++ using nall?
December 29, 2013, 04:19:36 am
I'm a huge fan of
byuu's nall library
(latest version is in the latest higan release). It has made my C++ programming exponentially simpler and has proven to be significantly lighter weight in my programs than std equivalents. In its very robust string parsing capabilities is code for parsing text as markup, specifically XML and byuu's own BML. It's missing a JSON parser, however, and I wanted to write or port one for byuu to add to nall proper.
I've been having a devil of a time getting myself organized about it
Initially I started by porting
SuperEasyJSON
to nall syntax but I kept getting error after error. Then I decided to start over and attempt to replicate the API found in nall's existing parsers (found in the nall/string/markup directory) but the inconsistency between how XML is parsed and how BML is parsed results in me unable to choose one or the other to use as a jumping off point.
How should I go about writing a JSON parser for nall? Every instinct I have says "parse one character at a time" but I would love to take advantage of nall's existing functionality, especially with regards to node iteration and value conversion, and Unicode inside JSON strings is supported and that would be annoying to handle alone even with
this unicode_to_utf8 function
.
Last Edit
: December 29, 2013, 04:23:03 am by N E O
1
Print
Creations
Programming
Advice for writing/porting a JSON parser to C++ using nall?