@X @~
~V7 56 2 -5
~V9 1
~D 10
~H                    MUSS
~
~
~H     VOLUME        6
~
~
~H                     PART        1
~D 5
~V2 -10
~M~LFORTRAN 77 IMPLEMENTATION MANUAL~
~BThis volume contains the implementation of the MUSS Fortran 77
compiler. The Fortran 77 compiler implements the language to the
ANS77 Fortran standard.~
~D5
~MUNIVERSITY OF MANCHESTER~
~V2 0
~V9 -1
~P
~MVolume 6 CONTENTS
~
~
~MCOMPILER SECTIONS~
~
~MFTN001  -  Introduction to Fortran Compiler~
~
~NFTN011  -  Configuration Section~
~
~NFTN021  -  Statement Driver~
~
~NFTN031  -  Lexical Analysis~
~
~NFTN041  -  Syntax Analysis~
~
~NFTN051  -  Specification Statement Processing~
~
~NFTN061  -  Specification Part Declarations~
~
~NFTN071  -  Assignment Statement Processing~
~
~NFTN081  -  Control Statement Processing~
~
~NFTN091  -  Input/Output Statement Processing~
~
~NFTN101  -  Program Unit Statement Processing~
~
~NFTN111  -  Expression Evaluation~
~
~NFTN121  -  Property List Management~
~
~NFTN131  -  Fault Monitoring~
~
~NFTN141  -  Directive Processing~
~
~MRUN-TIME SUPPORT SECTIONS~
~
~MFTN201  -  Introduction to Fortran Run-time Support~
~
~NFTN211  -  Configuration Section~
~
~NFTN221  -  Format Specification Processing~
~
~NFTN231  -  Input Procedures~
~
~NFTN241  -  Output Procedures~
~
~NFTN251  -  Auxiliary I/O Procedures~
~
~NFTN261  -  Job Control Procedures~
~
~NFTN271  -  Unit Control Procedures~
~V9 -1
~P
~D10
~H                    MUSS
~
~
~D10
~H             FTN001
~D10
~MMANCHESTER UNIVERSITY  -  CONFIDENTIAL~
~
~
~V2 -16
                                                                       ISSUE 10~
~V2 0
~V9 -1
~P
~V9 1
~YFTN001
~M~LFORTRAN 77 COMPILER IMPLEMENTATION DESCRIPTION
~S1~M~LSection 0
~S1~LSection 0. Introduction
~S1~L1.1 General Description
~B~KThis manual documents the implementation of a "Portable" Fortran
'77 Compiling System. The language that is accepted by the compiler is
described in the document 'BSR X3.9 FORTRAN 77 dpANS FORTRAN Language
X3J3/90' of the American National Standards.
The Compilating System consists of a compiler and a library which
provides facilities for run-time support of Fortran programs.
This Manual is divided
into twenty-three sections, each of the first fifteen describe the implementatio
n of a
particular section of the compiler. The division of the compiler
into sections is similar to the divisions used in other compilers
in the Manchester MUSS system.
The last eight sections of this Manual describe the
implementation of the Fortran input/output library for run-time
support of Fortran programs.~K
~BEach section in this manual documents:~
~T% 5
~
1.
~IA general description of the section, including a description of
any deviations from the FORTRAN 77 standard,
and details of any implementor dependent features of FORTRAN.~
~
2.
~IIts interfaces with other sections.~
~
3.
~IDetails of the implementation, including an outline of its
operation and data structures.~
~
4.
~IFlowcharts for that section.~
~BThis compiler is written in the MUSL language using FLOCODER as a
documentation and programming aid.
~BEach section is a MUSL module and presents to the rest of the
compiler an interface
consisting of procedures and data entities.
~BSome parts of the compiler may have several versions, these differ
in their level of sophistication. For example, the expression
evaluation section could have an unoptimising and an optimising
version.
~BAll code is generated by using the MUTL
interface. The unit of compilation of the compiler
is one or more program units and this is
translated into a single MUTL module. The main
program unit code is at the global level of a
MUTL module, and subroutine and functions are
translated to MUTL static procedures at the outermost levels.
All common and non-common data is declared
offstack in MUTL to permit static initialisation.
Formats are processed whenever possible at
compile time and the Format information becomes part of
the data set of the object being compiled.~

~BOn installing the compiler on a particular machine careful
consideration must be given to the configuration parameters of
the object machine of compilation and the compiler source changed
accordingly. To simplify this task alternative codings have been
provided for the more frequent options of some of the configuration
parameters and an edit on the compiler source selects the appropriate
alternative.~
~T# 4
~
1.~IReal arithmetic precision. For 32 bit Real and 64 bit Double
Precision arithmetic remove all occurrences of ::RE32/64, whereas
for 64 bit Real and 128 bit Double Precision remove occurrences of
::RE64/128. They occur in sections 1, 4, 5, 7, 8, 9, 11 and 12.~
~
2.~IInteger arithmetic precision. For 16 bit integer precision
remove occurrences of ::IN16, and for 32 bit precision remove
occurrences of ::IN32. These occur in section 1 only.~
~
3.~IDummy argument type. For passing of dummy arguments with a
bounded reference remove all occurrences of ::BND, and for an
unbounded reference remove ::UNBND. These occur only in section 1.~
~
Comments such as ::~KMC6800~K0-OBJ, ::VAX-OBJ, ::PDP-OBJ which occur in
section 1 indicate configuration parameters for a particular machine.
If the object machine is already
catered for, then remove the appropriate comments, i.e. for the VAX
remove ::VAX-OBJ. If the object machine is not currently catered for,
then the appropriate codings must be added. There are numerous
configuration parameters concerned with character set, at present only
the ASCII and ISO character sets have been required, therefore alternativetive
codings for other character sets are not provided. The remaining configuration
parameters are concerned with sizes of compiler tables and storage
allocation. The table sizes are suitable for machines with large virtual
stores, they may need some adjustment for machines with small virtual
stores. The storage allocation parameters allow control of storage
of data which is neither equivalenced nor in Common, on some descriptor
based machines these parameters can be adjusted to reduce data
storage of a compiled program.
~BThe compiler source consists of 15 files~
~
~MFTN001
~NFTN011
~NFTN021~
~NFTN031~
~NFTN041~
~NFTN051~
~NFTN061~
~NFTN071~
~NFTN081~
~NFTN091~
~NFTN101~
~NFTN111~
~NFTN121~
~NFTN131~
~NFTN141~
~BThe files FTN001 through to FTN141 are FLOC
files containing the compiler MUSL source at level 1,
and the implementation description in TEXT form
~Kis at the beginning~K of the file for sections 0 to 14
of compiler.
~BA syntax processing tool (see MUSS User Manual)
SYNTAB is used to generate SYNTAX tables which are compiled
in as part of the compiler.~
~BThe syntax which is input to SYNTAB is found at level zero of the
chart FTN04.1.1. Level one of the chart FTN04.1.1
contains the MUSL output from
SYNTAB for the supplied syntax. To generate the MUSL from this syntax
the following procedure was adopted:~
~
~X{`
~M**FLIP FTN041                         ~
~NFTN04.1.1      {extract syntax from chart~
~N~~~
~N**SYNTAB       {convert syntax to SYNTAX tables~
~N**ED~
~N~KC/IN -1/S+1E~K~
~N                ~Kthen insert back into the sub-charts~
~N                of FTN04.1.1 at level one.~K~
~X{{
~BIf
changes are required to the syntax tables then
SYNTAB must be installed.~
~BTo compile the compiler each section of the compiler should be
FLIPped to produce the MUSL and given to the MUSL compiler.
Compile jobs for the Fortran are given in Section 1 (Configuration Section).
~BThe compiler requires the ~KFormat processor~K of the FORTRAN run time library
at compile time (for Formats) and any FORTRAN program uses this library
at run time.
~KFor a paged MUSS environment then the complete run-time
library is present at compile time, whereas for restricted
virtual store MUSS environment the Format processor module can
either compile a separate library or compile with the
compiler itself.~K
~S1~L1.2 Development Log~
~BThis section records major milestones in compilers development
and issuing of the compiler.~
~T# 22
~
       JAN 1 1980~IDesign of Fortran 77 compilation system
for MUSS using MUTL interface started.~
~
      SEPT 1 1980~IDebugging of Fortran 77 compilation system
commenced on MU5.~
~
       NOV 1 1980~IValidation suite for Fortran 77 subset
language run on MU5.~
~
      JULY 1 1981~IA VAX version of the compiler using a new MUTL
interface produced.~
~
      ~KSEPT 1 1981~IValidation suite for Fortran subset
language run on - VAX 11/750.~
~
      JULY 1 1982~ICompiler modified to remove the
dependency of default size integers containing addresses.~
~
       AUG 1 1982~IValidation suite for Fortran subset
language run on a MC68000 based system.~K
~S1~L1.3 Suggested Design Modification~
~BThis section notes any design modifications that may be done
to the compiler at a later date or at other sites.~
~Y
~P
~V9 -1
~D15
~HFLOWCHARTS
~
~
~H                FTN001
~V9 -1
~F
@TITLE FTN(1,6)
@COL 1S-2R-3F
@FLOW 1-2-3
@BOX 1.0
FORTRAN 77 COMPILER
@BOX 2.0
FTN01: CONFIGURATION SECTION
FTN02: STATEMENT DRIVER
FTN03: LEXICAL ANALYSIS
FTN04: SYNTAX ANALYSIS
FTN05: SPECIFICATION ANALYSIS
FTN06: SPECIFICATION PART DECLARATIONS
FTN07: ASSIGNMENT STATEMENT PROCESSING
FTN08: CONTROL STATEMENT PROCESSING
FTN09: INPUT/OUTPUT STATEMENT PROCESSING
FTN10: PROGRAM UNIT STATEMENT PROCESSING
FTN11: EXPRESSION EVALUATION
FTN12: PROPERTY LIST MANAGEMENT
FTN13: FAULT MONITORING
FTN14: DIRECTIVE PROCESSING
@BOX 3.0
END
@BOX 2.1
#FTN01
#FTN12
#FTN03
#FTN02
#FTN04
#FTN05
#FTN07
#FTN08
#FTN09
#FTN10
#FTN06
#FTN11
#FTN13
#FTN14
@END

