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: 103376,21a8034919747a69 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 11 Feb 2007 20:29:57 +0100 From: Gautier User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Splitting packages in per-procedure separate files References: <2007021017501616807-sjs@essexacuk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.77.151.95 X-Original-NNTP-Posting-Host: 83.77.151.95 Message-ID: <45cf6ecd$1_4@news.bluewin.ch> X-Trace: news.bluewin.ch 1171222221 83.77.151.95 (11 Feb 2007 20:30:21 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:9262 Date: 2007-02-11T20:29:57+01:00 List-Id: Francesco Bochicchio: > Maybe the term program was misleading. What I have is an > application consisting of a dozen different packages. Now the standard > mandates: > > - one name_package.ads for package public declarations > - one name_package.adb for package private declarations (including > separate declarations for all procedures) > - one name_package-name_procedure.adb for each procedure in the package > > Some of the coders have actually followed the standards, some have not, > putting all the procedure code inside the name_package.adb file. Now I > have to split these files ( about half of the packages, so probably 10000 > line of codes, not the 20000 initially stated ). > > This could be done by hand in at most a (very boring) week (but I'd say > three days could be enough), so I can't spend too much effort in > automating this task, except for: > a) preparing for future similar activities > b) having sligtly more fun. > > Thanks to all the posters that answered. > > Ciao > ------ > FB At least the task of putting your separate procedures into files can be done automatically by GNAT. Say I modify (manually or automatically) a package to meet the standard you mention (modifications with "**"): --8<-----------8<-----------8<---sep.txt-8<--------- package A is procedure B1; procedure B2; end A; package body A is procedure B1 is separate; -- ** line added ** procedure B2 is separate; -- ** line added ** end A; -- ** line added ** separate(A) -- ** line added ** procedure B1 is begin null; end B1; separate(A) -- ** line added ** procedure B2 is begin null; end B2; -- end A; -- ** line commented out ** --8<-----------8<-----------8<-----------8<--------- Then gnatchop will do the following: gnatchop sep.txt splitting sep.txt into: a.ads a.adb a~b1.adb a~b2.adb Then, you just need to rename your files with '-' instead of '~'. HTH ______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!