|
ABSTRACT
I have recently written a portable compiler [1] for the Fortran 77 language [2]. It attacks an old language with new tools: the parser is generated automatically from an LALR(1) grammar, the program is produced by code generators designed for another language. These tools proved very valuable, but they are based on theory and experience one or two decades fresher than that underlying Fortran, so they really do not fit this application. The following discusses the approach taken, the ways in which the tools had to be bent to do the job, the properties of Fortran that seem to cause the most trouble, and the costs of writing a portable compiler. It also describes certain aspects of the approach to code generation, since others may wish to use the same tools. This paper does not describe low-level details of the implementation. This compiler is intimately connected with the programming language C[3]. The compiler is written in C, it uses tools written in C, the input/output library uses the standard C library, and it uses the second pass of a C compiler as code generator. To a much smaller extent, this compiler is based on the UNIXï¾ operating system, since all of the development work was done on UNIX systems and the current version of the compiler assumes the UNIX system process structure. It would require a serious but not enormous effort to move this compiler to a different operating system; it would be impossible to move it to a non-C environment.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Feldman, S. I. and Weinberger, P. J., "A Portable Fortran 77 Compiler", (unpublished, 1978).
|
| |
2
|
American National Standard Programming Language Fortran, American National Standards Institute X3.9-1978.
|
| |
3
|
|
| |
4
|
The Bell System Technical Journal57, 6, Part 2 (July-August 1978), Entire issue.
|
| |
5
|
Feldman, S. I., "Fortlex — A General Purpose Lexical Analyzer for Fortran," Bell Laboratories Computing Science Technical Report #51 (1976).
|
| |
6
|
Johnson, S. C., "Yacc: Yet Another Compiler-Compiler," Bell Laboratories Computing Science Technical Report #32 (1975).
|
| |
7
|
Johnson, S. C., "A Tour Through the Portable C Compiler," (unpublished, 1976).
|
| |
8
|
Ritchie, D. M., "A Tour Through the unix C Compiler," (unpublished, 1975).
|
CITED BY 10
|
|
|
|
|
|
|
|
|
|
|
|
R. Atkinson , A. Demers , C. Hauser , C. Jacobi , P. Kessler , M. Weiser, Experiences creating a portable cedar, ACM SIGPLAN Notices, v.24 n.7, p.322-329, July 1989
|
|
|
|
|
|
|
|
|
|
|
Peer to Peer - Readers of this Article have also read:
-
Data structures for quadtree approximation and compression
Communications of the ACM
28, 9
Hanan Samet
-
A hierarchical single-key-lock access control using the Chinese remainder theorem
Proceedings of the 1992 ACM/SIGAPP Symposium on Applied computing
Kim S. Lee
, Huizhu Lu
, D. D. Fisher
-
The GemStone object database management system
Communications of the ACM
34, 10
Paul Butterworth
, Allen Otis
, Jacob Stein
-
Putting innovation to work: adoption strategies for multimedia communication systems
Communications of the ACM
34, 12
Ellen Francik
, Susan Ehrlich Rudman
, Donna Cooper
, Stephen Levine
-
An intelligent component database for behavioral synthesis
Proceedings of the 27th ACM/IEEE Design Automation Conference on
Gwo-Dong Chen
, Daniel D. Gajski
|