delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/23/03:51:10

X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs
Date: Thu, 23 Sep 1999 09:45:30 +0300 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Clemens Valens <c DOT valensNOwkSPAM AT mindless DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Borland Pascal to C translator
In-Reply-To: <25d0e1ac.d7c5617f@usw-ex0107-056.remarq.com>
Message-ID: <Pine.A41.4.05.9909230942420.48716-100000@ieva01.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Wed, 22 Sep 1999, Clemens Valens wrote:

> I have tried PTOC not so long ago to convert PASCAL to C 
> and it seemed to do the job. I found however that the 
> generated C-code was a kind of unreadable, so I translated 
> my PASCAL sources myself, using almost only search 'n' 
> replace operations:
> 
> first replace all comments! 
> "{", "(*" => "/*" 
> "}", "*)" => "*/"
> "begin" => "{"
> "end;" => "}"
> "if " => "if ("
> " then" => ") {"
> "while " => "while ("
> " do" => ") {"
> many for-next loops can often be replaced in one go, if you 
> were consequent in your indices.
> 
> Be very careful with logical operations (and, or, etc)!
> 
> If your source is not too large, this method, although 
> stupid, might be preferable.
> 

I would prefer using GPC (It's of course not compiles from Pascal to C but
anyway) for such Pascal programs. I included GPC 19990118 beta version
when released DJGPP port of egcs-1.1.2 (see directory v2gnu/egcs in 
DJGPP distribution).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019