|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 2297 (0x8f9) Types: TextFile Names: »p2c.doc«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─⟦this⟧ »EUUGD11/euug-87hel/sec1/p2c/p2c.doc«
NAME p2c - Pascal to C translator SYNOPSIS p2c < foo.pas > foo.c DESCRIPTION p2c converts many Pascal structures to their C equivalent. The Pascal source can be in upper, lower, or mixed case; case is preserved during translation. Structures translated properly include simple assignment and comparison statments, variable, type, and label declarations, enumerated types, and procedure and function declarations and instances. Structures NOT translated properly include sets, constant declarations, variant records, files, subrange types, VAR parameters, CASE, FOR, WITH, READ, and WRITE statements, and nested procedures. The translator provides hints about untranslated regions by inserting UPPERCASE messages enclosed with /* and */ into the translated source. Error messages are of the form /***# Expected ... ***/. Human massaging of the output will certainly be needed. In fact, you may want to modify the keyword translation table to better translate your particular variant of Pascal. IMPLEMENTATION Written in C for Sun UNIX workstations; ought to compile on other systems without change... Some of the translation is done with a keyword table, but most of the work is done by a recursive-descent parser. BUGS Not well tested. Error recovery is very poor- the first error in translation inside the recursive-descent section will result in a very long stream of error messages. Some of the bread-and-butter structures of Pascal- like CASE and FOR- are not translated properly, although it would be easy to extend the parser to understand them. I welcome bug reports, and invite anyone interested to implement more PASCAL structures; I probably won't work on it much, because I don't use Pascal these days. VERSION This version by Daniel Kegel <dan@srs.UUCP> or <seismo!rochester!srs!dan>, 25 March 87. Based on a program by James A Mullens <jcm@ornl-msr.arpa> 29-Jan-87 which was in turn based on two nearly identical programs by Robert Heller (1 Feb 1985) and Rick Walker <walker@hpl-opus.hp.COM> (8 Sep 1986) which were reportedly derived from a similar program in the Feb 85 Byte which did a C TO PASCAL conversion.