Groups | Search | Server Info | Login | Register


Groups > comp.compilers > #220

Re: The STEP Preprocessor

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!news.iecc.com!nerds-end
From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: The STEP Preprocessor
Date Tue, 2 Aug 2011 20:54:27 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 54
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <11-08-003@comp.compilers> (permalink)
References <11-07-020@comp.compilers> <11-07-025@comp.compilers>
NNTP-Posting-Host news.iecc.com
X-Trace gal.iecc.com 1312472126 44057 64.57.183.58 (4 Aug 2011 15:35:26 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Thu, 4 Aug 2011 15:35:26 +0000 (UTC)
Keywords macros, history
Posted-Date 04 Aug 2011 11:35:26 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref x330-a1.tempe.blueboxinc.net comp.compilers:220

Show key headers only | View raw


Marco <prenom_nomus@yahoo.com> wrote:
> This was a fairly popular technique back in the 1970s.
> The RATFOR preprocessor <http://en.wikipedia.org/wiki/Ratfor>
> was actually used by non-academic types.

> [Considering that Ratfor was written at Bell Labs, of course it
> was used by non-academic types.  It was quite popular in the
> numerical analysis community. I ported it to PDP-10 Fortran. -John]

STEP was written at the same place as MORTRAN, and, as I understand
it, is meant to be a little higher level.  (Maybe a step up, I don't
know the source of the name.)

MORTRAN and RATFOR are similar in being macro processors for an
improvement to Fortran.  Both have the limitation that bad input
can generate bad output, with the error messages uncoupled to
the original error.  STEP allows the macro writer to restrict
the allowed arguments to a macro, and generate error messages
as appropriate.

The example in the manual starts with a macro allowing for:

   ADD A TO B AND STORE INTO C;

(In the days when programming was done in upper case.)

If instead one wrote:

   ADD A TO B AND STORE INTO 38;

A processor like RATFOR or MORTRAN would generate Fortran
code that would generate an error from the Fortran compiler.

With STEP, one can write a macro that restricts the argument
appropriately, and generates an error message when appropriate.
The message can accurately describe the problem in terms of
the original source statements.

The MORTRAN (and I believe RATFOR) processors were designed to
minimize the required storage, such that large programs could be
processed even on machines without a lot of memory.  Doing the
full parse with STEP likely does take more memory.  With current
machines, that is not likely to be a problem.

-- glen
[The people who did Ratfor did a subsequent language called EFL that
was a full compiler that translated into Fortran.  As was clear if you
looked at the yacc source, Ratfor didn't know any Fortran, and just
passed through anything it didn't know how to handle. Nonetheless, it
worked pretty well, particularly if you could pass through hints to
the Fortran compiler about what line numbers in the Ratfor source
corresponded to what lines in the Fortran. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

The STEP Preprocessor glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-07-12 06:39 +0000
  Re: The STEP Preprocessor Marco <prenom_nomus@yahoo.com> - 2011-07-16 06:59 -0700
    Re: The STEP Preprocessor glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-08-02 20:54 +0000

csiph-web