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 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!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Tools Generating Ada References: <5a341bef-ace4-468c-b5b6-55d46868d802@googlegroups.com> Date: Sat, 08 Feb 2014 02:47:20 -0600 Message-ID: <85zjm2yorr.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) Cancel-Lock: sha1:mDY8j3+3kS0KF5GX/biM6lRJjJ8= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 9ef5c52f5ef1ceef2f4a317538 X-Received-Bytes: 5197 X-Received-Body-CRC: 209794087 Xref: news.eternal-september.org comp.lang.ada:18439 Date: 2014-02-08T02:47:20-06:00 List-Id: vincent.diemunsch@gmail.com writes: > Hello everybody, > > I have a question regarding Ada Code Generation tools, like Aflex / > Ayacc for instance. How can I insert them into the automatic build > process ? Yes; you have to write an XML file to tell gprbuild about the tool. I did this for Auto_Text_IO, which produces *.Text_IO packages from Ada packages. The process is not well documented, and the XML file often needs tweaking with new releases of the GNAT compiler; I submit a bug report to find out how to tweak. I don't recommend doing this without an AdaCore support contract. Unless you have read and understand all of the gprbuild source :). >I use GNAT GPL, so is it possible to create a GPRBuild > project that generates Ada files from an AYacc source and then compile > the Ada sources ? That takes two projects, to keep the source information distinct. >Do I need to use a make file ? No, the project that compiles the Ada code can 'with' the project that produces the Ada code. However, gprbuild doesn't always get the dependencies right; sometimes you have to run it twice. >Where can I find > examples ? Here. This works with GNAT 7.1.2, and probably with GPL 2013: with "sal_text_io"; project Common_Text_IO is for Languages use ("Auto_Text_IO"); for Source_Dirs use ("../1553", "../base", "../base/test", "../models", "../../opentoken"); for Object_Dir use "auto"; for Source_Files use ("gds-hardware-bus_1553-time_tone.ads", "gds-unconstrained_arrays.ads", "simple_flight-rwa.ads", "simple_flight-safehold_css.ads"); package Compiler is for Default_Switches ("Auto_Text_IO") use ("-05"); end Compiler; end Common_Text_IO; with "opentoken"; with "sal"; with "standard_common"; with "../common_text_io"; project GDS is for Source_Dirs use ("../auto", "../../1553", "../../asist_if", "../../base", "../../fpga", "../../hardware", "../../itos_if", "../../models", "../../models/sofa", "../../spacewire", "../../system", "../../windows"); for Object_Dir use "objects"; for Exec_Dir use "."; for Languages use ("Ada", "C"); package Compiler is for Default_Switches ("Ada") use Standard_Common.Compiler.Release_Switches & Standard_Common.Compiler.Style_Checks & Standard_Common.Compiler'Default_Switches ("Ada"); for Local_Configuration_Pragmas use "../gnat_config_pragmas.adc"; for Default_Switches ("C") use Standard_Common.Compiler.Release_Switches_C; end Compiler; package Binder is for Default_Switches ("Ada") use Standard_Common.Binder'Default_Switches ("Ada"); end Binder; package Builder is for Default_Switches ("Ada") use Standard_Common.Builder'Default_Switches ("Ada"); -- We use ".exe" extension even on non-Windows, to simplify the makefiles. for Executable_Suffix use ".exe"; end Builder; end GDS; ---- auto_text_io.xml ----- Auto_Text_IO auto_text_io.exe Auto_Text_IO auto_text_io.exe -? ${PREFIX}gcc -dumpmachine package Compiler is for Driver ("Auto_Text_IO") use "${PATH(auto_text_io)}auto_text_io.exe"; for Include_Path ("Auto_Text_IO") use "ADA_INCLUDE_PATH"; for Required_Switches ("Auto_Text_IO") use ("-f"); for Dependency_Switches ("Auto_Text_IO") use ("-M"); end Compiler; package Naming is for Body_Suffix ("Auto_Text_IO") use ".ads"; end Naming; for Inherit_Source_Path ("Auto_Text_IO") use ("Ada"); for Object_Generated ("Auto_Text_IO") use "false"; -- -- Stephe