comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: OpenToken version 3.1 preview
Date: Fri, 24 Jul 2009 06:47:04 -0400
Date: 2009-07-24T06:47:04-04:00	[thread overview]
Message-ID: <ueis65pef.fsf@stephe-leake.org> (raw)
In-Reply-To: y1569n52unt5$.11zqspfzv2asc.dlg@40tude.net

"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.

OpenToken also provides a String Text_Feeder, which of course has no
notion of lines.

-- 
-- Stephe



  reply	other threads:[~2009-07-24 10:47 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 [this message]
2009-07-24 11:11           ` Dmitry A. Kazakov
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