-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPAS2C.DOC
More file actions
31 lines (26 loc) · 1.17 KB
/
PAS2C.DOC
File metadata and controls
31 lines (26 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
PAS2C - A Pascal to C Translator
================================
In early '89, I was faced with the daunting prospect of converting a compiler
written in TurboPascal (about 8000 lines) into C. I felt that the best
way to do this would be to automate the process. The result of this is PAS2C.
This system was never completed - I wrote as much as was necessary to get
my 8000 lines translated. The main problem area is the symbol table - in
order to convert Pascal properly, you need a full blown Pascal parser
and symbol table. At the time I wasn't bothered with going that far
(I only had two weeks). As a result, the program can do weird things
when presented with such nasties as pointers to arrays of records, etc.
However, it does write a log file with messages for every construct that
it didn't handle completely (this includes expressions where Pascal
operators have a different precedence to C operators). I have also
found it to be better than a `commercial' program that purports to do
the same.
Graham Wheeler (Gram)
26 June 1990
Department of Computer Science
University of Cape Town
Private Bag
Rondebosch
Cape Town
7700
South Africa
E-Mail: gram.uctcs@f4.n494.z5.fidonet.org