Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requirements for JSON Parser

I'm thinking about implementing JSON parser for Delphi. What should a good JSON parser do? Any ideas for requirements? I believe it should at least output and process JSON... Looking at XML parsers, should it be more DOM or SAX-like?

like image 840
pglowack Avatar asked Jan 05 '09 13:01

pglowack


People also ask

What is the need for JSON parse?

JSON. parse() is a crucial method for converting JSON data in string form into Javascript objects. It is possible to convert simple or complex objects, but you should never convert calculations or code, like for loops.

How hard is it to write a JSON parser?

Writing a JSON parser is one of the easiest ways to get familiar with parsing techniques. The format is extremely simple.

How does JSON parser works?

The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.


1 Answers

I think Json.NET does a pretty bang up job.

  • JsonReader and JsonWriter for low level work of parsing and outputting JSON
  • JsonSerializer for converting objects to and from JSON
  • JObject, JArray and JValue classes for working with JSON in an object model

Note I may be a bit bias since I wrote it :)

like image 162
James Newton-King Avatar answered Sep 23 '22 00:09

James Newton-King