|Source to source Translation ? Waverly@DigitSW.com (Waverly Edwards) (1997-01-30)|
|Re: Source to source Translation ? email@example.com (1997-02-02)|
|Re: Source to source Translation ? firstname.lastname@example.org (1997-02-02)|
|From:||email@example.com (Derek M Jones)|
|Date:||2 Feb 1997 21:23:08 -0500|
|Organization:||Knowledge Software Ltd|
|Keywords:||C, Pascal, translator, comment|
Waverly@DigitSW.com "Waverly Edwards" writes:
> Could any point me to some source code for translating C to Pascal.
> I have just a few requirements.
> 1. It be commented or narrated pretty well
> 2. It not be someones PH.D thesis model
> (If it is, its likely to be way over my head)
Ok. So it does not have to be free. Check out our web pages for
> I think my biggest problem is going to be pointer arithmetic and the
> translation of operator precedence. I dont know if I these obstacles
> can be overcome.
Actually these are 'easy' problems to solve.
> My overall goal is not only to translate C to Pascal but to:
Our goals changed over time (customer driven). Check out
www.knosof.co.uk/ctoa.html for some history.
> [Operator precedence is easy -- build an expression tree, walk over it to
> emit Pascal, and stick in parentheses when you find a lower precedence
> expression inside a higher precedence one. Pointers are harder, since there's
> a lot of wild 'n' crazy things you can do in C that you can't do in Pascal
> without gross implementation-dependent hackery. Take a look at p2c, which
> goes the other way and does a decent job of putting out readable source code.
> The hard part isn't generating valid output code, it's generating code that
> doesn't look like decompiled assembler. -John]
Our Moderator knew about p2c but not about CtoP :-(
Derek M Jones tel: +44 (0) 1252 520 667
Knowledge Software Ltd email: firstname.lastname@example.org
Applications Standards Conformance Testing http://www.knosof.co.uk
[Harumph, nobody tells me nothin'. -John]
Return to the
Search the comp.compilers archives again.