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-Thread: 103376,d0fa2610a6bea4ec X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Mateusz Papiernik Newsgroups: comp.lang.ada Subject: Re: Nested declares, constant size arrays and clarity Date: Thu, 04 Oct 2007 15:11:29 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <87641n92tc.fsf@ludovic-brenta.org> <87zlyz6rnt.fsf@ludovic-brenta.org> <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net> NNTP-Posting-Host: acpj86.neoplus.adsl.tpnet.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nemesis.news.tpi.pl 1191503811 17127 83.10.215.86 (4 Oct 2007 13:16:51 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Thu, 4 Oct 2007 13:16:51 +0000 (UTC) User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:2297 Date: 2007-10-04T15:11:29+02:00 List-Id: 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