comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Text parsing package
Date: Mon, 28 Mar 2011 12:18:38 +0200
Date: 2011-03-28T12:18:38+02:00	[thread overview]
Message-ID: <op.vs1tlclsule2fv@index.ici> (raw)
In-Reply-To: 1j2rym8p7nnpr$.6ov97ypbvrfe$.dlg@40tude.net

Le Mon, 28 Mar 2011 10:15:52 +0200, Dmitry A. Kazakov  
<mailbox@dmitry-kazakov.de> a écrit:
>>> 3. As others have mentioned, it is a good idea to abstract the source
>>> formats in order to be able to parse files, strings, streams etc.
>> And Ada already provides a root for that: Ada.Streams.Root_Stream_Type
>
> Unfortunately Root_Stream_Type is not an interface and string cannot be
> inherited from. So in the effect you would need a special root.
I meant implementing a concrete Root_Stream_Type using a string as source.  
You would have an open method, getting a string or any kind of reference  
to string, just not as a filename this time. But wonder about efficiency  
(because of the tagged type), which is important for such low-level and  
heavily iterated stuff. Buffering with systematic batch input/output may  
still be option to reach efficiency, even with a tagged stream type (batch  
often help efficiency I feel).

The advantage is that this would be clean to use, as this may be used  
every where something expect a standard Ada Stream. The disadvantage may  
be the above.

Also can be done with generics, but will not try to advocate it, as when I  
used it, I was not happy with that in the end.

> Yes, it would be nice to have structured multiple co-routines as an
> alternative to FSM. There are some cases where tasks look like an  
> overkill.
I remember I made that wish too (can't remember what was said to advocate  
against it). Let's hope for Ada 2017 or Ada 2022.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



  reply	other threads:[~2011-03-28 10:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 23:34 Text parsing package Syntax Issues
2011-03-23  3:01 ` Shark8
2011-03-23  6:29 ` Alex Mentis
2011-03-23  6:36 ` J-P. Rosen
2011-03-23  8:32 ` Dmitry A. Kazakov
2011-03-23 11:19   ` Syntax Issues
2011-03-28  0:15   ` Yannick Duchêne (Hibou57)
2011-03-28  8:15     ` Dmitry A. Kazakov
2011-03-28 10:18       ` Yannick Duchêne (Hibou57) [this message]
2011-03-28 12:08         ` Dmitry A. Kazakov
replies disabled

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