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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: OpenToken version 3.1 preview References: <17b17a5b-6b54-4486-8494-650827a58dad@c1g2000yqi.googlegroups.com> From: Stephen Leake Date: Fri, 24 Jul 2009 06:47:04 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:4PHGksOCPyDVy0vWFDMpk7y9SSo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 0af524a699114e197caa711488 Xref: g2news2.google.com comp.lang.ada:7313 Date: 2009-07-24T06:47:04-04:00 List-Id: "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. OpenToken also provides a String Text_Feeder, which of course has no notion of lines. -- -- Stephe