comp.lang.ada
 help / color / mirror / Atom feed
From: Mateusz Papiernik <mati@maticomp.net>
Subject: Re: Nested declares, constant size arrays and clarity
Date: Thu, 04 Oct 2007 15:11:29 +0200
Date: 2007-10-04T15:11:29+02:00	[thread overview]
Message-ID: <fe2p43$gn7$1@nemesis.news.tpi.pl> (raw)
In-Reply-To: <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net>

Dmitry A. Kazakov pisze:
> I never use Unbounded_String for parsing. The input line buffer can be
> easily reused to accommodate varying strings. The right line boundary would
> be not S'Last, but some variable <= S'Last. Alternatively a string slice
> can be passed down to the parser. Something like that would be necessary to
> do anyway to strip LF/CRs.

Thanks. I will play around with traditional strings to make my own 
simple CSV parser - a good lesson it will be :)

> CSV formats are very easy to do with regular String, IMO much easier than
> with Unbounded_String. You might take a look at
> 
>    http://www.dmitry-kazakov.de/ada/strings_edit.htm

Thanks. I may, in fact, not, due to regulations. I'm playing with ADA 
for my academic course. We've formally just started, but I'm "thinking 
ahead" and doing all future the tasks at home to learn better. We must 
not use external ADA libraries. That's why I'm playing with my own 
parser, which somehow felt right with Unbounded Strings.

The string format is known, its always three columns - but of unknown 
width (in some boundaries, of course, let's say - 100).

I used Unbounded Strings to slice my input by semicolon sign once, then 
slice the rest, and then slice the rest of the rest. I guess I can do 
the same with a simple loop over traditional string to check semicolon 
positions and then simply slice the string with known left/right 
boundaries. Back to code then... :)


Best wishes,
-- 
Mateusz Papiernik, Maticomp Webdesign
Projektowanie i realizacja witryn WWW
mati@maticomp.net, http://www.maticomp.net
"One man can make a difference" - Wilton Knight



  reply	other threads:[~2007-10-04 13:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 22:58 Nested declares, constant size arrays and clarity Mateusz Papiernik
2007-10-03 23:49 ` Ludovic Brenta
2007-10-04  8:49   ` Mateusz Papiernik
2007-10-04 11:33     ` Ludovic Brenta
2007-10-04 12:45       ` Dmitry A. Kazakov
2007-10-04 13:11         ` Mateusz Papiernik [this message]
2007-10-05  5:00           ` Jeffrey R. Carter
2007-10-05  4:58         ` Jeffrey R. Carter
2007-10-05  7:38           ` Dmitry A. Kazakov
2007-10-05 17:08             ` Jeffrey R. Carter
2007-10-05  4:54     ` Jeffrey R. Carter
2007-10-04  0:20 ` Jeffrey R. Carter
2007-10-04  8:51   ` Mateusz Papiernik
2007-10-05  2:45     ` Steve Whalen
2007-10-04  0:23 ` anon
replies disabled

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