A generator for production quality compilers

  • Hanspeter Mössenböck
Invited Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 477)


This paper presents a compiler description language and its implementation Coco/R (Compiler Compiler for Recursive Descent). Coco/R reads an attributed EBNF grammar of a language and translates it into a recursive descent parser and a scanner for that language. The programmer has to supply a main program that calls the parser and semantic modules that are called from within the parser. Coco/R evolved from two predecessors: the scanner generator Alex [Möss86] and the parser generator Coco [ReMö89]. Their input languages were merged and simplified due to our experiences with these tools over several years (a similar tool with a slightly different motivation also emerged from Alex and Coco [DoPi90]). Using Coco/R, compilers can be generated that are as efficient as hand-coded and carefully optimized production quality compilers. Almost as important as efficiency is the simplicity and adequacy of the system. Programmers are not willing to use a tool if it does not come in handy to their work, if it uses an arcane notation or a bulk of options and special cases. Coco/R puts simplicity and efficiency over power.


  1. [ASU86]
    A.V.Aho, R.Sethi, J.D.Ullman: Compilers. Addison-Wesley, 1986.Google Scholar
  2. [DoPi90]
    H.Dobler, K.Pirklbauer: Coco-2 — A New Compiler Compiler. Technical report 90/1, Institut für Informatik, Universität Linz, 1990.Google Scholar
  3. [Knuth68]
    D.E.Knuth: Semantics of Context-Free Languages. Math.Systems Theory 2, 1968.Google Scholar
  4. [Möss86]
    H.Mössenböck: Alex — A Simple and Efficient Scanner Generator. SIGPLAN Notices, Vol.21 (5), May 1986.Google Scholar
  5. [Möss87]
    H.Mössenböck: Compilererzeugende Systeme für Mikrocomputer. Dissertation, Institut für Informatik, Universität Linz, 1987.Google Scholar
  6. [Möss90]
    H.Mössenböck: Coco/R — A Generator for Fast Compiler Front-Ends. Report 127, Institut für Computersysteme, ETH Zürich, 1990.Google Scholar
  7. [ReMö89]
    P.Rechenberg, H.Mössenböck: A Compiler-Generator for Microcomputers. Prentice-Hall, 1989.Google Scholar
  8. [Waite86]
    W.M.Waite: The Cost of Lexical Analysis. SOFTWARE Practice & Experience, Vol.16 (5), May 1986.Google Scholar
  9. [Wirth76]
    N.Wirth: Algorithms + Data Structures = Programs. Prentice-Hall, 1976.Google Scholar
  10. [Wirth86]
    N.Wirth: Compilerbau. Teubner Studienbücher, 1986.Google Scholar
  11. [Wirth88]
    N.Wirth: The Programming Language Oberon. SOFTWARE Practice & Experience, Vol.18 (7), July 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Hanspeter Mössenböck
    • 1
  1. 1.Institut für Computersysteme ETH-ZentrumETH ZürichZürich

Personalised recommendations