|
Boost : |
Subject: Re: [boost] Interest in a Boost.JSON library?
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2008-12-25 18:43:34
First off, my grammar accepts anything that Spirit2 can parse (so
everything from ascii to wide_char strings, unicode support will
hopefully be added soon, no changes will be needed to my header to
support it). I only accept Unicode16 in the strings as well, as per
the standard.
I am also quite sure that I read that JSON, in the current form, only
stores doubles internally as a number representation, although it
would be simple to support integers as well. I initially had it try
to parse out a 64-bit integer first, if that failed it tried to parse
out a double (with perfect accuracy), if neither were sufficient to
represent the number then it just stored it as a string to allow the
user to parse it as they wish (I also had a hook where a custom
container type could be stored into the variant that accepted a string
to construct from, such as if using some big number library), but I
commented all that out and just had it support parsing doubles once I
read that, helped with the speed of the parsing as well.
For comment parsing, I only say it would be easy in mine because
Spirit2 grammars are very simple to alter in such ways; once you learn
Spirit2, you will see why. Also, feel free to contact me directly if
you want help; I have been dealing with Spirit2 exclusively for quite
some time now so I have learned it quite well. For IM's, I support
MSN, Yahoo, ICQ, XMPP (through a couple server's, including anything
Google's supports, such as GTalk), and a few others, so if you want
immediate communication, feel free to email me with what you prefer to
use and I can add you.
Also, due to my use of variants, and no shared pointers (which I did
use initially, but it proved rather inefficient, especially in light
of Spirit2s attribute passing being *vastly* more efficient than in
Classic Spirit), the method I used has no cycle issues (everything is
by value, built in-place, a lot more efficient in this design then it
initially sounds).
And yes, Spirit2 is in the latest Boost distribution, and yes, it is
complete sans documentation. Spirit2x is Spirit2, but just in the
Spirit SVN, not yet in Boost, and it compiles to the same
vastly-more-efficient-than-Classic-Spirit code, but also compiles a
great deal faster (Spirit2, like Classic Spirit, compiles hellishly
slow). Spirit2x is not yet feature complete. Spirit2x.QI, the parser
part, is complete, what is lacking is Spirit2x.Karma, the reverse
parser and such. I took a look at your other parsers, and yes, they
would be vastly cleaner if reimplemented in Spirit2(x), and I could
help to help you learn the new syntax, just catch me on IM or what-not
(for note, just adding OvermindDL1 at hotmail.com, or at gmail.com, or
at yahoo.com, and so forth will usually catch me if you just want to
add me directly, I do not check any of those other emails though, only
gmail and my own websites email).
Do note, Spirit2x does have 'some' enhancements, like accepting near
any callable object for an action and so forth, simplifies code even
far greater... :)
*Note: Whenever I say 'string', I mean the templated string type that
is based on the input, so it may be a basic_string<char>, wchar,
whatever.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk