You are on page 1of 2

TMG (language)

In computing TMG (TransMoGrifier) is a recursive descent compiler-


TMG
compiler[5] developed by Robert M. McClure and presented in 1965.[6][7][8]
TMG ran on systems including OS/360 and early Unix.[9] It was used to build Designed by Robert M. McClure
EPL, an early version of PL/I.[9] Developer Robert M. McClure
First appeared 1963[1]
Douglas McIlroy ported TMG to an early version of Unix. According to Ken
Dialects
Thompson, McIlroy wrote TMG in TMG on a piece of paper and "decided to
give his piece of paper his piece of paper," hand-compiling assembly language Unix dialect (by Douglas McIlroy)
that he entered and assembled on Thompson's Unix system running on PDP- Influenced
7.[10] Thompson used TMG in 1970 as a tool to offer Fortran, but due to TROL (by Donald Knuth)[2]
memory limitations of PDP-7 ended up creating the B programming language
which was much influenced by BCPL.[6] Unix TMG
The recursive descent algorithm of TMG was studied formally by Alexander
Birman and Jeffrey Ullman. The formal description of the algorithms was
named TMG recognition scheme (or simply TS).[11]

See also
Top-down parsing language
Yacc

References TMG program with highlighted


syntax
1. "Early Translator Writing Systems - Brooker-Morris Compiler
Compiler 1966" (http://www.chilton-computing.org.uk/acl/application Developer Douglas
s/cc/p007.htm#s3p3). Atlas Computer Laboratory. Archived (https://w McIlroy
eb.archive.org/web/20200131192031/http://www.chilton-computing.or First appeared 1969
g.uk/acl/applications/cc/p007.htm) from the original on 31 January
2020. Retrieved 2020-04-12. "TMG, ... comes later but appears to Filename .t
have not been influenced by the earlier systems [Alick Glennie's extensions
1960 Syntax Machine, Ned Irons 1960 PSYCO compiler, or Brooker Dialects
and Morris's 1960 Compiler-Compiler]."
PDP-7 version, PDP-11 version
2. Knuth, Donald (1990). P. Deransart; M. Jourdan (eds.). "The Genesis
of Attribute Grammars" (https://www.dcs.warwick.ac.uk/~sk/cs325/ga Influenced by
g.pdf) (PDF). Proceedings of the International Conference on ALGOL 68,[3] B, PL/I, SNOBOL[4]
Attribute Grammars and Their Applications (Paris, France). Lecture
Influenced
Notes in Computer Science. 461. New York: Springer-Verlag: 1–12.
doi:10.1007/3-540-53101-7_1 (https://doi.org/10.1007%2F3-540-531 B, Yacc
01-7_1). ISBN 978-3-540-53101-2.
3. Ritchie, Dennis M. (April 1993). The Development of the C Language
(https://www.bell-labs.com/usr/dmr/www/chist.pdf) (PDF). Association
for Computing Machinery, Inc.
4. McIlroy, M. D. (September 13, 1972). A Manual for the Tmg
Compiler-writing Language (https://amakukha.github.io/tmg/TMG_Ma
nual_McIlroy_1972.html) (Technical report). Murray Hill, New Jersey:
Bell Laboratories. Retrieved 31 January 2020.
5. "M. Douglas McIlroy" (https://www.cs.dartmouth.edu/~doug/). Dartmouth College. Archived (https://web.a
rchive.org/web/20200201043232/https://www.cs.dartmouth.edu/~doug/) from the original on 1 February
2020. Retrieved 2020-04-12. "Some things I have worked on: Languages and compilers: macros, Lisp,
PL/I, TMG (a compiler-compiler), regular expressions; influenced Snobol, Altran, C++ ..."
6. Ritchie, Dennis M. "The Evolution of the Unix Time-sharing System*" (https://web.archive.org/web/20140
908034458/http://cm.bell-labs.com/cm/cs/who/dmr/hist.html). Archived from the original (http://cm.bell-lab
s.com/cm/cs/who/dmr/hist.html) on 8 September 2014. Retrieved 9 April 2004. "Every program for the
original PDP-7 Unix system was written in assembly language, and bare assembly language it was—for
example, there were no macros. Moreover, there was no loader or link-editor, so every program had to
be complete in itself. The first interesting language to appear was a version of McClure's TMG that was
implemented by McIlroy. Soon after TMG became available, Thompson decided that we could not
pretend to offer a real computing service without Fortran, so he sat down to write a Fortran in TMG. As I
recall, the intent to handle Fortran lasted about a week. What he produced instead was a definition of
and a compiler for the new language B."
7. McClure, R.M. (1965). "TMG—A Syntax-Directed Compiler" (https://dl.acm.org/citation.cfm?id=806050&p
reflayout=flat). In L. Winner (ed.). Proceedings of the 1965 20th national conference (ACM '65). ACM.
pp. 262–274. doi:10.1145/800197.806050 (https://doi.org/10.1145%2F800197.806050). S2CID 44606611
(https://api.semanticscholar.org/CorpusID:44606611).
8. McIlroy, M. D. (1987). A Research UNIX Reader: Annotated Excerpts from the Programmer’s Manual,
1971-1986 (http://www.cs.dartmouth.edu/~doug/reader.pdf) (PDF) (Technical report). CSTR. Bell Labs.
139. Archived (https://web.archive.org/web/20200411235037/https://www.cs.dartmouth.edu/~doug/reade
r.pdf) (PDF) from the original on 11 April 2020. "Doug (M. Douglas) McIlroy exercised the right of a
department head to muscle in on the original two-user PDP-7 system. Later he contributed an eclectic
bag of utilities: tmg for compiler writing, speak for reading text aloud, diff, and join. He also collected
dictionaries and made tools to use them: look (v7, after a model by Ossanna), dict (v8), and spell (v7). ...
On the tiny PDP-7 the assembler was supplemented by tmg, Doug McIlroy's version of Bob McClure's
compiler-compiler. ... V2 saw a burst of languages: a new tmg, ... and Ritchie's first C,"
9. "TMG" (https://www.multicians.org/tmg.html). www.multicians.org. Archived (https://web.archive.org/web/
20200102213003/https://www.multicians.org/tmg.html) from the original on 2 January 2020. Retrieved
2020-04-12. "... TMG that runs under OS360 (sic) ... Mike Green took Bob McClure's 7090/7040 version
and implemented the compiler-compiler on the 360; ... TMG was the compiler definition tool used by Ken
Thompson to write the compiler for the B language on his PDP-7 in 1970. B was the immediate ancestor
of C."
10. Ken Thompson. "VCF East 2019 -- Brian Kernighan interviews Ken Thompson" (https://www.youtube.co
m/watch?v=EY6q5dv_B-o&t=2330). YouTube. Retrieved 2019-10-28.
11. Birman, Alexander; Ullman, Jeffrey D (1973). "Parsing algorithms with backtrack". Information and
Control. 23 (1). Elsevier B.V: 1–34. doi:10.1016/S0019-9958(73)90851-6 (https://doi.org/10.1016%2FS00
19-9958%2873%2990851-6). ISSN 0019-9958 (https://www.worldcat.org/issn/0019-9958).

External links
"TMG – Compiler writing language" (https://web.archive.org/web/20070921161049/http://hopl.murdoch.e
du.au/showlanguage.prx?exp=242). HOPL: Online Historical Encyclopaedia of Programming Languages.
Archived from the original (http://hopl.murdoch.edu.au/showlanguage.prx?exp=242) on September 21,
2007.
Port of Unix TMG (https://github.com/amakukha/tmg) on GitHub

Retrieved from "https://en.wikipedia.org/w/index.php?title=TMG_(language)&oldid=1167043241"

You might also like