On 9/20/19 9:46 AM, Robert Haas wrote: > least, I think you do. There's probably some way to create a callback > structure that lets you presuppose that the toplevel data structure is > an array (or object) and get back each element of that array (or > key/value pair) as it's parsed,
If a JSON parser does find its way into src/common, it probably wants to have such an incremental mode available, similar to [2] offered in the "Jackson" library for Java. The Jackson developer has propounded a thesis[1] that such a parsing library ought to offer "Three -- and Only Three" different styles of API corresponding to three ways of organizing the code using the library ([2], [3], [4], which also resemble the different APIs supplied in Java for XML processing). Regards, -Chap [1] http://www.cowtowncoder.com/blog/archives/2009/01/entry_132.html [2] http://www.cowtowncoder.com/blog/archives/2009/01/entry_137.html [3] http://www.cowtowncoder.com/blog/archives/2009/01/entry_153.html [4] http://www.cowtowncoder.com/blog/archives/2009/01/entry_152.html