> recursion which is difficult to do in assembler.

Almost as difficult as breathing. The same programming techniques that you use 
to make a program reentrant and reshble also make it recursive.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@listserv.ua.edu> on behalf of 
David Crayford <dcrayf...@gmail.com>
Sent: Wednesday, August 22, 2018 6:39:57 PM
To: IBM-MAIN@listserv.ua.edu
Subject: Re: Anyone here exprerienced in JSON parser (assembler)

On 23/08/2018 12:46 AM, Kirk Wolf wrote:
> I've used the IBM JSON parser, from C.
> I don't see why it would be ill suited for assembler more than anything
> else :-)

I'm doing a lot of JSON work right now and one task was to create a JSON
to YAML convertor for swagger documents.
The elegant solution was to use recursion which is difficult to do in
assembler. It's difficult to do in COBOL too.

I would be interested to know why you used the IBM JSON parser? One only
has to browse the C sample in SYS1.SAMPLIB to
conclude it's a inelegant beast with a bloated API. I can only assume
that you were working on a project that precluded open source software?

I've used several open source C/C++ JSON libraries on z/OS. They're easy
to port (just tweaked to handle UTF8 escape sequences if you want to
process EBCDIC).
I've used YAJL [1] from C but much prefer C++ libraries with map like
interfaces and STL compatible iterators. JsonCpp [2] is quite good but I
prefer picojson [3]
which also has a streaming API.

[1] 
https://secure-web.cisco.com/1dQuLCYj_M7Fegc0i1UpcKTPdY2D-sIz6P26MwxQ_82kBvP115oBjZ5ELlPu4lT2i6WBqGdCYEbnLzCBiIMMRcNsj432zhVMvTcHIagv4pVBDr9N3erdaZjfseglUPwzXLdaMX6wUOThs6nhH-HI6qdtKeuNKeZB4B-awgLL6Ikfg-0ORE4kAW0XhwEBO_yec0FmkO3Q7hNm0DZDonNJJAyo34MSenTXubaLUXytQHo9ECGFj4Z0XueS0sSN64KKUvZqLsE40AMWLEBTSLE9gAJsLHd4mR1woM6DC9DLPYJ3cpD8j3iBaYgcHfeKY9YWBoUSTQxY0fSkTKMliy5RGb32wY_T3XmFDr_PyVmZBmwhf-O-ghRY8p7qcKXX-zTcti--UfsVFOynA_oU83c_7zKJkQKCCS9C5YTrGuvYll6i0RcRP4nTqYrt30MyyIYq1kgICzA55a2sr1XWVjjLndQ/https%3A%2F%2Fgithub.com%2Flloyd%2Fyajl
[2] 
http://secure-web.cisco.com/1PDSVKjeBXdcIZdmyYgGqHu93IvqWONavw66fHj6NUQXztO7M8_6Kk-fQ4A3RZMVdFy8YTx8r1w5JCeRpLaU2w3BtEYmKZcNFyZ4QMpJRc7LOhlmUO2KL__qVt2TCDA6AntwP5jrW9EJbPwSxsyngEKIIHC2FzXgKlBOYHYm1nO9tsW5Hx3rmI01LZ45mtTK7uZfjzzVyRm2Itt-EUvJPJfd5iEHgLgWJR_8P7GzxphbYClRBMsMKVgXVrlfn_RjlNjLid83rK0KJam0NFbR9jTI8GheuTXOJQ_8Viq_ZtMNaiRDqqMBhTLbTz2kgu9P3LwhdDaIkn1S5oAo7N9y6zkAwq_2SKsX05owCRJDBFDsVJZTSSV4GzFQJroW0I11iJ_hI9zRm_hl5xnJA1u_P9kNNH7Kig8gpKar_kKkOwSsYACpi7Ejfjh81tVMyJFHXrd-SKp8-FiHWyu7SnG1mfQ/http%3A%2F%2Fopen-source-parsers.github.io%2Fjsoncpp-docs%2Fdoxygen%2Findex.html
[3] 
https://secure-web.cisco.com/1lPL8IZPxRiZHhoU0KMRNlwao6onwga-6npaxG_q49gRIxQJF6xboseSJyTva5Z36K2fvzSqfexRJKrxSSBzAeHDB9dlkmIvPjRnTG8IkSOqX3KLQLf3PcCZDiA-aIXN4f_18w7Y2tJNdI7J2IAz7OzlJBXPbNGFuJtfDWJBacmcI3J0QLPFEl4y3ODDJHFlcAUmSBEAgEMJigpIwn3tDSv2mvh6nxnP5HyMg6PUcF2p9F-iwWQcG5imfvyVy7XVE_om2oD-2BKdatyG9GoXOs1QRFgvEINUaTyXpbeifSQWLnfwN461qo0p92mK4GXc4c5wBk3uUYTO3o6PGB9t4jy1rl-2ZBw2LsdIkzhy0xQcjDyxRjfyM2s4nQFZLHg4BmEg-X6RfdZ932zgZVm15P16OQeZibMRE6vbMe7AsbJwQtyMTtXp6hxE9BIP8eKd9vo-GsduDMn2174oQyrENMg/https%3A%2F%2Fgithub.com%2Fkazuho%2Fpicojson

> On Wed, Aug 22, 2018 at 10:51 AM Charles Mills <charl...@mcn.org> wrote:
>
>> *Personally* I agree, but different languages for different folks. Some
>> people are very comfortable in assembler, especially with the structured
>> macros. I think I can state with some confidence that if @EdJaffe need to
>> parse some JSON documents he would do it from assembler.
>>
>> COBOL does not seem like a great choice either to me personally, but some
>> folks, and especially some shops, are most comfortable with COBOL.
>>
>> Charles
>>
>> -----Original Message-----
>> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
>> Behalf Of David Crayford
>>
>> IMO, assembler isn't the right language to be parsing complex JSON
>> documents. I couldn't think of a worse
>> language for the job.
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to