ABSTRACT
We focus on the part of a compiler between syntax analysis and code generation. A language is specified by adding semantic rules in a functional notation to the syntax of the language. Starting with a small sublanguage of while statements, the semantics of the statement constructs of C is built up incrementally. Using a small ad hoc code generator, a compiler has automatically been constructed from the semantics. The semantic description is analogous to a syntax directed construction of a flow diagram for a program. In analogy with grammars and parser generators, minimal knowledge of the underlying theory is required.
For the control flow aspects of languages, efficient compilers can quickly be generated.
- 1.J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright, "Initial algebra semantics and continuous algebras," J. ACM24(1), pp. 68-95 (January 1977). Google ScholarDigital Library
- 2.J. W. Thatcher, E. G. Wagner, and J. B. Wright, "More on advice on structuring compilers and proving them correct," pp. 165-188 in Semantics Directed Compiler Generation, ed. N. D. Jones, Lecture Notes in Computer Science 94, Springer-Verlag, Berlin (1980). Google ScholarDigital Library
- 3.A. V. Aho, "Translator writing systems: where do they now stand?," Computer13(8), pp. 9-14 (August 1980). This paper is a guest editor's introduction and overview of a special issue on Translator Writing Systems.Google Scholar
- 4.A. V. Aho and J. D. Ullman, Principles of Compiler Design, Addison-Wesley, Reading MA (1977). Google ScholarDigital Library
- 5.E. R. Anderson, F. C. Belz, and E. K. Blum, "SEMANOL (73): A metalanguage for programming the semantics of programming languages," Acta Informatica6, pp. 109-131 (1976).Google Scholar
- 6.E. R. Anderson, F. C. Belz, and E. K. Blum, "Issues in the formal specification of programming languages," pp. 1-30 in Formal Description of Programming Concepts, ed. E. J. Neuhold, North-Holland, Amsterdam (1978).Google Scholar
- 7.J. W. Backus et al., "The Fortran automatic coding system," Western Joint Computer Conference, pp. 188-198 (1957).Google Scholar
- 8.F. L. Bauer, "Historical remarks on compiler construction," pp. 603-621 in Compiler Construction: An Advanced Course, 2nd edition, ed. F. L. Bauer and J. Eickel, Lecture Notes in Computer Science 21, Springer-Verlag, Berlin (1976). Google ScholarDigital Library
- 9.F. L. Bauer and J. Eickel (eds), Compiler Construction: An Advanced Course, 2nd edition, Lecture Notes in Computer Science 21, Springer-Verlag, Berlin (1976). Google ScholarDigital Library
- 10.D. Bjorner, "Programming languages: Formal development of interpreters and compilers," pp. 1-21 in International Computing Symposium 1977, ed. E. Morlet and D. Ribbens, North-Holland, Amsterdam (1977).Google Scholar
- 11.D. Bjorner and C. B. Jones, The Vienna Development Method: The Meta-Language, Lecture Notes in Computer Science 61, Springer Verlag, Berlin (1978). Google ScholarDigital Library
- 12.R. G. G. Cattell, "Automatic derivation of code generators from machine descriptions," TOPLAS2(2), pp. 173-190 (April 1980). Google ScholarDigital Library
- 13.H. Christiansen and N. D. Jones, "Control flow aspects of an algebraic approach to compiler generation," DAIMI IR-27, Computer Science Department, Aarhus University (July 1981).Google Scholar
- 14.J. W. Davidson and C. W. Fraser, "The design and application of a retargetable peephole optimizer," TOPLAS2(2), pp. 191-202 (April 1980). Google ScholarDigital Library
- 15.J. Feldman and D. Gries, "Translator writing systems," Comm. ACM11(2), pp. 77-113 (February 1968). Google ScholarDigital Library
- 16.H. Ganzinger, "Transforming denotational semantics into practical attribute grammars," pp. 1-69 in Semantics Directed Compiler Generation, ed. N. D. Jones, Lecture Notes in Computer Science 94, Springer-Verlag, Berlin (1980). Google ScholarDigital Library
- 17.M. C. Gaudel, "Specification of compilers as abstract data type representations," pp. 140-164 in Semantics Directed Compiler Generation, ed. N. D. Jones, Lecture Notes in Computer Science 94, Springer-Verlag, Berlin (1980). Google ScholarDigital Library
- 18.M. C. Gaudel, "Compiler generation from formal definition of programming languages: a survey," pp. 96-114 in Formalization of Programming Concepts, Intl. Colloquium, Peniscola, Spain, Lecture Notes in Computer Science 107, Springer-Verlag, Berlin (April 1981). Google ScholarDigital Library
- 19.R. S. Glanville and S. L. Graham, "A new method for compiler code generation (extended abstract)," Fifth Annual ACM Symposium on Principles of Programming Languages, pp. 231-240 (January 1978). Google ScholarDigital Library
- 20.H. H. Goldstine and J. von Neumann, "Planning and coding problems for an electronic computing instrument, Part II, Vol 1.," pp. 80-151 in John von Neumann: Collected Works, Vol. V, Macmillan, New York (1963). The report was prepared for the U.S. Army Ordnance Department in April 1947.Google Scholar
- 21.D. Gries, Compiler Construction for Digital Computers, John Wiley, New York (1971). Google ScholarDigital Library
- 22.S. C. Johnson, "Yacc - yet another compiler compiler," CSTR 32, Bell Laboratories, Murray Hill NJ (July 1975). See the UNIX Programmer's Manual2 Section 19 (January 1979)Google Scholar
- 23.S. C. Johnson, "A tour through the portable C compiler," UNIX Programmer's Manual2 (Section 34) (January 1979).Google Scholar
- 24.W. L. Johnson, J. H. Porter, S. I. Ackley, and D. T. Ross, "Automatic generation of efficient lexical processors using finite state techniques," Comm. ACM11(12), pp. 805-813 (December 1968). Google ScholarDigital Library
- 25.N. D. Jones (ed), Semantics-Directed Compiler Generation, Lecture Notes in Computer Science 94, Springer-Verlag, Berlin (1980). Google ScholarDigital Library
- 26.B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall, Englewood Cliffs NJ (1978). Google ScholarDigital Library
- 27.D. E. Knuth, "History of writing compilers," 1962 ACM National Conference, p. 43,126 (September 1962). Google ScholarDigital Library
- 28.D. E. Knuth, "Semantics of context-free languages," Math. Systems Theory2(2), pp. 127-145 (June 1968). Correction in 5(1) pp. 95-96 (1971).Google Scholar
- 29.M. E. Lesk, "Lex - a lexical analyzer generator," CSTR 39, Bell Laboratories, Murray Hill NJ (October 1975). See the version by M. E. Lesk and E. Schmidt in the UNIX Programmer's Manual2 Section 20 (January 1979)Google Scholar
- 30.P. M. Lewis II, D. J. Rosenkrantz, and R. E. Stearns, Compiler Design Theory, Addison-Wesley, Reading MA (1976). Google ScholarDigital Library
- 31.J. McCarthy, "Towards a mathematical science of computation," pp. 21-28 in Information Processing 1962, ed. C. M. Popplewell, North-Holland, Amsterdam (1963).Google Scholar
- 32.F. L. Morris, "Advice on structuring compilers and proving them correct," ACM Symposium on Principles of Programming Languages, Boston MA, pp. 144-152 (October 1973). Google ScholarDigital Library
- 33.P. D. Mosses, "SIS - semantics implementation system: Reference manual and user guide," DAIMI MD-30, Department of Computer Science, University of Aarhus, Denmark (August 1979).Google Scholar
- 34.P. D. Mosses, "A constructive approach to compiler correctness," pp. 449-469 in Automata, Languages and Programming, 7th Colloquium, Noordwijkerhout, Lecture Notes in Computer Science 85, Springer-Verlag, Berlin (July 1980). Google ScholarDigital Library
- 35.P. D. Mosses, "A semantic algebra for binding constructs," pp. 408-418 in Formalization of Programming Concepts, Intl. Colloquium, Peniscola, Spain, Lecture Notes in Computer Science 107,| Springer-Verlag, Berlin (April 1981). Google ScholarDigital Library
- 36.L. Paulson, "A semantics-directed compiler generator," manuscript (to appear).Google Scholar
- 37.K.-J. Raiha, "Bibliography on attribute grammars," SIGPLAN Notices15(3), pp. 35-44 (March 1980).Google Scholar
- 38.J.-C. Raoult and R. Sethi, "Properties of a notation for combining functions," in Automata, Languages and Programming, 9th Colloquium, Aarhus, Lecture Notes in Computer Science, Springer-Verlag, Berlin (July 1982). Google ScholarDigital Library
- 39.M. Raskovsky and P. Collier, "From standard to implementation denotational semantics," pp. 94-139 in Semantics Directed Compiler Generation, ed. N. D. Jones, Lecture Notes in Computer Science 94, Springer-Verlag, Berlin (1980). Google ScholarDigital Library
- 40.D. M. Ritchie, "A tour through, the UNIX C compiler," UNIX Programmer's Manual2(Section 33) January 1979).Google Scholar
- 41.D. S. Scott and C. Strachey, Towards a mathematical semantics for computer languages, Polytechnic Press, Brooklyn, New York (April 1971).Google Scholar
- 42.R. Sethi, "Control flow aspects of semantics directed compiling," TR 98, Bell Laboratories, Murray Hill NJ (September 1981).Google Scholar
- 43.R. Sethi, "Circular expressions: elimination of static environments," Science of Computer Programming1(3), For an earlier version, see Lecture Notes in Computer Science 115, (1982).Google Scholar
- 44.J. E. Stoy, Denotational Semantics, MIT Press, Cambridge MA (1977).Google Scholar
- 45.C. Strachey and C. Wadsworth, "Continuations: a mathematical semantics which can deal with full jumps," Technical Monograph PRG-11, Programming Research Group, Oxford University (1974).Google Scholar
- 46.R. D. Tennent, "The denotational semantics of programming languages," Comm. ACM19(8), pp. 437-453 (August 1976). Google ScholarDigital Library
- 47.D. A. Turner, "A new implementation technique for applicative languages," Software - Practice and Experience9(1), pp. 31-49 January 1979).Google Scholar
- 48.M. Wand, "Deriving target code as a representation of continuation semantics," TR 94, Computer Science Department, Indiana University, Bloomington IN (July 1980).Google Scholar
- 49.M. Wand, "Different advice on structuring compilers and proving them correct," TR 95, Computer Science Department, Indiana University, Bloomington IN (September 1980).Google Scholar
Index Terms
- Control flow aspects of semantics directed compiling (Summary)
Recommendations
Control flow aspects of semantics directed compiling (Summary)
Proceedings of the 1982 SIGPLAN symposium on Compiler constructionWe focus on the part of a compiler between syntax analysis and code generation. A language is specified by adding semantic rules in a functional notation to the syntax of the language. Starting with a small sublanguage of while statements, the semantics ...
A truly generative semantics-directed compiler generator
Proceedings of the 1982 SIGPLAN symposium on Compiler constructionThis paper describes semantic processing in the compiler generating system MUG2. MUG2 accepts high-level descriptions of the semantics of a programming language including full runtime semantics, data flow analysis, and optimizing transformations. This ...
Comments