General-purpose macro processor explained

A general-purpose macro processor or general purpose preprocessor is a macro processor that is not tied to or integrated with a particular language or piece of software.

A macro processor is a program that copies a stream of text from one place to another, making a systematic set of replacements as it does so. Macro processors are often embedded in other programs, such as assemblers and compilers. Sometimes they are standalone programs that can be used to process any kind of text.

Macro processors have been used for language expansion (defining new language constructs that can be expressed in terms of existing language components), for systematic text replacements that require decision making, and for text reformatting (e.g. conditional extraction of material from an HTML file).

Notes and References

  1. Strachey. Christopher. Christopher Strachey. October 1965. A General Purpose Macrogenerator. Computer Journal. 8. 3. 225–241. 10.1093/comjnl/8.3.225. free.
  2. Waite . William M. . The mobile programming system: STAGE2 . Communications of the ACM . 13 . 7 . 415–421 . ACM . New York, NY, USA . July 1970 . 10.1145/362686.362691.
  3. Web site: Translation of 8080 Code to 8086 - Microsoft Translation of 8080 Code to 8086 and Other 16-Bit Processors . Charles Randyl . Britten . 2020-06-26 . 2021-11-28 . live . https://web.archive.org/web/20210723171914/https://retrocomputingforum.com/t/translation-of-8080-code-to-8086/1309 . 2021-07-23 . Stage2 was created by Prof William Waite at the University of Colorado in the late sixties as a major component of his mobile programming system, MPS. Stage2 uses a pattern matching algorithm to match input lines of text against a set of templates. Each template is the first line of a macro and when a match is recognized the code body of that macro is processed to produce output text, error messages, or create a constructed line that is submitted for further template matching. So the process is fully recursive and quite powerful in its capabilities for text transformation. In fact, it can be used to implement a programming language compiler..
  4. Book: Cole, A. J. . Jack Cole (scientist) . Macro Processors . 2nd, revised . 1981 . CUP Archive . 254.
  5. Farber, D. J., 635 Assembly System - GAP. Bell Telephone Laboratories Computation Center (1964).
  6. Web site: Gema. gema.sourceforge.net. 2017-04-21.
  7. Web site: GPP. logological.org/gpp. April 21, 2017.
  8. Web site: Welcome to pyexpander's documentation! — pyexpander 1.7.0 documentation. pyexpander.sourceforge.net. 2017-04-21.
  9. Web site: akiwi - Text Assembler. www.akiwi.co.uk. 2017-04-21.
  10. Web site: PP - A generic Preprocessor (with Pandoc in mind). Delord. Christophe. cdsoft.fr. 2017-10-17.
  11. Web site: minimac. freshmeat.net. en. 2017-04-21.
  12. Web site: aa_macro. 2017-11-24.
  13. Web site: wtfm. 2017-11-24.