Usenet comp.os.linux.announce (1993-2013)
 help / color / mirror / Atom feed
From: Constantine Knizhnik <knizhnik@cecmow.enet.dec.com>
Subject: New Pascal to C/C++ converter
Date: 1997/01/21	[thread overview]
Message-ID: <pgpmoose.199701211756.27657@liw.clinet.fi> (raw)


-----BEGIN PGP SIGNED MESSAGE-----

Hello,

I like to announce yet another Pascal to C/C++ converter. 
The primary idea of this converter is to produce readable and
supportable code 
which preserves style of original sources as far as possible. 

Converter recognizes Pascal dialects which are compatible with new ISO 
Pascal standard - IEC 7185:1990(E) (including conformant arrays).
Now it is tuned for Oregon Pascal-2 V2.1 which has few extensions to
standard 
Pascal.

Converter can produce both C++ and C output. Using of C++ language
allows 
to encapsulate some Pascal types and constructions into C++ classes.
So mapping between Pascal and C++ becomes more direct 
then between Pascal and C. We use C++ templates to implement pascal
arrays 
and files. Special template classes are used for conformant arrays. 
C++ like streams are used to implement Pascal IO routines. 
There is single runtime library for C and C++ code.   

The main differences from existed p2c converter are:

	1. Original style is preserved.
	2. Conversion to C++ is possible. 
	3. Converter do not insert in sources any explicit constants 
	   (such as array's size) making support of converted code more easier.
	4. Local variables of exterior functions accessed by nested functions
	   are replaced with C static variables whenever possible. This
	   significantly increase readability of produced code.
	5. Converter checks a lot of possible bugs caused by differences 
	   of architectures (size of integer, pointers, alignment).
	6. Converter itself is written using OO approach and can be easily 
	   modified.

This converter was used in project of portation of manufacturing
management 
system from Pascal-2/RSX to C/OpenVMS. There are more than 100.000 lines 
in Pascal which were converted to C with minimum manual changes. 
Directory "vms" contains VMS specific versions of pascal runtime 
library emulation module "io.c".   

Sources of converter together with executables for Linux are available
at
http://www.ras.ru/moshkow/html-KOI/SOFTWARE/

PTOC is distributed in the hope that it will be useful.
Your are free to use this converter, modify the sources 
and do with this converter everything else you want. 
Also feel free to ask any questions about the converter. 

Constantine Knizhnik
knizhnik@cecmow.enet.dec.com

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBMuTm6oQRll5MupLRAQHFmgP8CKATWVB3Mt1rtzfK7POL2BQS1MWUU8f+
PIRDAFvbqzID2/gKZSMjJSAEiCc9OBUrtvS1kkkbPdHwqzGX9X1XP2MtTE48j9nf
Ahi5XhKk1RrLW7sQEuexgBvdHo0v3UatzqxUzcx4DDc7Fm5djModReIe+clBvHdf
eIT5DmWIAe4=
=5mXw
-----END PGP SIGNATURE-----

-- 
This article has been digitally signed by the moderator, using PGP.
http://www.iki.fi/liw/lars-public-key.asc has PGP key for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember a short description of the software and the LOCATION.
This group is archived at http://www.iki.fi/liw/linux/cola.html



                 reply	other threads:[~1997-01-21  5:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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