TMG is a string processing language especially intended for writing translators for computer languages. It deals with string scanning, building of tab

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-09-05 03:30:04

TMG is a string processing language especially intended for writing translators for computer languages. It deals with string scanning, building of tables and output generation, and provides some integer arithmetic.

Initially created by Robert McClure (1965) to work on supercomputers and mainframes of the time, TMG was cross-compiled for PDP-7 microcomputer by Douglas McIlroy to work under Unix operating system. Soon after that the language was further developed by McIlroy for Unix on PDP-11, creating a unique and powerful dialect of McClure's TMG. This version of TMG was included into Unix from Version 2 to Version 6, after which it was phased out in favor of Stephen Johnson's YACC.

This is a translation of TMG from PDP-11 assembly to portable C. To the best of our knowledge, it is the first implementation of TMG in a high-level language, done more than 50 years after the tool first appeared.

I was impressed by the metacompiler of Val Schorre and by the more powerful (though less elegant) "transmogrifier" of Bob McClure. I told Peter [Wegner] about my draft manuscript for Chapter 12 of The Art of Computer Programming, which included an example system of a similar kind, called TROL ("Translation-Oriented Language").

Leave a Comment