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,d3037f71d9d26da1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-15 16:40:40 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newsfeed.esat.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!news.task.gda.pl!opal.futuro.pl!newsfeed.gazeta.pl!news.man.poznan.pl!pwr.wroc.pl!panorama.wcss.wroc.pl!hebisch From: hebisch@math.uni.wroc.pl (Waldek Hebisch) Newsgroups: comp.lang.ada Subject: Re: sed and perl - yuck [Was Re: Preprocessor functionality equivalent ideas needed] Date: 16 Dec 2003 00:40:42 GMT Organization: Politechnika Wroclawska Message-ID: References: <1255206.8rsULcRV6F@linux1.krischik.com> NNTP-Posting-Host: hera.math.uni.wroc.pl X-Trace: panorama.wcss.wroc.pl 1071535242 17457 156.17.86.1 (16 Dec 2003 00:40:42 GMT) X-Complaints-To: abuse@news.pwr.wroc.pl NNTP-Posting-Date: 16 Dec 2003 00:40:42 GMT X-Newsreader: TIN [version 1.2 PL2] Xref: archiver1.google.com comp.lang.ada:3477 Date: 2003-12-16T00:40:42+00:00 List-Id: Martin Krischik (krischik@users.sourceforge.net) wrote: : Ludovic Brenta wrote: : > Another approach could be to simulate a preprocessor with sed or perl : > scripts. : Did that, hated it and wrote AdaCL. If you rather use Ada then perl and find : find sed cumbersome you should look at AdaCL. : If you disagree: Write a sed line which inserst "OS." bevore every : CD_Recorder - but only if it is not allready there. Well, if you have unused chars (say ';' and '#') the task is easy: s/CD_Recorder/;CD_Recorder/g s/OS\.;/OS.#/ s/;CD_Recorder/OS.CD_Recorder/g s/[;#]//g If all chars are used one have to quote first: s/./:&/g s/:C:D:_:R:e:c:o:r:d:e:r/;::C:D:_:R:e:c:o:r:d:e:r/g s/:O:S:\.;:/:O:S:.;#/g s/;::C:D:_:R:e:c:o:r:d:e:r/:O:S:.:C:D:_:R:e:c:o:r:d:e:r/g s/;#:/:/g s/.\(.\)/\1/g I have not put them on sigle line for readability. The above is slightly off-topic, but I think it ilustrates nicely that a sequence of simple steps can give result looking quite different then a single step. In that spirit Ada discourages preprocessors (since complexity grows quite a lot). -- Waldek Hebisch hebisch@math.uni.wroc.pl