Re: Looking for Modula2-to-C translator

sra@ecs.soton.ac.uk (Stephen Adams)
17 Oct 91 10:00:26 GMT

          From comp.compilers

Related articles
Looking for Modula2-to-C translator lth@cs.uoregon.edu (1991-10-14)
Re: Looking for Modula2-to-C translator derek@knosof.uucp (1991-10-15)
Re: Looking for Modula2-to-C translator sra@ecs.soton.ac.uk (1991-10-17)
Re: Looking for Modula2-to-C translator csgw@alpha.ru.ac.za (1991-10-21)
| List of all articles for this month |
Newsgroups: comp.compilers,comp.lang.modula2
From: sra@ecs.soton.ac.uk (Stephen Adams)
Keywords: modula, pascal, C
Organization: Southampton University Computer Science
References: 91-10-044
Date: 17 Oct 91 10:00:26 GMT

In article 91-10-044 lth@cs.uoregon.edu writes:


> We are in need of a free Modula2-to-C translator. Anything that runs under
> SunOS, Mt. Xinu, or HPUX is fine. Since the rest of the specs are fuzzy at
> the moment, everything and anything is acceptable, and pointers to where I
> might find such a beast would be most welcome.


p2c, the pascal-to-C translator, can handle Modula2 syntax.
I can't vouch for how good it is because I have only used it
for simple Pascal programs. The manual page claims:


          P2c is a tool for translating Pascal programs into C. The
          input consists of a set of source files in any of the fol-
          lowing Pascal dialects: HP Pascal, Turbo/UCSD Pascal, DEC
          VAX Pascal, Oregon Software Pascal/2, Macintosh Programmer's
          Workshop Pascal, Sun/Berkeley Pascal. Modula-2 syntax is
          also supported. Output is a set of .c and .h files that
          comprise an equivalent program in any of several dialects of
          C. Output code may be kept machine- and dialect-
          independent, or it may be targeted to a specific machine and
          compiler. Most reasonable Pascal programs are converted
          into fully functional C which will compile and run with no
          further modifications, although p2c sometimes chooses to
          generate readable code at the expense of absolute general-
          ity. P2c endeavors to insert notes and warning messages into
          the output code to point out areas which may require human
          intervention. Output code is arranged to be readable and
          efficient, and to make use of C idioms wherever possible.
          The main goal of the translation is to produce C files which
          are pleasant and "natural" enough to be acceptable as the
          new source files for a program. In a pinch, p2c will also
          serve as an ad hoc Pascal compiler.


I can't remember where I ftp-ed it from. One of my files
which contains this copyright:


"p2c" Copyright 1989 Dave Gillespie
                                              256-80 Caltech
                                              Pasadena CA 91125
                                              daveg@csvax.caltech.edu, cit-vax!daveg


so try csvax.cs.caltech.edu or shasta.scl.cwru.edu
--
Stephen Adams Email: S.R.Adams@ecs.soton.ac.uk
Electronics and Computer Science Tel: 0703 593649
University of Southampton Fax: 0703 593045
Southampton SO9 5NH, UK
--


Post a followup to this message

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