From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Tue, 10 Aug 2010 17:48:51 +0200 Organization: A noiseless patient Spider Message-ID: <87k4nylb8c.fsf@ludovic-brenta.org> References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <87aap6wcdx.fsf@ludovic-brenta.org> <87vd7jliyi.fsf@ludovic-brenta.org> <699464f5-7f04-4ced-bc09-6ffc42c5322a@w30g2000yqw.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 10 Aug 2010 15:48:50 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="insvQZiV3B4we8nq7W0bMQ"; logging-data="21536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Wyt1jBHiVr1G3IzzCOdf4" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:AKVsUGc4+l5DJuECJAPkEfZgfQ8= sha1:qAfeFueuL8w/QjrjX0cynkZK+WU= Xref: g2news1.google.com comp.lang.ada:13076 Date: 2010-08-10T17:48:51+02:00 List-Id: Natacha Kerensikova writes: > On Aug 9, 8:49 pm, Ludovic Brenta wrote: >> I pursued that idea a little further and actually wrote an embryonic >> S-Expression library.  I'm not entirely satisfied with it because it >> uses copy semantics instead of reference semantics and so is probably >> inefficient.  But it does demonstrate how to read and write >> S-Expressions on a stream (e.g. a file).  Also, it shows how to >> hex-encode and hex-decode blobs, which I've modelled as Storage_Arrays. >> >> You can browse the sources here: >> >> http://green.ada-france.org:8081/branch/changes/org.ludovic-brenta.s_... >> >> Enjoy.  (the license is the GPLv3 or later). > > Interesting, though it seems your code won't like strings containing a > double-quote. I've corrected that and rewritten test.adb to use your example: (tcp-connection ((host foo.bar) (port 80))) My parser needs still the above syntax and will not accept the theoretically equivalent (tcp-connection (host foo.bar) (port 80)) yet. -- Ludovic Brenta.