|The STEP Preprocessor email@example.com (glen herrmannsfeldt) (2011-07-12)|
|Re: The STEP Preprocessor firstname.lastname@example.org (Marco) (2011-07-16)|
|Re: The STEP Preprocessor email@example.com (glen herrmannsfeldt) (2011-08-02)|
|From:||glen herrmannsfeldt <firstname.lastname@example.org>|
|Date:||Tue, 2 Aug 2011 20:54:27 +0000 (UTC)|
|Organization:||Aioe.org NNTP Server|
|Posted-Date:||04 Aug 2011 11:35:26 EDT|
Marco <email@example.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
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.
[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]
Return to the
Search the comp.compilers archives again.