Re: Source to source Translation ?

derek@knosof.co.uk (Derek M Jones)
2 Feb 1997 21:23:08 -0500

          From comp.compilers

Related articles
Source to source Translation ? Waverly@DigitSW.com (Waverly Edwards) (1997-01-30)
Re: Source to source Translation ? bsheff@ix.netcom.com (1997-02-02)
Re: Source to source Translation ? derek@knosof.co.uk (1997-02-02)
| List of all articles for this month |
From: derek@knosof.co.uk (Derek M Jones)
Newsgroups: comp.compilers
Date: 2 Feb 1997 21:23:08 -0500
Organization: Knowledge Software Ltd
References: 97-01-243
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
details.


> 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


--
Derek M Jones tel: +44 (0) 1252 520 667
Knowledge Software Ltd email: derek@knosof.co.uk
Applications Standards Conformance Testing http://www.knosof.co.uk
[Harumph, nobody tells me nothin'. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.