Recursive descent JSON parser for PascalScript
Pascal
Switch branches/tags
Nothing to show
Latest commit 0ce36b8 May 4, 2014 @koldev indentation corrected
Permalink
Failed to load latest commit information.
JsonParser.pas First version Jun 19, 2013
JsonParserTest.pas Zero-padding Jun 19, 2013
README.md Host vs. script implementation Jun 19, 2013
Test01.json
Test02.json
Test03.json
Test04.json
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.