Formal compiler descriptions serve two purposes: (1) they can be used as a reference document which specifies the syntax and the semantics of a language, and (2) they provide a convenient notation from which efficient compilers can be generated. Compiler generating systems put emphasis on either the one or the other of these aspects. The system described in this report mainly concentrates on the second goal. We show that it is possible to generate compilers that are as efficient as hand-coded and carefully optimized production-quality compilers. Our system generates recursive descent parsers with a simple error-handling mechanism and scanners with a special buffering scheme. 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 in their work, if it uses a cryptic notation or a multitude of options and special cases. The tool should make their work easier without limiting their flexibility. We used our system to generate an Oberon compiler that is even faster than the standard Oberon compiler used at ETH.
[1]
Uwe Kastens,et al.
GAG: A Practical Compiler Generator
,
1982,
Lecture Notes in Computer Science.
[2]
Niklaus Wirth,et al.
Algorithms + Data Structures = Programs
,
1976
.
[3]
Hanspeter Mössenböck,et al.
A compiler generator for microcomputers
,
1989
.
[4]
Murray Hill,et al.
Yacc: Yet Another Compiler-Compiler
,
1978
.
[5]
Josef Grosch.
Generators for High-Speed Front-Ends
,
1988,
CC.
[6]
Robert Giegerich,et al.
Attribute coupled grammars
,
1984,
SIGPLAN '84.
[7]
Hanspeter Mössenböck,et al.
Compilererzeugende Systeme für Mikrocomputer
,
1987
.
[8]
Heinz Dobler,et al.
Coco-2: a new compiler compiler
,
1990,
SIGP.
[9]
Niklaus Wirth,et al.
The programming language oberon
,
1988,
Softw. Pract. Exp..
[10]
William M. Waite,et al.
The cost of lexical analysis
,
1986,
Softw. Pract. Exp..