A generator for production quality compilers
1991, Springer eBooks
https://doi.org/10.1007/3-540-53669-8_73Abstract
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 [Mrss86] and the parser generator Coco [ReM689]. 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.
References (11)
- A.V.Aho, R.Sethi, J.D.Ullman: Compilers. Addison-Wesley, 1986.
- H.Dobler, K.Pirklbauer: Coco-2 -A New Compiler Compiler. Technical report 90/1, Institut f'tir Informatik, Universitat Linz, 1990.
- D.E.Knuth: Semantics of Context-Free Languages. Math.Systems Theory 2, 1968.
- H.M6ssenb6ck: Alex -A Simple and Efficient Scanner Generator. SIGPLAN Notices, Vol.21 (5), May 1986.
- H.M6ssenb6ck: Compilererzeugende Systeme fiir Mikrocomputer. Dissertation, Institut fiJr Informatik, Universit~t Linz, 1987.
- H.M6ssenb6ck: Coco/R -A Generator for Fast Compiler Front-Ends. Report 127, Institut f'tir Computersysteme, ETH Zfirich, 1990.
- P.Rechenberg, H.M6ssenb6ck: A Compiler-Generator for Microcomputers. Prentice-Hall, 1989.
- W.M.Waite: The Cost of Lexical Analysis. SOFTWARE Practice & Experience, Vol.16 (5), May 1986.
- N.Wirth: Algorithms + Data S~uctures = Programs. Prentice-Hall, 1976.
- N.Wirth: Compilerbau. Teubner StudienbiJcher, 1986.
- N.Wirth: The Programming Language Oberon. SOFTWARE Practice & Experience, Vo1.18 (7), July 1988.
Hanspeter Mössenböck