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: a07f3367d7,a3b1adae5552af6d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Alex Mentis" Newsgroups: comp.lang.ada Subject: Re: Text parsing package Date: Wed, 23 Mar 2011 06:29:18 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4fa6c081-910a-4e62-928a-0f6cdd1da951@l18g2000yqm.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 23 Mar 2011 06:29:18 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="TfaOIE1E70h9psK9x8LxRg"; logging-data="2810"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VyisD13cx5mGg+33MxnvsnA/4GqPETvc=" User-Agent: XanaNews/1.19.1.269 Cancel-Lock: sha1:wDzDLhRbTchSfFfprDRU+IdjCMc= Xref: g2news2.google.com comp.lang.ada:19363 Date: 2011-03-23T06:29:18+00:00 List-Id: Syntax Issues wrote: > I have just finished a simple text parsing package. If anyone is > interested I can post the code (only about 160~ lines). > > > Example of how its used: > > with > Parsing, > Ada.Text_Io, > Ada.Strings.Unbounded; > use > Ada.Text_Io, > Ada.Strings.Unbounded; > procedure Test_Parsing > is > begin > Parsing.Open("Test.txt"); > Put_Line(Float'Image(Parsing.Next_Float)); > Put_Line(Parsing.Next_String); > Put_Line(Parsing.Next_String); > Put_Line(Parsing.Next_String); > Put_Line(To_String(Parsing.Next_Unbounded_String)); > Put_Line(Integer'Image(Parsing.Next_Integer)); > Put_Line(Float'Image(Parsing.Next_Float)); > Parsing.Close; > end Test_Parsing; > -- Test.txt -- > 152.15 Test! > TesT > c > > ca4 > > 4 > > 12.9 > -- End of file -- > > -- Output -- > 1.52150E+02 > Test! > TesT > c > ca4 > 4 > 1.29000E+01 > -- End of output -- Sure, I'd be interested in seeing the source. Does it only work with files, or can it be used with standard input, too? Alex