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 Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!94.75.214.39.MISMATCH!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: Mon, 6 Jun 2011 21:46:33 +0200 Organization: cbb software GmbH Message-ID: <193nyk6qvgu9x.9r7lbb80j7si.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: 6an/HxOXjVOykPvLkSpw3Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:20623 Date: 2011-06-06T21:46:33+02:00 List-Id: On Mon, 06 Jun 2011 21:10:11 +0200, J-P. Rosen wrote: > Le 06/06/2011 20:53, Dmitry A. Kazakov a �crit : >> Of course it is possible for Ada, of which syntax requires neither look >> ahead or roll-back. >> > Strictly speaking, it does need some look ahead for oddities like > character'(''') Not really if the scanner is aware of the context. A character literal (operand) cannot appear in the context of an infix operation and thus need not to be tried after an identifier. On its part an attribute's apostrophe cannot appear in the prefix context (e.g. after the bracket, where an operand or prefix operation is expected). I don't use look-ahead in my parser. Ada's grammar is wonderfully simple for a table driven parser. It only looks awfully complex when written in BNF. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de