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=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 Path: g2news2.google.com!news3.google.com!news4.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Splitting packages in per-procedure separate files Date: Sat, 10 Feb 2007 18:49:22 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1171133368 17363 62.49.19.209 (10 Feb 2007 18:49:28 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 10 Feb 2007 18:49:28 +0000 (UTC) Cancel-Lock: sha1:KbwIP3q1YMztmhVX9tm9vkG1X90= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:9234 Date: 2007-02-10T18:49:22+00:00 List-Id: Francesco Bochicchio writes: > due to coding standards which were not enforced when someone else > coded, I now have to split the packages of a 20000 LOC ADA program, > putting a single procedure per file (using the separate clause). > > While this is not a very big work. it would be nice t find some tool > to help in this task. > > Alternatively, I was tinking to prepare some script myself (Python + > some parser library ). In this case, it would help to have ADA > grammar rules written in yacc-style or similar. This could also be > useful in similar situation in the future. You might consider an ASIS-based tool. I had thought that Adalog (http://www.adalog.fr/) might have already done it, but it seems not (worth a look, though; AdaSubst is the tool I was thinking of). There are (at least) 2 implementations of ASIS -> XML tools. I would recommend my own (http://gnat-asis.sourceforge.net/pmwiki.php/Main/ASIS2XML) but you probably want to retain comments, so you might find Marc Criley's (http://www.mckae.com/avatox.html) more appropriate. Marc says "Given that the Avatox XML representation of the source code comprehensively represents the content and layout of the source code, there's nothing stopping one from developing a utility to reconstitute the Ada source from the XML. "Given that, XSLT transformations become available to modify the Avatox XML to produce a modified version of the original program." and of course you need a good grasp of XSLT (probably) and a fair amount of enthusiasm to contemplate doing the first part!