Pascal to C (and vice versa)

Floyd McWilliams acu at mentor.cc.purdue.edu
Tue Oct 24 06:52:47 AEST 1989


In article <5164 at uhccux.uhcc.hawaii.edu> dillon at uhccux.uhcc.hawaii.edu
  (Ian Dillon) writes:
>I'm sure this has been asked many times but please bare with me.

	What is this, comp.lang.c.nudists?
	(I know, I know, spelling flames are verboten -- just couldn't
resist. :-))

>I'm looking for a Pascal to C (and  back again) conversion program.  If
>you have experience with one or both of these programs, please e-mail
>the account listed below, rather than cluttering up the Internet.

	I'd like to see how a C-to-Pascal conversion program would handle this:

	int	i, *pi;

	pi = &i;

	Or this:

	int	*A;

	A = (int *) malloc((unsigned) (sizeof(int) * 20));
	A[10] = 5;

	Or, for that matter, how a Pascal-to-C converter would take:

	var
	  X : set of char;

	X := ['a','b','c'];
	if 'a' in X then
	  X := X + 'A'
	else
	  X := X * ['b','c'];


	Now I know all these conversions CAN be done (since C and Pascal
are Turing-equivalent).  But can they be done by currently available
programs?  Do C-to-Pascal and Pascal-to-C converters exist?  Do they
work only on small, non-offensive subsets of either language?
	
>P.S.  Should you know of a similar Fortran to C package as well, please
>      let me know.

	Fortran-to-C does exist, although I don't know any details.

--
"You have angered the great Chac-mool.  You will burn in the fiery pits
 of eternal damnation.  That is all."
Floyd McWilliams			mentor.cc.purdue.edu!acu



More information about the Comp.lang.c mailing list