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: a07f3367d7,36b2e8ae79f7dadd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: OpenToken version 3.1 preview Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <17b17a5b-6b54-4486-8494-650827a58dad@c1g2000yqi.googlegroups.com> Date: Fri, 24 Jul 2009 13:11:41 +0200 Message-ID: <1j6dgo3p10dtd$.1a5p5fjxwebg5.dlg@40tude.net> NNTP-Posting-Date: 24 Jul 2009 13:11:39 CEST NNTP-Posting-Host: 03e2a2d0.newsspool4.arcor-online.net X-Trace: DXC=hnKN8ROMFUn:i=48;n?Z:`4IUKQOROoDNcfSJ;bb[eIRnRBaCd5DnKKNIM@dE On Fri, 24 Jul 2009 06:47:04 -0400, Stephen Leake wrote: > "Dmitry A. Kazakov" writes: > >> You could do what I did in the Simple Components for Ada parser. I >> decoupled sources from the parser itself. The source is an abstract object >> that provides basic operations like "get next line" and "forward to the >> next line". The obvious advantage is that you need not to care about LF, CR >> in the parser, and can use files, streams, strings, GUI text buffers, etc, >> as a source to the same parser. > > Yes, OpenToken does this; the sources are called Text_Feeders. > > The provided file Text_Feeder uses Ada.Text_IO, so it does "the right > thing" for each operating system. > > Which is why the LF is missing from the lexeme; Ada.Text_IO.Get_Line > consumes it. What is wrong with that? I do it exactly same way for text files. Well, provided there is no concern to make it compatible with how Ada RM defines "a line" (I am not sure that "LRM line" always same as "OS line"). Another issue could be compatibility with the GUI text editor. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de