JSON C# Parser
I will first introduce myself: I'm the author of the Ajax.NET
http://weblogs.asp.net/mschwarz/) and using JSON to transport objects
Currently I'm working on a parser (or converter) that will create .NET
objects on the server-side from a JSON string. I had a look at the
JSON parser at http://www.json.org/ but ran into different problems.
Has anyone developed such a parser already or is working on it?
- Hi Michael,
I have written such a parser in C#. The parser is an adaption of the
JSONTokener port available from Douglas Crockford's web site . I
have re-factored the JSONTokener, JSONArray and JSONObject classes
be slightly more de-coupled with the eventual goal of allowing the
caller to dictate the object hierarchy that is deserialized by the
parser. In essence, the parser now works with an AST (Abstract
Tree) strategy that can be implemented by anyone. The default
implementation, of course, simply deserializes into JSONObject and
JSONArray instances but that's precisely what can be changed now. I
have also a JSON writer implementation that does the converse. It
provides an AST interface and emits JSON as text. The advantage of
this approach is that you can even (for some odd reason) emit an XML
or binary of the JSON AST. Just one problem...you've just caught me
right before the point I was going to find a home for the sources
haven't gotten around to it. If you're interested in having a look
it sooner, please e-mail me and I can send the implementation to you
--- In firstname.lastname@example.org, Michael Schwarz <michael.schwarz@g...>
> I will first introduce myself: I'm the author of the Ajax.NET
> (http://ajax.schwarz-interactive.de/ or
> http://weblogs.asp.net/mschwarz/) and using JSON to transport
> Currently I'm working on a parser (or converter) that will
> objects on the server-side from a JSON string. I had a look at theproblems.
> JSON parser at http://www.json.org/ but ran into different
> Has anyone developed such a parser already or is working on it?