Erlang/OTP Forums

Author Message

<  User Contributions  ~  new version of json_parser.erl

Willem
Posted: Fri Aug 22, 2008 1:18 pm Reply with quote
User Joined: 21 Jul 2006 Posts: 59
json_parser.erl is an efficient parser for json documents.

The parser has a SAX-like API. It also has a mechanism to parse input data in blocks - if it reaches the end of the input data, it will call a function to provide the next block. The combination of these properties results in a parser that can input of arbitrary size, or a stream of data.

Included is a handler function that translates the SAX events into the same output format produced by mochijson2. Looks like this: {struct, [{<<"key1">>, <<"value1">>}, {<<"key2">>, 123}]}. Creating your own handler for another output format should generally be easy.

The parser consists of just 1 file, with some edoc documentation and a couple of very simple examples
included. It only works on UTF-8 encoded input (which implies that it can also parse ASCII, of course).

This is new version, with some fixes for minor issues. Also the license has changed: it now has an apache 2.0 license.

Willem.



json_parser.erl
 Description:
new version of json_parser.erl, an efficient json parser with a SAX-like API

Download
 Filename:  json_parser.erl
 Filesize:  19.41 KB
 Downloaded:  1129 Time(s)

View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum