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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-22 07:12:04 PST Path: supernews.google.com!sn-xit-03!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Ira D. Baxter" Newsgroups: comp.lang.ada Subject: Re: Implementing C/C++ style #include... Date: Thu, 22 Mar 2001 09:13:55 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <98m938$2iod0$1@ID-25716.news.dfncis.de> <99alrr$itf$1@nh.pace.co.uk> X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Complaints-To: newsabuse@supernews.com Xref: supernews.google.com comp.lang.ada:5994 Date: 2001-03-22T09:13:55-06:00 List-Id: One can take advantage of dead code optimization to eliminate conditionally-compiled code. So you don't really need a preprocessor for that. There isn't any standard in Ada for conditional compilation of data declarations (or even pragmas!). This is probably enough to justify a preprocessor of some kind. Building one out of conventional tools such as YACC is probably pretty hard. You can certainly hack a simple one in PERL, if you want, by defining it to operate on lines that start with #, say. However, if you want one integrated with the Ada source, you could do that pretty easily by augmenting an Ada grammar with a few rules, and using a transformation engine such as our DMS Reengineering Toolkit (see http://www.semdesigns.com/Products/DMS/DMSToolkit.html). DMS can be obtained with an Ada grammar. Rewrite rules for simplifying boolean equations are pretty easy, as are rules that eliminate conditionals conditioned by TRUE or FALSE. Such rules coupled with boolean conditions would give an Ada preprocessor with only small effort. -- Ira D. Baxter, Ph.D. CTO Semantic Designs, Inc. http://www.semdesigns.com "Marin David Condic" wrote in message news:99alrr$itf$1@nh.pace.co.uk... > "bhazzard" wrote in message > news:OrZxgIisAHA.289@cpmsnbbsa09... > > A quick question... > > > > Is there any way to implement c/c++ style > > #ifdef pre-processor statements in Ada. > > > There is always a way. If you're willing to do the work yourself, you can > write a program to parse your Ada code to look for preprocessor directives & > output appropriate *new* Ada code before doing the compile. This is a lot of > work