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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a0c:becb:: with SMTP id f11mr21331422qvj.213.1589891998747; Tue, 19 May 2020 05:39:58 -0700 (PDT) X-Received: by 2002:a4a:8253:: with SMTP id t19mr16558857oog.69.1589891998354; Tue, 19 May 2020 05:39:58 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 19 May 2020 05:39:58 -0700 (PDT) In-Reply-To: <4aa85a46-b818-4b04-8b2c-56dc833e18ff@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=136.163.208.2; posting-account=HFCrOQoAAABZD_f-UUbYHm3lJDIrh-UX NNTP-Posting-Host: 136.163.208.2 References: <4aa85a46-b818-4b04-8b2c-56dc833e18ff@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <540b1fe0-a96b-41dc-8458-43dc8106f595@googlegroups.com> Subject: Re: Ann: HAC v.0.06 - Text File I/O From: joakimds@kth.se Injection-Date: Tue, 19 May 2020 12:39:58 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58742 Date: 2020-05-19T05:39:58-07:00 List-Id: Den tisdag 19 maj 2020 kl. 10:50:14 UTC+2 skrev gautier...@hotmail.com: > HAC (HAC Ada Compiler) is available on two open-source development sites: > https://hacadacompiler.sourceforge.io/ > https://github.com/zertovitch/hac > > HAC is a small, quick, open-source Ada compiler, covering a subset of > the Ada language. > Even though the HAC documentation is more or less non-existent, the good > news is that you can use as a help Ada books and online documentation > about Ada: HAC does not define a dialect of Ada, only a subset. > A glimpse into the file "src/hac_pack.ads" gives you the currently > available types and subprograms. > > The latest additions are: > ------------------------ > > - v.0.06: Text File I/O around File_Type (example below) > > - v.0.05: type VString (variable-size string), with various operators > and functions ("&", "*", comparison operators, Element, Length, > Slice, Index, Trim, Image, Integer_Value, Float_Value functions); > system functions (Argument_Count, Argument, Get_Env, Set_Env, > Shell_Execute) > > HAC programs are real Ada programs, they can be built by a "serious" > Ada compiler, through the HAC_Pack compatibility package. > See the exm/hac_exm.gpr and test/hac_test.gpr project files > for the GNAT compiler. > > HAC is itself programmed in Ada. To build HAC for the command-line, > all you need (with GNAT) is to run "gprbuild -p -P hac". > Then you get the executable hax[.exe]. > The command "hax" alone will show you basic help. > > HAX: command-line compilation and execution for HAC (HAC Ada Compiler) > Compiler version: 0.06 dated 18-May-2020. > URL: https://hacadacompiler.sourceforge.io/ > > Usage: hax [options] main.adb [command-line parameters for main] > > Options: -h : this help > -v, v1 : verbose > -v2 : very verbose > -a : assembler output > -d : dump compiler information > > Enjoy > _________________________ > Gautier's Ada programming > http://gautiersblog.blogspot.com/search/label/Ada > NB: follow the above link for a valid e-mail address > __ > PS: The example (exm/file_copy.adb): > > with HAC_Pack; use HAC_Pack; > > procedure File_Copy is > s : VString; > f1, f2 : File_Type; > begin > Open (f1, "file_copy.adb"); > Create (f2, "file_copy.txt"); > while not End_Of_File (f1) loop > Get_Line (f1, s); > Put_Line (f2, s); > end loop; > Close (f1); > Close (f2); > end File_Copy; Nice Gautier regarding the possibility of copying text files. Is support for copying/reading/writing binary files in the works? Best regards, Joakim