----boundary-LibPST-iamunique-1048555821_-_-
Content-type: text/plain
-----Original Message-----
> From: blackbox{([at]})nowhere.xy
> Behalf Of Rex Couture
> Sent: Tuesday, 18 October 2005 2:58 AM
> To: BlackBox Mailing List
> Subject: [BlackBox] - Pascal to Component Pascal translator
>
>
> At 11:33 AM 10/17/2005, you wrote:
> >>Is anybody interested in using a Pascal to Component Pascal
> >>translator? I have a prototype written in Component Pascal which is
> >>working and seems to handle J&W / Standard Pascal programs
> reasonably
> >>well.
>
> Urk. It's a tower of Babel, unfortunately. I gave
> up even trying to convert my Borland Pascal library to
> Delphi, just for lack of time. Even at that I had to buy a
> whole package just to get a KeyPressed function. A Borland
> Pascal to BB would be very welcome, but Borland went so far
> beyond J&W that I can understand that it would be a major problem.
>
Agreed - I use Delphi every day and spend 90% of the time being
irritated by the syntax. After you've been spoilt by Modula-2 / Oberon-2
/ Component Pascal it is very difficult to go backwards.
> But it would definitely be welcome here. Legacy
> software is definitely THE major impediment to even
> considering a change in language.
>
That's good to hear!
> I would be VERY interested, however, in how you
> implemented I/O, since the BB library lacks basic READ and
> WRITE statements.
>
I suspect you might not be so interested when you find out ;-)
The translator only attempts to modify any 'non-controversial' parts of
the source code. It is designed to eliminate about 80%, say, of the
effort of a porting task. i.e. the tedious, repetitious, brainless
editing work that would otherwise be required.
It does not attempt to mess with anything that needs creative thought.
For example, non-zero based arrays are left untouched. A mechanical
translation was considered, but rejected, as although it is possible,
the result would be very inelegant. Similarly, Pascal Read and Write
statements are passed straight through, unmodified.
If you are porting a Pascal program with I/O scattered through it, it is
best to redesign it by creating an IO-specific module and just make
calls to that. It is then easier to maintain into the future and port to
other systems. The Pascal to Oberon Translator (P2O) itself was written
in that way, following the original work done on the Modula-2 to Oberon
Translator by Bernhard Treutwein.
Consequently P2O now runs on .NET (using the Gardens Point compiler) and
on Win32 (using BlackBox) with virtually all of the source code apart
from two very small modules, *identical* for both. The
framework-specific I/O calls are isolated to a separate system-specific
module. The GPCP version contains about a dozen statements and the BB
version contains just about twice that number.
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1048555821_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwICAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLVxw
YXINCj4gRnJvbTogYmxhY2tib3hAb2Jlcm9uLmNoIFttYWlsdG86YmxhY2tib3hAb2Jlcm9uLmNo
XSBPbiBccGFyDQo+IEJlaGFsZiBPZiBSZXggQ291dHVyZVxwYXINCj4gU2VudDogVHVlc2RheSwg
MTggT2N0b2JlciAyMDA1IDI6NTggQU1ccGFyDQo+IFRvOiBCbGFja0JveCBNYWlsaW5nIExpc3Rc
cGFyDQo+IFN1YmplY3Q6IFtCbGFja0JveF0gLSBQYXNjYWwgdG8gQ29tcG9uZW50IFBhc2NhbCB0
cmFuc2xhdG9yXHBhcg0KPiBccGFyDQo+IFxwYXINCj4gQXQgMTE6MzMgQU0gMTAvMTcvMjAwNSwg
eW91IHdyb3RlOlxwYXINCj4gPj5JcyBhbnlib2R5IGludGVyZXN0ZWQgaW4gdXNpbmcgYSBQYXNj
YWwgdG8gQ29tcG9uZW50IFBhc2NhbCBccGFyDQo+ID4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