Roberto Waltman <>
8 Feb 2007 16:56:56 -0500

          From comp.compilers

Related articles
Re: PL/MIX (Roberto Waltman) (2007-02-07)
Re: PL/MIX (Max Hailperin) (2007-02-08)
Re: PL/MIX (Allan Adler) (2007-02-08)
Re: PL/MIX (Roberto Waltman) (2007-02-08)
Re: PL/MIX (glen herrmannsfeldt) (2007-02-08)
Re: PL/MIX (Steven Nichols) (2007-02-09)
Re: PL/MIX (Allan Adler) (2007-02-09)
Re: PL/MIX (Allan Adler) (2007-02-11)
Re: PL/MIX (2007-02-12)
Re: PL/MIX (Peter Flass) (2007-02-12)
[3 later articles]
| List of all articles for this month |

From: Roberto Waltman <>
Newsgroups: comp.compilers
Date: 8 Feb 2007 16:56:56 -0500
Organization: Compilers Central
References: <> 07-02-018 07-02-025
Keywords: assembler
Posted-Date: 08 Feb 2007 16:56:56 EST

Allan Adler wrote:
>Roberto Waltman <> writes:
>> Indeed. Adding "structured programming" control structures to a
>> language is a simple exercise that has been repeated many times, using
>> macros, (for assemblers with adequate macro facilities,) or with
>> simple preprocessors for either assembly or higher level languages.
>Since it is an exercise, is there perhaps a concise statement of that
>exercise as an explicit exercise in some programming text? Preferably
>something like, "Take the fake assembly language we defined in section
>2 and enhance it with 'structured programming' control structures. For
>example, add the following constructions and capabilities: ... "?

I personally did it three or four times for assemblers (PDP MACRO-11,
Z80, IAR 68HC11) and once for BASIC. (MicroBee Basic) Don't have the
sources any more, and the idiosyncrasies of the macro languages may
make them difficult to understand. (The IAR version in particular.)

Ratfor (Rational Fortran) is probably a better starting point,
specially the Ratfor in Ratfor version. (Even if you are not familiar
with Fortran.) A quick search for the basic methodology in Ratfor
found these:

    * Ratfor: A preprocessor for rational Fortran

    Not Ratfor, but same ideas:
    * An Algorithm for Structuring Programs:

    For Ratfor (Rational FORTRAN) in Ratfor:,1144,020103669X,00.html
    (Avoid the PASCAL version of the book)

(Or download the Ratfor sources from any Linux/FreeBSD etc.

There were other similar projects aiming to Algolize FORTRAN.
There was a FLEX preprocessor, (no relation to the flex lexical
analyzer,) and I saw a thesis from a student at a Mexican university
that basically duplicated Ratfor.
A well known Pascal book on data structures also had an section on
extending Pascal. (May have been Horowitz and Sahni?. I don't have it

Another option is books describing "toy" compilers:

* "Brinch Hansen on Pascal Compilers",
* Pyster's "Compiler Design and Construction" (Rascal),
* Wirth's "Compiler Construction"
  (Available on-line: )
* Wirth again, the Pascal subset compiler described in "Algorithms +
Data Structures = Programs"

(Avoid the Small-C family, because of its had-hoc approach with no
theoretical background.)

String oriented languages such as awk and perl would be good
implementation languages for this type of project, regardless of what
the target is.

Hope this helps,

Roberto Waltman

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.