Recursive descent JSON parser for PascalScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
JsonParser.pas First version Jun 19, 2013
JsonParserTest.pas
README.md
Test01.json indentation corrected May 3, 2014
Test02.json
Test03.json
Test04.json indentation corrected May 3, 2014
Test05.json indentation corrected May 3, 2014

README.md

JsonParser

Recursive descent JSON parser for PascalScript

I translated Douglas Crockford's recursive descent parser into PascalScript. Since PascalScript doesn't handle pointers and classes, I used dynamic arrays to store JSON values in a type-safe way. The parser can also be used from Standard Pascal or Object Pascal (Delphi), but since these don't suffer from the constraints of PascalScript, other parsers may be more efficient (see here and here). If you need to parse JSON strings from PascalScript, the best option is to add one of the fast parsers to the host code, and make it accessible from script code. This implementation is for those who don't have access to the host code.

The JSON testfiles contain the examples from here.

This code is in the Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.