X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs Date: Thu, 23 Sep 1999 09:45:30 +0300 (WET) From: Andris Pavenis To: Clemens Valens 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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).