Abstract
A major problem in deriving a compiler from a formal definition is the production of correct and efficient object code. We propose a solution to this problem in the framework of a compiler writing system where the compilation process may be viewed as successive translations from an attributed abstract syntax to another abstract syntax. The code-generator generator needs two kinds of specifications :
-
an attributed abstract syntax (AAS) of the target machine : it is the description of the I.R. given as input to the code-generator.
-
a target machine description where the basic concepts are hierarchically described by tree-patterns. These tree patterns are terms of the target abstract syntax.
The code generation process is divided into two steps : the instructions selection process and the register allocation one. The instruction selection process applies a set of rewriting rules driven by tree templates derived from the target machine specification to the I.R. term. The register allocation process consists of several evaluation passes of an attributed grammar derived automatically from the target machine specification. The first one sets the constraints on temporaries according to the whole context, the second one does life-time analysis and packing on temporaries, the last one assigns effective resources to temporaries.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Cattell R. G. G.: Automatic Derivation of Code Generators from Machine Description. ACM Transactions on Programming Languages and Systems, Vol. 2, No.2, pp173–199, April 1980.
Davidson J.W., Fraser C.W.: Automatic Generation of Peephole Optimizations. Proceedings of the SIGPLAN 84 Symposium on Compiler Construction, ACM Vol. 19, 6, pp. 111–116, June 1984.
Despland A., Mazaud M., Rakotozafy R.: Code generator generation based on template-driven target term rewriting. Proceedings of Rewriting Techniques and Applications, Bordeaux, France, May 1987 in LNCS no pp 105–120.
Despland A., Mazaud M., Rakotozafy R.: An implementation of retargetable code generators in Prolog. Proceedings of the International Workshop on Programming Language Implementation and Logic Programming, Orleans, France, May 1988 in LNCS no 348 pp 81–104.
Despland A., Mazaud M., Rakotozafy R.: Using rewriting techniques to produce code-generators and proving them correct. Rapport de Recherche INRIA RR 1046. 1989, to appear in Science of Computer Programming.
Deschamp Ph.: PERLUETTE: a compiler producing system using ADTs. Proceedings of International Symposium on Programming, Turin, April 1982.
Emmelmann H., Schrörer F-W., Landwehr R.: BEG Generator for Efficient Back Ends. Proceedings of the SIGPLAN 89, Symposium on Compiler Construction, Portland, 21–23 June 1989.
Fraser C.W., Wendt A.L.: Automatic Generation of Fast Optimizing Code Generators. Proceedings of the SIGPLAN 88 Symposium on Compiler Construction, Sigplan Notices Vol. 23, 7, pp. 79–84, June 1988.
Ganzinger H, Giegerich R.: A truly Generative Semantics-Directed Compiler Generator. Proceedings of the SIGPLAN 82, Symposium on Compiler Construction, ACM SIGPLAN Vol. 17, 6, June 1982.
Gaudel M. C., Deschamp Ph, Mazaud M.: Compiler Construction From High Level Specification. Automatic Program Construction Techniques, Macmillan Inc, 1984.
Ganapathi M., Fischer C.N.: Descriptive-Driven Code Generation Using attributed Grammars. Conference of the Nineth Annual ACM Symposium on Programming Languages.
Graham S.L, Glanville R. S. A New Method for Compiler Code Generation. Conference Record of the Proceedings of the Fifth Annual ACM Symposium on Principles of Programming Languages, pp 231–240, January 1978.
Graham S. L., Henry R. R. & Al: Experiment with a Graham-Glanville Style Code generator. Proceedings of the SIGPLAN 84 Symposium on Compiler Construction, ACM Vol.. 19, 6, June 1984.
Giegerich R. On the structure of Verifiable Code Generator Specifications Proceedings of the SIGPLAN 90 Symposium on Compiler Construction, ACM Vol.. 25, 6, June 1990.
Giegerich R., Schmal K. Code Selection Techniques: Pattern Matching, Tree Parsing, and Inversion of Derivors. Proceedings of the ESOP'88 Nancy, France, March 88 in LNCS no 217 pp 247–268.
Jourdan M., Parigot D., Julie' C., Durin D., Le Bellec C: Design, Implementation and Evaluation of the FNC-2 Attribute Grammar System Proceedings of the SIGPLAN 90 Symposium on Compiler Construction, ACM Vol.. 25, 6, June 1990.
Lee P., Pleban U.: A Realistic Compiler Generator Based on High-Level Semantics. Conference Proceedings of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, January 1987 pp 284–295.
Weisgerber B., Wilhelm R. Two tree pattern matchers for code selection in Compilers Compilers and High Speed Compilation, Berlin oct 88, D. Hammer, ed in LNCS no 371 pp 215–229.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Despland, A., Mazaud, M., Rakotozafy, R. (1991). PAGODE: A back end generator using attribute abstract syntaxes and term rewritings. In: Hammer, D. (eds) Compiler Compilers. CC 1990. Lecture Notes in Computer Science, vol 477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53669-8_76
Download citation
DOI: https://doi.org/10.1007/3-540-53669-8_76
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53669-7
Online ISBN: 978-3-540-46953-7
eBook Packages: Springer Book Archive