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 X-Google-Thread: 103376,b34ecb04700058dd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-18 03:00:58 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: maa@liacc.up.pt (=?ISO-8859-1?Q?M=E1rio_Amado_Alves?=) Newsgroups: comp.lang.ada Subject: Re: how to parse words from a string Date: 18 Nov 2002 03:00:58 -0800 Organization: http://groups.google.com/ Message-ID: <4a4de33a.0211180300.1eeacc85@posting.google.com> References: <3DD3EF12.3010009@acm.org> <4a4de33a.0211170040.1b8de118@posting.google.com> <3DD806CF.9090204@acm.org> NNTP-Posting-Host: 193.137.36.168 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1037617258 29334 127.0.0.1 (18 Nov 2002 11:00:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 18 Nov 2002 11:00:58 GMT Xref: archiver1.google.com comp.lang.ada:31033 Date: 2002-11-18T11:00:58+00:00 List-Id: > > C : Character > > Word : Unbounded_String; > > begin > > loop > > Get_Immediate (C); > > if Is_Graphic (C) and C /= ' ' then > > Append (Word, C); > > else > > Process (Word); > > Word := Null_Unbounded_String; > > end if; > > end loop; > > exception > > when End_Error => > > if Word /= Null_Unbounded_String then Process (Word); end if; > ... doesn't read from an arbitrary file Trivial adaptation, left as an exercise. Hints: see A.10.1 (15) and (41). > nor handle words separated by horizontal tabs. Of course it does. See A.3.2 (23). --MAA