Implementation of a portable Fortran 77 compiler using modern tools

  • Authors:
  • Stuart I. Feldman

  • Affiliations:
  • Bell Laboratories, Murray Hill, New Jersey

  • Venue:
  • SIGPLAN '79 Proceedings of the 1979 SIGPLAN symposium on Compiler construction
  • Year:
  • 1979

Quantified Score

Hi-index 0.00

Visualization

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.