Compiler-compiler: Difference between revisions

Content deleted Content added
m v2.05 - Repaired 1 link to disambiguation page - (You can help) - Object language
Undid revision 1177521741 by The Banner (talk) metalanguage is wrong in context; no page for this meaning of object language; cite conference
Line 14:
Parser generators do not handle the [[Semantics (computer science)|semantics]] of the AST, or the [[Code generation (compiler)|generation of machine code]] for the target machine.<ref name="name">"A Syntax Directed Compiler for ALGOL 60" Edgar T. Irons, Communications of the ACM Volume 4 Issue 1, Jan. 1961.</ref>
 
A '''metacompiler''' is a software development tool used mainly in the construction of [[compiler]]s, [[Translator (computing)|translators]], and [[interpreter (computing)|interpreters]] for other programming languages.<ref name="McGraw"/> The input to a metacompiler is a [[computer program]] written in a [[Domain-specific language|specialized]] programming [[metalanguage]] designed mainly for the purpose of constructing compilers.<ref name="McGraw"/><ref name="CWIC"/> The language of the compiler produced is called the object language. The minimal input producing a compiler is a [[Metaprogramming|metaprogram]] specifying the [[Metalanguage|object language]] grammar and [[Semantics (computer science)|semantic]] transformations into an [[object program]].<ref name="CWIC"/><ref name="TMETA"/>
 
== Variants ==
Line 30:
 
===Metacompilers===
{{blockquote|Metacompilers reduce the task of writing compilers by automating the aspects that are the same regardless of the [[Metalanguage|object language]]. This makes possible the design of [[___domain-specific language]]s which are appropriate to the specification of a particular problem. A metacompiler reduces the cost of producing [[Translator (computing)|translator]]s for such [[___domain-specific language|___domain-specific]] [[Metalanguage|object language]]slanguages to a point where it becomes economically feasible to include in the solution of a problem a [[___domain-specific language]] design.<ref name="CWIC"/>}}
 
As a metacompiler's [[metalanguage]] will usually be a powerful string and symbol processing language, they often have strong applications for general-purpose applications, including generating a wide range of other software engineering and analysis tools.<ref name="CWIC"/><ref name="bayfront"/>
Line 78:
In 1964, System Development Corporation began a major effort in the development of metacompilers. This effort includes powerful metacompilers, Bookl, and Book2 written in [[Lisp (programming language)|Lisp]] which have extensive tree-searching and backup ability. An outgrowth of one of the [[AN/FSQ-32|Q-32]] systems at SDC is Meta 5.<ref name=Oppenheim/> The Meta 5 system incorporates backup of the input stream and enough other facilities to parse any context-sensitive language. This system was successfully released to a wide number of users and had many string-manipulation applications other than compiling. It has many elaborate push-down stacks, attribute setting and testing facilities, and output mechanisms. That Meta 5 successfully translates [[JOVIAL]] programs to [[PL/I]] programs demonstrates its power and flexibility.
 
Robert McClure at [[Texas Instruments]] invented a compiler-compiler called [[TMG (language)|TMG]] (presented in 1965). TMG was used to create early compilers for programming languages like [[B (programming language)|B]], [[PL/I]] and [[ALTRAN]]. Together with metacompiler of Val Schorre, it was an early inspiration for the last chapter of [[Donald Knuth]]'s ''[[The Art of Computer Programming]]''.<ref>{{cite bookconference |firstconference=DonaldInternational |last=KnuthConference on |title=Attribute Grammars and theirTheir Applications| first=Donald |chapterlast=Knuth |title=The genesis of attribute grammars |chapter-url=https://www.dcs.warwick.ac.uk/~sk/cs325/gag.pdf |___location=New York |journalbook-title=Proceedings of the International Conference on Attribute Grammars and Their Applications (Paris, France) |volume=461 |pages=1–12 |editor=P. Deransart |editor2=M. Jourdan |publisher=Springer-Verlag |year=1990 |doi=10.1007/3-540-53101-7_1 |isbn=978-3-540-53101-2 |citeseerx=10.1.1.105.5365 |series=Lecture Notes in Computer Science |access-date=2020-02-06 |archive-date=2020-11-23 |archive-url=https://web.archive.org/web/20201123154647/https://www.dcs.warwick.ac.uk/~sk/cs325/gag.pdf |url-status=live }}</ref>
 
The LOT system was developed during 1966 at Stanford Research Institute and was modeled very closely after Meta II.<ref name="Kirkleyl"/> It had new special-purpose constructs allowing it to generate a compiler which could in turn, compile a subset of PL/I. This system had extensive statistic-gathering facilities and was used to study the characteristics of top-down analysis.