From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,24f079913f8284fa,start X-Google-Attributes: gid10d4db,public From: Constantine Knizhnik Subject: New Pascal to C/C++ converter Date: 1997/01/21 Message-ID: #1/1 X-Deja-AN: 211469808 x-original-date: Mon, 20 Jan 1997 20:39:05 +0300 x-server-date: 21 Jan 1997 15:56:49 GMT followup-to: comp.os.linux.development.apps organization: Digital Equipment Corporation, Palo Alto, CA, USA x-auth: PGPMoose V1.1 PGP comp.os.linux.announce newsgroups: comp.os.linux.announce -----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