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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b5cd7bf26d091c6f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Tue, 7 Jun 2011 09:25:26 +0200 Organization: cbb software GmbH Message-ID: <1g1dsdg5e9hzt.15pdc39q2c8g9.dlg@40tude.net> References: <1e5e764d-eb7b-4804-8119-b535ddbe5e7e@32g2000vbe.googlegroups.com> <1a84tm53l1wjx.1xdgsbp25vyd5.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19668 Date: 2011-06-07T09:25:26+02:00 List-Id: On Mon, 6 Jun 2011 16:37:03 -0700 (PDT), Shark8 wrote: >> Of course it is possible for Ada, of which syntax requires neither look >> ahead or roll-back. > > How are Strings handled? In particular, embedding the double-quote. > How does one parse "Bill said, ""I don't care.""" w/o a look-ahead (or > roll back)? loop if Source (Index) = '"' then Index := Index + 1; exit when Source (Index) /= '"'; -- Does not belong to the literal end if; -- Process a new literal's character in Source (Index) Index := Index + 1; end loop; Yes, you always need a buffer for the current character, which some may consider as a look-ahead, but I don't. (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de