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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ea40456edaea3d23 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Pascal to Ada translator/ aflex,ayacc GNAT ports Date: 1996/11/30 Message-ID: #1/1 X-Deja-AN: 201574082 references: <57htn2$jm8@cnn.Princeton.EDU> <57i8af$p8m@felix.seas.gwu.edu> <57j17b$6pt@news.pacifier.com> <01bbde30$7a63d4e0$11208b82@wd> <01bbde93$a09ea190$0d208b82@wd> organization: New York University newsgroups: comp.lang.ada Date: 1996-11-30T00:00:00+00:00 List-Id: Wiljan says "I think that when one has: type rec=record a,b:integer end; var x:rec; .... with x do a:=3; is best translated to x.a:=3; With a rename it whould look like: x1:rec renames x; x1.a:=3; Note that when translating to an Ada renaming one must add extra names which also does not attribute to clear code." Yes that is certainly reasonable. Of course a translator that is this clever in terms of making aesthetic judgments about best translations is an unlikely beast. Sure, this one case could be handled, but to be this accurate in producing "best translations" throughout -- that's hard. Note that in this case, the renames translation is indeed clunky, but then the original Pascal is also clunky, I certainly never saw any Pascal where someone would use a with for a single statement. Obviously the appropriate Pascal in this case is: x.a := 3; Just how much effort do you expect an automatic translator to spend in taking junk badly written Pascal and turning it into nice Ada?