General-purpose macro processor

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).

Examples of general purpose macro processors

Name Year Description
GPM 1960s One of the earliest macro processors was GPM (the General Purpose Macrogenerator).[1] This was developed at the University of Cambridge, UK, in the mid 1960s, under the direction of Christopher Strachey.
ML/I 1960s One particularly important general purpose macro processor was (and still is) ML/I (Macro Language One). This was developed as part of PhD research by a Cambridge postgraduate, Peter J. Brown. ML/I operates on a character stream, and requires no special format for its input, nor any special flag characters to introduce macros.
STAGE2 1960s A contemporary of ML/I was STAGE2,[2] part of William Waite's Mobile Programming System.[3] This too is a general purpose macro processor, but it processes input a line at a time, matching each line against specified patterns; it is notable in that it is independent of character set, requiring only that the digits 0-9 are contiguous and in that order (a condition not met by some of the 6-bit and BCD character codes of the era).
M6 1960s Early macro processor developed at AT&T Bell Laboratories by Douglas McIlroy, Robert Morris and Andrew Hall. It was influenced by GPM and TRAC. Implemented in FORTRAN IV,[4] it was ported to Version 2 Unix.
SNOBOL 1960s SNOBOL is a string processing language which is capable of doing most of the pre-processing which can be done by a macro processor.
XPOP XPOP was another attempt at a general macro processing language by Mark Halpern at IBM in the 1960s.
TTM 1968 TTM is a recursive, interpretive language designed primarily for string manipulation, text editing, macro definition and expansion, and other applications generally classified as systems programming. It was developed in 1968 by Steven Caine and E. Kent Gordon at the California Institute of Technology. It is derived, primarily, from GAP[5] and GPM.[1]
GMP 1970s Another attempt was the GMP (General Macro Processor) developed in the mid-1970s by M Boule in the DLB/GC department of the CII Company along ideas from R.J. Chevance. Tested in association with the Bordeaux I University the first version ran the SIRIS8/IRIS80 System. It was ported to mini6 systems and was the main component involved in the system generation for this family of computers. The GMP processor used C2-Chomsky grammars to define the syntax of macros and used an imperative language to execute computations and proceed to macro expansion.
M4 1977 m4 was designed and written in C for Unix by Dennis Ritchie and converted to Ratfor by Brian Kernighan.[6]
ELENA Software: Practice and Experience, Vol. 14, pp. 519–531, Jun. 1984
gema 1995 gema is a contextual macro processor based on pattern matching, written by David N. Gray. It replaces/enhances the concept of regular expressions by contexts. Contexts roughly corresponds to named sets of patterns. As a consequence, macros in gema closely resemble an EBNF description.[7]
GPP 1996 gpp is another general macro processor written by Denis Auroux. It resembles a C preprocessor, but has more general semantics and allows for customized syntax (for instance, TeX, XHTML, and Prolog-like scripts are definable).[8]
M5 1999 m5 is a general-purpose macro processor written by William A. Ward, Jr. Unlike many macroprocessors, m5 does not directly interpret its input. Instead it uses a two-pass approach in which the first pass translates the input to an awk program, and the second pass executes the awk program to produce the final output.
pyexpander 2011 pyexpander is a general-purpose macro processor based on the Python programming language. In addition to simple macro replacement it allows evaluation of arbitrary Python expressions and execution of python code.
Text Assembler 2014 Text Assembler is a general-purpose text/macro processor based on the JavaScript programming language. Beyond simple macro replacement, it allows evaluating arbitrary JavaScript expressions and executing JavaScript code. It can also load JSON data models for more complex data-driven text processing tasks.[9]
PP 2016 PP is a text preprocessor designed for Pandoc (and more generally Markdown and reStructuredText). PP implements: Macros, literate programming, GraphViz, PlantUML and ditaa diagrams, Bash, Cmd, PowerShell, Python and Haskell scripts.[10]
minimac minimac is a minimalist general purpose macro processor. It operates as a character stream filter, recursively expanding macros as they are encountered. It is unusual for a macro processor in that it uses an explicit argument stack, and user functions are defined by concatenation (similar to the Forth language).[11]
aa_macro 2017 aa_macro is an open-source character-stream-based text processing language written in Python. Text is processed in a left-to-right, inside-to-outside manner. A selection of pre-defined built-in functions provide fundamental processing mechanisms that may be used directly or as elements of user-defined styles. The language is user extensible, and wtfm, an open-source web-based document preparation wrapper for the language, is available.[12][13]

See also

References

  1. ^ a b Strachey, Christopher (October 1965). "A General Purpose Macrogenerator". Computer Journal. 8 (3): 225–241. doi:10.1093/comjnl/8.3.225.
  2. ^ Waite, William M. (July 1970). "The mobile programming system: STAGE2". Communications of the ACM. 13 (7). New York, NY, USA: ACM: 415–421. doi:10.1145/362686.362691.
  3. ^ Britten, Charles Randyl (2020-06-26). "Translation of 8080 Code to 8086 - Microsoft Translation of 8080 Code to 8086 and Other 16-Bit Processors". Archived from the original on 2021-07-23. Retrieved 2021-11-28. 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. ^ Cole, A. J. (1981). Macro Processors (2nd, revised ed.). CUP Archive. p. 254.
  5. ^ Farber, D. J., 635 Assembly System - GAP. Bell Telephone Laboratories Computation Center (1964).
  6. ^ Kernighan, Brian W.; Plauger, P. J. (1976). Software Tools. Reading, Masschusetts: Addison-Wesley. p. 283. ISBN 0-201-03669-X.
  7. ^ "Gema". gema.sourceforge.net. Retrieved 2017-04-21.
  8. ^ "GPP". logological.org/gpp. Retrieved April 21, 2017.
  9. ^ "akiwi - Text Assembler". www.akiwi.co.uk. Retrieved 2017-04-21.
  10. ^ Delord, Christophe. "PP - A generic Preprocessor (with Pandoc in mind)". cdsoft.fr. Retrieved 2017-10-17.
  11. ^ "minimac". freshmeat.net. Retrieved 2017-04-21.
  12. ^ "aa_macro". Retrieved 2017-11-24.
  13. ^ "wtfm". Retrieved 2017-11-24.

Read other articles:

Different StagesAlbum live karya RushDirilis10 November 1998Direkam197819941997GenreProgressive rock, hard rockDurasi3:22:44LabelAnthem Records (Kanada)AtlanticProduserGeddy Lee Dan Paul NorthfieldKronologi Rush Test for Echo(1996)Test for Echo1996 Different Stages (1998) Vapor Trails(2002)Vapor Trails2002 Different Stages adalah album live dari band rock Rush, dirilis pada tahun 1998. Sebagian besar CD pertama dan kedua direkam di World Amphitheater di pinggiran kota Chicago, Illinois se...

 

 

Artikel ini adalah bagian dari seriPolitik dan ketatanegaraanIndonesia Pemerintahan pusat Hukum Pancasila(ideologi nasional) Undang-Undang Dasar Negara Republik Indonesia Tahun 1945 Hukum Perpajakan Ketetapan MPR Undang-undang Perppu Peraturan pemerintah Peraturan presiden Peraturan daerah Provinsi Kabupaten/kota Legislatif Majelis Permusyawaratan Rakyat Ketua: Bambang Soesatyo (Golkar) Dewan Perwakilan Rakyat Ketua: Puan Maharani (PDI-P) Dewan Perwakilan Daerah Ketua: La Nyalla Mattalitti (J...

 

 

حمد بن جاسم بن جبر آل ثاني رئيس وزراء قطر الرابع في المنصب3 أبريل 2007 – 26 يونيو 2013 العاهل حمد بن خليفة آل ثاني عبد الله بن خليفة آل ثاني عبد الله بن ناصر آل ثاني وزير الخارجية في المنصب11 يناير 1992 – 26 يونيو 2013 رئيس الوزراء عبد الله بن خليفة آل ثاني مبارك الخاطر خالد بن محمد العط�...

NBC affiliate in Raleigh, North Carolina This article is about the television station. For its sister radio station in Raleigh that is also owned by Capitol Broadcasting Company, see WRAL (FM). WRAL-TVRaleigh–Durham–Fayetteville, North CarolinaUnited StatesCityRaleigh, North CarolinaChannelsDigital: 17 (UHF)Virtual: 5BrandingWRAL-TV 5; WRAL NewsProgrammingAffiliations5.1: NBCfor others, see § SubchannelsOwnershipOwnerCapitol Broadcasting Company, Inc.Sister stationsWCLY, WCMC-FM, WD...

 

 

† Египтопитек Реконструкция внешнего вида египтопитека Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:Четвероно...

 

 

GBW redirects here. For other uses, see GBW (disambiguation). Green Bay and Western RailroadEx-LS&I #2407 at the Illinois Railway MuseumOverviewHeadquartersGreen Bay, WisconsinReporting markGBWLocaleWisconsinDates of operation1896–1993SuccessorWisconsin Central Ltd.TechnicalTrack gauge4 ft 8+1⁄2 in (1,435 mm) standard gauge Route map Legend 213.9 mi344.2 km Winona Mississippi River MNWI 211.9 mi341 km ...

American rock band This article is about the rock band. For their debut album, see Foo Fighters (album). For the aerial phenomenon, see Foo fighter. Foo FightersFoo Fighters at Glastonbury Festival 2023. From left: Chris Shiflett, Rami Jaffee, Dave Grohl, Nate Mendel, Josh Freese and Pat Smear.Background informationAlso known asThe Holy Shits[1]Dee Gees[2]The ChurnUpsOriginSeattle, Washington, U.S.Genres Alternative rock post-grunge hard rock grunge DiscographyFoo Fighters dis...

 

 

1970 United States Senate election in Nevada ← 1964 November 3, 1970 1976 →   Nominee Howard Cannon William Raggio Party Democratic Republican Popular vote 85,187 60,838 Percentage 57.65% 41.17% County resultsCannon:      40–50%      50–60%      60–70%Raggio:      50–60%      60–70% U.S. senator before election Howard Cannon De...

 

 

 本表是動態列表,或許永遠不會完結。歡迎您參考可靠來源來查漏補缺。 潛伏於中華民國國軍中的中共間諜列表收錄根據公開資料來源,曾潛伏於中華民國國軍、被中國共產黨聲稱或承認,或者遭中華民國政府調查審判,為中華人民共和國和中國人民解放軍進行間諜行為的人物。以下列表以現今可查知時間為準,正確的間諜活動或洩漏機密時間可能早於或晚於以下所歸�...

Symbolic military cemetery in Mersin, Turkey Cyprus Memorial Forest(Cyprus Memorial Cemetery)Kıbrıs Hatura Ormanı(Kıbrıs Şehitliği)TurkeyFor Turkish servicemen killed in action during the 1974 Cyprus InvasionEstablished1976 (1976)LocationÇamdüzünear Silifke, Mersin, TurkeyTotal burials454 (symblic)36°22′48″N 33°52′28″E / 36.38000°N 33.87444°E / 36.38000; 33.87444 class=notpageimage| Location of the military memorial in Turkey The Cy...

 

 

Library in Worcester, EnglandThe HiveGeneral informationTypeLibraryArchitectural style Postmodern AddressSawmill Walk, The ButtsTown or cityWorcesterCountryEnglandOpened2 July 2012 (2012-07-02)Cost£29.7 millionClient Worcestershire County Council University of Worcester Technical detailsFloor area12,371m2Design and constructionArchitecture firmFeilden Clegg Bradley StudiosStructural engineer Hyder Consulting Atelier One Services engineerMax FordhamOther designersCopper Claddi...

 

 

Bundesautobahn 12LocalizzazioneStato Germania DatiClassificazioneAutostrada InizioBerlino[N 1] FineFrancoforte sull'Oder Lunghezza58 km PercorsoPrincipali intersezioni Strade europee Manuale L'autostrada tedesca A 12 congiunge Berlino alla frontiera polacca presso Francoforte sull'Oder; attraverso il Ponte autostradale di Francoforte sull'Oder prosegue in territorio polacco come A2. Indice 1 Percorso 2 Note 3 Voci correlate 4 Altri progetti 5 Collegamenti esterni Percorso A 12 Ti...

В Википедии есть статьи о других людях с такой фамилией, см. Рябинин; Рябинин, Евгений. Евгений Александрович Рябинин Дата рождения 19 мая 1948(1948-05-19) Дата смерти 18 декабря 2010(2010-12-18) (62 года) Место смерти Сыктывкар Страна  СССР→ Россия Род деятельности учёный Нау�...

 

 

Phoenix RacewayPhoenix Raceway as of 2019Lokasi7602 S Avondale BoulevardAvondale, Arizona 85323United StatesZona waktuUTC−7Kapasitas42,000[1]PemilikNASCARDibuka1964Nama sebelumnyaPhoenix International Raceway (1964–1973, 1976–2017)FasTrack International Speedway (January 1973–August 1976) Jeff Gordon Raceway (November 15, 2015)ISM Raceway (2018–January 2020)Acara besarNASCAR Cup SeriesNASCAR Xfinity SeriesNASCAR Camping World Truck SeriesDogleg ovalPermukaanAsphaltPanjang1.0...

 

 

For the federal electoral district, see Prince Edward—Hastings. Provincial electoral district in Ontario, CanadaPrince Edward—Hastings Ontario electoral districtPrince Edward—Hastings shown within the Eastern Ontario regionDefunct provincial electoral districtLegislatureLegislative Assembly of OntarioDistrict created1999District abolished2018First contested1999Last contested2014DemographicsPopulation (2006)113,227Electors (2011)88,198Area (km²)7,395Census division(s)Hastings, Prince Ed...

У этого термина существуют и другие значения, см. Абганерово. СелоАбганерово Флаг 48°04′46″ с. ш. 44°11′09″ в. д.HGЯO Страна  Россия Субъект Федерации Волгоградская область Муниципальный район Октябрьский Сельское поселение Абганеровское История и география Осн�...

 

 

Town in Connecticut, United StatesHarwinton, ConnecticutTownTown of HarwintonHarwinton Town Hall Seal Litchfield County and Connecticut Northwest Hills Planning Region and ConnecticutShow HarwintonShow ConnecticutShow the United StatesCoordinates: 41°45′16″N 73°03′25″W / 41.75444°N 73.05694°W / 41.75444; -73.05694Country United StatesU.S. state ConnecticutCountyLitchfieldRegionNorthwest HillsIncorporated1737Government • Type...

 

 

1195 battle of Almohads and Castillians This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (July 2020) (Learn how and when to remove this message) Battle of AlarcosPart of the ReconquistaAlarcos castleDateJuly 18, 1195LocationAlarcos, Ciudad Real province 38°57′10″N 4°0′0″W / 38.95278°N 4.00000°W / 38.95278; -4.00000Result Almo...

Glikolisis lengkap Glikolisis berasal dari kata glukosa dan lisis (pemecahan), adalah serangkaian reaksi biokimia di mana glukosa dioksidasi menjadi molekul asam piruvat. Glikolisis adalah salah satu proses metabolisme yang paling universal yang kita kenal, dan terjadi (dengan berbagai variasi) di banyak jenis sel dalam hampir seluruh bentuk organisme. Proses glikolisis sendiri menghasilkan lebih sedikit energi per molekul glukosa dibandingkan dengan oksidasi aerobik yang sempurna. Energi yan...

 

 

日本 > 東京都 > 中央区 > 日本橋室町 日本橋室町 町丁 三越前駅 三井タワー脇出入口(2007年12月11日) 日本橋室町日本橋室町の位置 北緯35度41分7.43秒 東経139度46分31.07秒 / 北緯35.6853972度 東経139.7752972度 / 35.6853972; 139.7752972国 日本都道府県 東京都特別区 中央区地域 日本橋地域人口(2019年(令和元年)9月1日現在)[1] • 合�...