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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.straub-nv.de!eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Wed, 12 May 2010 07:00:14 +0200 Organization: Adalog Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 12 May 2010 05:00:22 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="GkHyU1NAVSDn9og2i84wqg"; logging-data="12750"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7EVUsCkOpU7ft9YgHuwT4" User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) In-Reply-To: Cancel-Lock: sha1:XrKn+ZE703xOQFylMPj4VzxbHkk= Xref: g2news2.google.com comp.lang.ada:11540 Date: 2010-05-12T07:00:14+02:00 List-Id: Warren a �crit : > J-P. Rosen expounded in news:hsb97m$tnd$1@news.eternal-september.org: > >> Dmitry A. Kazakov a �crit : >>> On Mon, 10 May 2010 18:50:02 +0000 (UTC), Warren wrote: >>> >>>> But you have no way to know when you've read >>>> a empty line in a lexer routine that is reading >>>> character by character. >> Come on, here is the magic function: >> >> function Empty_Line return Boolean is >> begin >> return Col=1 and End_Of_Line; >> end Empty_Line; > > There's a wart-- see earlier posts about "end file". > Of course, this assumes an well-formed Ada file. FYI, there /is/ a scanner in AdaControl, and I never had a problem. The trick is to check End_Of_Line when needed, and never check End_Of_File, but handle End_Error instead. This works even for ill-formed files. And of course, you are welcome to have a look at my scanner in AdaControl ;-) -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr