Re: Is there a good Pascal to C++ Translator?

journeyman@compilerguru.com (journeyman)
13 Apr 2002 23:07:53 -0400

          From comp.compilers

Related articles
Is there a good Pascal to C++ Translator? s.c.siegel@web.de (2002-03-31)
Re: Is there a good Pascal to C++ Translator? bear@sonic.net (Ray Dillinger) (2002-04-06)
Re: Is there a good Pascal to C++ Translator? journeyman@compilerguru.com (2002-04-06)
Re: Is there a good Pascal to C++ Translator? s.c.siegel@web.de (2002-04-10)
Re: Is there a good Pascal to C++ Translator? rhyde@cs.ucr.edu (Randall Hyde) (2002-04-10)
Re: Is there a good Pascal to C++ Translator? journeyman@compilerguru.com (2002-04-13)
Re: Is there a good Pascal to C++ Translator? marcov@toad.stack.nl (Marco van de Voort) (2002-04-16)
| List of all articles for this month |
From: journeyman@compilerguru.com (journeyman)
Newsgroups: comp.compilers
Date: 13 Apr 2002 23:07:53 -0400
Organization: Giganews.Com - Premium News Outsourcing
References: 02-03-185 02-04-045 02-04-064
Keywords: Pascal, C++, translator
Posted-Date: 13 Apr 2002 23:07:53 EDT

On 10 Apr 2002 00:16:48 -0400, Jascha <s.c.siegel@web.de> wrote:
>
>Thank you for your answers. I use Borland Turbo Pascal 7.0 and the
>Program is about 31 files(about 7000 lines of source) and 51
>Include-files. But its only a test Programm. The whole project is
>about 150000 lines of source. And i don`t want change to much from the
>source.


For 7 kLines, I'd say just rewrite the thing in the idioms of the
target language, but obviously 150 kLines is a bit too big too big to
casually rewrite, so you're pretty much left with something that does
most of what you want, with a little manual tweaking required.


I'm not familiar with (recent versions of) Turbo Pacal, but if it has
a decent symbol table dump option (including source line numbers), you
might be able to write a Perl or Emacs Lisp script to massage the
dump, then use the output to write a script to edit your source code
disambiguating the overloaded symbols. It usually helps if your
script language supports regular expression pattern matching.


I've done stuff like this before on about that scale. You can get a
lot of mileage writing a script to generate an edit script. Wound up
with a meta-meta-script a couple of times. :-)


Make a backup copy first (of course). First attempt is likely to
expose some bugs in your script. :-)


Morris (just a Regular guy)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.