There is a pas2c. Is there a c2pas?

Karl Heuer karl at haddock.ima.isc.com
Mon Nov 27 12:47:02 AEST 1989


In article <4289 at helios.ee.lbl.gov> antony at lbl-csam.arpa (Antony A. Courtney) writes:
>I highly doubt there is or will ever be a C to Pascal converter.

It's certainly possible, since the two languages are TM-equivalent.

>Show me pointers to functions in Pascal ...

One way to emulate this feature would be to keep track of the functions whose
addresses are taken, and use an integer index instead:
	long (*pf)();   ==>   var pf: 0..MAX_INDEX;
	pf = &f;        ==>   pf := INDEX_CORRESPONDING_TO_F;
	r = (*pf)(i);   ==>   if pf = 0 then r := f(i) else ...
This isn't much worse than the cruft required to get sane string handling.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
(Language-specific followups should go to c.l.c or c.l.pascal as appropriate.
Default followups to c.l.misc.)



More information about the Comp.lang.c mailing list