Bell SAP(ID:5635/bel003)SAP with conditional and recursive macrosSAP extended to include conditional and recursive macros: the beginning of the great macro-language tradition at Bell Labs (everything from L6 and AMBIT to C) Places People: Related languages
References: It is interesting to this reviewer to observe the gradual coalition of the structure of macro-assemblers (or compilers) and algebraic compilers. The author's description of the coding that must be added to a programming routine to make it a macro- instruction compiler also constitutes a description of the essential portion of an algebraic compiler. This similarity suggests that an alternate approach might be to start instead with a base program which contains a syntactical scanner, a storage allocation procedure, and a mechanism for handling remote connections. in ACM Computing Reviews, January-December 1960 view details in [ACM] CACM 3(04) April 1960 view details Extendible Compilers -- Basic Concepts Many attempts (starting with McIlroy [McI1 60]) have been made to embed macro features in compiler systems. One approach was to retain the macro syntax form but add a number of built-in features which are compiler-like. The SET system [Ben 64a] included a skeleton compiler with input-output, symbol manipulation, table handling, and list processing features. These built-in routines were combined with translation time operations (action operators) in the attempt to build a TWS. A more successful approach has been to use the structured syntax of high level languages as a basis for extension. Many existing compilers (including PL/I [IBM 66]) incorporate simple forms of macro expansion, the first probably being JOVIAL [Shaw 63]. The most primitive form is pure text replacement without parameter substitution. For example, in B5500 ALGOL one could define a macro with the statement: DEFINE LOOP 1 = FOR I ~ 1 STEP 1 UNTIL N and later write statements like LOOP 1 N DO A[I] ~ 0 which would be expanded into FOR I ~-- 1 STEP 1 UNTIL N DO A [I] ~-- 0. The next step is to allow a macro definition with parameters. This facility has been included in the AED-0 compiler [Ross 66], among others. In AED-0 one might define a macro with the statement: DEFINE MACRO LOOP (P1, P2) TOBE FOR P1 ~-- 1 STEP 1 UNTIL P2 DO ENDMACRO. In this case, one could get the same result as above with the shorter statement LOOP(I, N) A[I] ~-- O. These two simple macro forms would form a useful addition to any high level language, and one might imagine developing mechanisms which parallel more sophisticated macro techniques. Although AED-0 does permit arbitrary strings as parameters, and nested definitions, features like conditional assembly do not seem to have been widely used in high level languages. One reason for this is that compilers normally depend heavily on the structure of the text; the next two sections describe the complexities that arise in trying to extend compilers with macro techniques. in [ACM] CACM 11(02) (February 1968) view details In the late 1950s. several symbolic assembly languages, such as SAP, had become available, and by 1957 some of these, including IBM's SCAT and SAP for the 704 machine, permitted users to define macroinstructions (often called macros) as shorthand for frequently occurring sequences of machine instructions. Then in 1959, M. Douglas McIlroy and Douglas E. Eastwood of Bell Labs introduced conditional and recursive macros into SAP, and in 1960 described how macros could be used to extend any programming language to meet the user's own special requirements. in [ACM] CACM 11(02) (February 1968) view details |