comp.lang.ada
 help / color / mirror / Atom feed
From: steved@pacifier.com@199.2.117.163  (Steve Doiel)
Subject: Re: Pascal to Ada translator/ aflex,ayacc GNAT ports
Date: 1996/11/28
Date: 1996-11-28T00:00:00+00:00	[thread overview]
Message-ID: <57j17b$6pt@news.pacifier.com> (raw)
In-Reply-To: 57i8af$p8m@felix.seas.gwu.edu


In Michael Feldman writes:
>In article <57htn2$jm8@cnn.Princeton.EDU>,
>Martin C. Carlisle <mcc@tyrolia.cs.princeton.edu> wrote:
>>I have just completed a preliminary version of a pascal to ada
>>translator (some features like "with" aren't handled) using aflex
>>and ayacc.  It is publicly available at:
>
>This looks like it has a lot of real potential as a valuable tool.
>What _does_ it do with a Pascal "with"? Maybe it should mark such
>lines in an obvious way for hand-tweaking?
>
>Expanding a Pascal "with" into full field-selection looks intuitively 
>similar to the "use" expansion some Ada tools can do.
>
My $0.02 worth:

In working with a Pascal to Ada translator from Wiljan Derks.  I believe I have
learned a few things about what makes a for a good translation.  One of which
is to make the translated code look very much like the original code.

Wiljan originally had the code explicitly qualify all references to fields that
were brought into scope using the "with".  I found the generated code to be
hard to read, so I modified the generation to generate the following translation:

with complex.expression[ witharrayindex ] do
  begin
    field1 := value;
  end;

.. maps to ...

declare
  w_0 : aRecordType renames complex.expression[ witharrayindex ];
begin
  w_0.field1 := value;
end;

Which makes the translated code look very much like the original IMHO.

>
>In any event, good luck with this! Keep up the good work!
>
>Mike Feldman





  reply	other threads:[~1996-11-28  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-27  0:00 Pascal to Ada translator/ aflex,ayacc GNAT ports Martin C. Carlisle
1996-11-27  0:00 ` Michael Feldman
1996-11-28  0:00   ` steved [this message]
1996-11-29  0:00     ` Robert Dewar
1996-11-29  0:00       ` wiljan
1996-11-29  0:00         ` Robert Dewar
1996-11-30  0:00           ` wiljan
1996-11-30  0:00             ` Robert Dewar
1996-12-01  0:00               ` wiljan
1996-12-01  0:00                 ` Michael Feldman
1996-12-01  0:00                 ` Robert Dewar
1996-12-02  0:00           ` Laurent Gasser
1996-12-02  0:00             ` Jacques Rouillard
1996-12-02  0:00             ` Larry Kilgallen
1996-11-29  0:00       ` Larry Kilgallen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox