A formal semantics for computer languages and its application in a compiler-compiler

e l y g e r m a n dissemine puters. t h e publics well t r y) adopt net r to be o:. f o r m e d i n t c o m p o s i t i o : b e u s e d t,. t y p e s e t t i n g r o c e s s c o u l i h a s a u t h o ~ a t e ~ t i d e n t in d r e t r i e v e [ t a n s w e r t(b e f o r e t h e s e f a s h i o n , i: tndle m a n n-T h e follow. A semantic metalanguage has been developed for representing the meanings of statements in a large class of computer languages. This metalanguage has been the basis for construction of an efficient, functioning compiler-compiler. An informal discussion of the metalanguage based on the example of a complete translator for a small language is presented. One of the most significant developments in the study of computer languages has been the formalization of syntax. Besides greatly improving communications between people, formalized syntax has led to new results in the theory and practice of programming. As early as 1960, Irons [7] was able to construct a compiler whose syntax phase was independent of the source language being trans-late& This work and that of other early contributors such as Brooker and 5Iorris [1] led to speculation that the entire compilation process could be automated. The problem was to develop a single program which could act as a translator for a large class of languages differing from each other in substantial ways. To solve this so-called compiler-compiler problem, one must find appropriate formalizations of the syntax and semantics of computer languages. The formalization of semantics for some language, L, will involve representing the meanings of statements in L in terms of an appropriate mete-language. The meanings of statements in the mete-language are assumed to be known (primitive). If L is a computer language, the semantics of L nmst involve a description of its translator. One example of a semantic mete-language is the order code of a computer. An order code or assembly language can certainly describe any translation …