comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: OpenToken version 3.1 preview
Date: Fri, 24 Jul 2009 13:11:41 +0200
Date: 2009-07-24T13:11:39+02:00	[thread overview]
Message-ID: <1j6dgo3p10dtd$.1a5p5fjxwebg5.dlg@40tude.net> (raw)
In-Reply-To: ueis65pef.fsf@stephe-leake.org

On Fri, 24 Jul 2009 06:47:04 -0400, Stephen Leake wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2009-07-24 11:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 21:23 OpenToken version 3.1 preview Stephen Leake
2009-07-20  9:47 ` Stephen Leake
2009-07-21 13:03 ` AdaMagica
2009-07-23  1:41   ` Stephen Leake
2009-07-23  5:09     ` AdaMagica
2009-07-23  8:00       ` Dmitry A. Kazakov
2009-07-24 10:47         ` Stephen Leake
2009-07-24 11:11           ` Dmitry A. Kazakov [this message]
2009-07-24 10:54       ` Stephen Leake
2009-07-25  1:18         ` Stephen Leake
2009-07-23 15:19     ` vlc
2009-07-23 20:09     ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox