[comp.lang.modula2] One-pass Compilers

COK2%UK.AC.DURHAM.MTS@ac.UK (Barry_Cornelius) (07/22/87)

I remember that, last October, there was some discussion about
one-pass compilers for Modula-2.   The language defined by Wirth in his
Report (see back of "Programming in Modula-2") is unable to be compiled
by a one-pass compiler for a number of reasons:
   1. The Report allows use of an identifier before its declaration
      provided the use appears in a statement.
   2. The Report permits mutually recursive procedures (but there is no
      mention of a FORWARD declaration in the Report).
   3. The Report allows two local modules which are mutually importing.
I would be interested to hear of any other difficulties that a one-pass
compiler would have in compiling the language defined by the Report.

I would also be interested to hear from those who use mutually importing
local modules.   Are there examples of real code out there that use this
facility?

Here is an abstract example of a mutually importing local module:
   ...
   MODULE m1;
      IMPORT x;
      EXPORT y;
      VAR y:INTEGER;
      ...
   END m1;
   ...
   MODULE m2;
      IMPORT y;
      EXPORT x;
      VAR x:INTEGER;
      ...
   END m2;
   ...
These two module declarations form part of the block of a program
(or a procedure/function/module declaration).
==
Barry Cornelius
==
Address:
   Computer Science Group, School of Engineering and Applied Science,
   University of Durham, Durham, DH1 3LE, England
Telephone:
   My office: Durham (091 or +44 91) 374 2638
   Secretary: Durham (091 or +44 91) 374 2630
Electronic Mail Addresses:
   JANET:       Barry_Cornelius@uk.ac.dur.mts
   ARPANET:     Barry_Cornelius%mts.dur.ac.uk@cs.ucl.ac.uk
   UUCP:        ...ukc!mts.dur.ac.uk!Barry_Cornelius
   BITNET/EARN: Barry_Cornelius%DUR.MTS@AC.UK

randy@oresoft.UUCP (Randy Bush) (07/24/87)

In article <8707231338.AA27020@jade.berkeley.edu> COK2%UK.AC.DURHAM.MTS@ac.UK (Barry_Cornelius) writes:
>I would also be interested to hear from those who use mutually importing
>local modules.   Are there examples of real code out there that use this
>facility?

The Zuerich multi-pass compiler for Lilith had mutually importing internal
modules in the fourth pass, if I remember aright.

PS: Barry, I find it impossible to reach you via any path.  Likewise Dr. R.
Henry.  Could you try another send to me?  Thanks.
-- 
Randy Bush, Compiler Group, Oregon Software, Portland Oregon (503) 245-2202
uucp: ..!tektronix!oresoft!randy      Telemail: RBush    Fidonet: 1:105/6.6