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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.14.100 with SMTP id c64mr224480yhc.38.1392140934133; Tue, 11 Feb 2014 09:48:54 -0800 (PST) X-Received: by 10.182.103.195 with SMTP id fy3mr278720obb.1.1392140933975; Tue, 11 Feb 2014 09:48:53 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!k15no17446443qaq.0!news-out.google.com!vg8ni31igb.0!nntp.google.com!uq10no16248004igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 11 Feb 2014 09:48:53 -0800 (PST) In-Reply-To: <85zjm2yorr.fsf@stephe-leake.org> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=163.116.6.12; posting-account=hya6vwoAAADTA0O27Aq3u6Su3lQKpSMz NNTP-Posting-Host: 163.116.6.12 References: <5a341bef-ace4-468c-b5b6-55d46868d802@googlegroups.com> <85zjm2yorr.fsf@stephe-leake.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8f4037b8-ed00-4a98-8096-e18e507e7cbb@googlegroups.com> Subject: Re: Tools Generating Ada From: Vincent DIEMUNSCH Injection-Date: Tue, 11 Feb 2014 17:48:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 7426 X-Received-Body-CRC: 559751618 Xref: news.eternal-september.org comp.lang.ada:18484 Date: 2014-02-11T09:48:53-08:00 List-Id: On Saturday, February 8, 2014 9:47:20 AM UTC+1, Stephen Leake wrote: > Vincent writes: >=20 >=20 >=20 > > Hello everybody, >=20 > > >=20 > > I have a question regarding Ada Code Generation tools, like Aflex / >=20 > > Ayacc for instance. How can I insert them into the automatic build >=20 > > process ?=20 >=20 >=20 >=20 > Yes; you have to write an XML file to tell gprbuild about the tool. >=20 >=20 >=20 > I did this for Auto_Text_IO, which produces *.Text_IO packages from Ada >=20 > packages. >=20 >=20 >=20 > The process is not well documented, and the XML file often needs >=20 > tweaking with new releases of the GNAT compiler; I submit a bug report >=20 > to find out how to tweak. I don't recommend doing this without an >=20 > AdaCore support contract. Unless you have read and understand all of the >=20 > gprbuild source :). >=20 >=20 >=20 > >I use GNAT=A0GPL, so is it possible to create a GPRBuild >=20 > > project that generates Ada files from an AYacc source and then compile >=20 > > the Ada sources ?=20 >=20 >=20 >=20 > That takes two projects, to keep the source information distinct. >=20 >=20 >=20 > >Do I need to use a make file ?=20 >=20 >=20 >=20 > No, the project that compiles the Ada code can 'with' the project that >=20 > produces the Ada code. >=20 >=20 >=20 > However, gprbuild doesn't always get the dependencies right; sometimes >=20 > you have to run it twice. >=20 >=20 >=20 > >Where can I find >=20 > > examples ? >=20 >=20 >=20 > Here. This works with GNAT 7.1.2, and probably with GPL 2013: >=20 >=20 >=20 > with "sal_text_io"; >=20 > project Common_Text_IO is >=20 > for Languages use ("Auto_Text_IO"); >=20 >=20 >=20 > for Source_Dirs use >=20 > ("../1553", >=20 > "../base", >=20 > "../base/test", >=20 > "../models", >=20 > "../../opentoken"); >=20 > for Object_Dir use "auto"; >=20 > for Source_Files use >=20 > ("gds-hardware-bus_1553-time_tone.ads", >=20 > "gds-unconstrained_arrays.ads", >=20 > "simple_flight-rwa.ads", >=20 > "simple_flight-safehold_css.ads"); >=20 >=20 >=20 > package Compiler is >=20 > for Default_Switches ("Auto_Text_IO") use ("-05"); >=20 > end Compiler; >=20 > end Common_Text_IO; >=20 >=20 >=20 >=20 >=20 > with "opentoken"; >=20 > with "sal"; >=20 > with "standard_common"; >=20 > with "../common_text_io"; >=20 > project GDS is >=20 >=20 >=20 > for Source_Dirs use >=20 > ("../auto", >=20 > "../../1553", >=20 > "../../asist_if", >=20 > "../../base", >=20 > "../../fpga", >=20 > "../../hardware", >=20 > "../../itos_if", >=20 > "../../models", >=20 > "../../models/sofa", >=20 > "../../spacewire", >=20 > "../../system", >=20 > "../../windows"); >=20 >=20 >=20 > for Object_Dir use "objects"; >=20 > for Exec_Dir use "."; >=20 >=20 >=20 > for Languages use ("Ada", "C"); >=20 >=20 >=20 > package Compiler is >=20 > for Default_Switches ("Ada") use >=20 > Standard_Common.Compiler.Release_Switches & >=20 > Standard_Common.Compiler.Style_Checks & >=20 > Standard_Common.Compiler'Default_Switches ("Ada"); >=20 >=20 >=20 > for Local_Configuration_Pragmas use "../gnat_config_pragmas.adc"; >=20 >=20 >=20 > for Default_Switches ("C") use Standard_Common.Compiler.Release_Swi= tches_C; >=20 >=20 >=20 > end Compiler; >=20 >=20 >=20 > package Binder is >=20 > for Default_Switches ("Ada") use Standard_Common.Binder'Default_Swi= tches ("Ada"); >=20 > end Binder; >=20 >=20 >=20 > package Builder is >=20 > for Default_Switches ("Ada") use Standard_Common.Builder'Default_Sw= itches ("Ada"); >=20 >=20 >=20 > -- We use ".exe" extension even on non-Windows, to simplify the ma= kefiles. >=20 > for Executable_Suffix use ".exe"; >=20 > end Builder; >=20 >=20 >=20 > end GDS; >=20 >=20 >=20 > ---- auto_text_io.xml ----- >=20 > >=20 > >=20 > >=20 > >=20 > Auto_Text_IO >=20 > auto_text_io.exe >=20 > Auto_Text_IO >=20 > >=20 > auto_text_io.exe -? >=20 > >=20 > >=20 > >=20 > >=20 > ${PREFIX}gcc -dumpmachine >=20 > >=20 > >=20 > >=20 >=20 >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > package Compiler is >=20 > for Driver ("Auto_Text_IO") use "${PATH(auto_text_io)}auto_text_io.= exe"; >=20 > for Include_Path ("Auto_Text_IO") use "ADA_INCLUDE_PATH"; >=20 > for Required_Switches ("Auto_Text_IO") use ("-f"); >=20 > for Dependency_Switches ("Auto_Text_IO") use ("-M"); >=20 > end Compiler; >=20 > package Naming is >=20 > for Body_Suffix ("Auto_Text_IO") use ".ads"; >=20 > end Naming; >=20 > for Inherit_Source_Path ("Auto_Text_IO") use ("Ada"); >=20 > for Object_Generated ("Auto_Text_IO") use "false"; >=20 > >=20 > >=20 > >=20 >=20 >=20 >=20 >=20 >=20 >=20 > --=20 >=20 > -- Stephe Thank you very much for your complete response ! I'll try this, maybe with the help of AdaCore's support. By the way, does GPRBuild creates "ali" files for an external tool ? If not, then how can it knows what the dependencies ares ? Does your tool creates an ali file ? Kind regards, Vincent