Complete.Org: Mailing Lists: Archives: discussion: March 1999:
RE: [aclug-L] Pascal compiler
Home

RE: [aclug-L] Pascal compiler

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "'aclug-L@xxxxxxxxxxxx'" <aclug-L@xxxxxxxxxxxx>
Subject: RE: [aclug-L] Pascal compiler
From: "Bates, Rod" <Rod.Bates@xxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Mar 1999 08:55:01 -0600
Reply-to: aclug-L@xxxxxxxxxxxx

> > Jesse Kaufman <kaufmjes@xxxxxxxxxxxxxxxxx> writes:
> 
> kewl, i'll try the first one...  p2c isn't what i need, because i'm in a
> pascal
> class, and need to do everything via pascal...  picky profs!!  : ^ )
> 
> 
I'd like to point out that you can use a language-to-language translator
like p2c, in conjunction with a C compiler as a Pascal compiler.  
Just develop and maintain your source code in Pascal.  Each "compile"
is really two steps: 1) translate to C 2) compile the C, using a C compiler.
You can delete the C code immediately after, and no one will know.  

It's a bit unwieldy, but not really a problem once you write a script or
makefile to run through the steps.  

It may make sense if the translator handles a dialect you need, and an 
alternative compiler is not free, not available, etc.  I have used this
system
for years for Modula-2, on a machine where I could not get a Modula-2
compiler, but a M2 to C translator and a C compiler were available. 

The translator doesn't check that the input is correct Modula-2, which is
another function of a compiler, besides translation, that you really need.  
However, I also could get free source for a Modula-2 compiler which checks 
correctness, but generates code for a different machine!

So, I run the source code through the compiler to check for errors, if none,
run the same source through the M2 to C translator, then run the output
of that through a C compiler.  Makefiles do it all, so now the only
disadvantage is a little slower process.  Even then, gcc takes more time
than the other 2 steps combined.

I don't know if p2c checks for legal or Pascal or not.  If so, it and a C
compiler would be enough.   

You could also use a translator to translate one time to C and maintain
in C, but that is a different strategy entirely.  Sounds like this is what
you were thinking of. 

Rodney Bates  
---
This is the Air Capital Linux Users Group discussion list.  If you
want to unsubscribe, send the word "unsubscribe" to
aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
message to aclug-L@xxxxxxxxxxxx.



[Prev in Thread] Current Thread [Next in Thread]