Compiler-compiler: Difference between revisions

Content deleted Content added
m General + punct fixes
Line 10:
The input of a parser generator is a [[formal grammar|grammar]] file, typically written in [[Backus–Naur form]] (BNF) or [[extended Backus–Naur form]] (EBNF) that defines the [[Syntax (programming languages)|syntax]] of a target programming language.
 
The output is the [[source code]] of a parser for the programming language. The output of the (compiled) parser source code is a parser. It may be either standalone or embedded. This parser takes as an input the source code of the target programming language source and performs some action or outputs an [[abstract syntax tree]] (AST).
 
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>
Line 30:
 
===Metacompilers===
<{{blockquote>|Metacompilers reduce the task of writing compilers by automating the aspects that are the same regardless of the [[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]] [[object language]]s to a point where it becomes economically feasible to include in the solution of a problem a [[___domain-specific language]] design.<ref name="CWIC"/></blockquote>}}
 
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 58:
 
==History==
The first compiler-compiler to use that name was written by [[Tony Brooker]] in 1960 and was used to create compilers for the [[Atlas (computer)|Atlas]] computer at the [[University of Manchester]], including the [[Atlas Autocode]] compiler.{{factcitation needed|date=May 2020}}
 
The early history of metacompilers is closely tied with the history of SIG/PLAN Working group 1 on Syntax Driven Compilers. The group was started primarily through the effort of Howard Metcalfe in the Los Angeles area.<ref name="Metcalfe1"/> In the fall of 1962 Howard Metcalfe designed two compiler-writing interpreters. One used a bottom-to-top analysis technique based on a method described by Ledley and Wilson.<ref name="Ledleyl"/> The other used a top-to-bottom approach based on a work by Glennie to generate random English sentences from a context-free grammar.<ref name="Glenniel"/>
Line 64:
At the same time, Val Schorre described two "meta machines", one generative and one analytic. The generative machine was implemented and produced random algebraic expressions. Meta I the first metacompiler was implemented by Schorre on an IBM 1401 at UCLA in January 1963. His original interpreters and metamachines were written directly in a pseudo-machine language. [[META II]], however, was written in a higher-level metalanguage able to describe its own compilation into the pseudo-machine language.<ref name="METAII"/><ref name="SMALGOL"/><ref name="META1"/>
 
Lee Schmidt at Bolt, Beranek, and Newman wrote a metacompiler in March 1963 that utilized a CRT display on the time-sharing PDP-l.<ref name="Schmidt1"/> This compiler produced actual machine code rather than interpretive code and was partially bootstrapped from Meta I.{{factcitation needed|date=May 2020}}
 
Schorre bootstrapped Meta II from Meta I during the Spring of 1963. The paper on the refined metacompiler system presented at the 1964 Philadelphia ACM conference is the first paper on a metacompiler available as a general reference. The syntax and implementation technique of Schorre's system laid the foundation for most of the systems that followed. The system was implemented on a small 1401, and was used to implement a small [[ALGOL]]-like language.{{factcitation needed|date=May 2020}}
 
Many similar systems immediately followed.{{factcitation needed|date=May 2020}}
 
Roger Rutman of [[Aptiv|AC Delco]]<!-- Not the same firm as current brand ACDelco. --> developed and implemented LOGIK, a language for logical design simulation, on the IBM 7090 in January 1964.<ref name="Rutman1"/> This compiler used an algorithm that produced efficient code for Boolean expressions.{{factcitation needed|date=May 2020}}
 
Another paper in the 1964 ACM proceedings describes [http://dl.acm.org/citation.cfm?id=808898 Meta III], developed by [http://www.peacham.com/ Schneider] and Johnson at UCLA for the IBM 7090.<ref name="Schneiderl"/> Meta III represents an attempt to produce efficient machine code, for a large class of languages. Meta III was implemented completely in assembly language. Two compilers were written in Meta III, CODOL, a compiler-writing demonstration compiler, and PUREGOL, a dialect of ALGOL 60. (It was pure gall to call it ALGOL).