Mail Archives: djgpp/1999/09/23/03:51:10
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 -