Advertisement

OPTRAN - A language/system for the specification of program transformations: System overview and experiences

  • Peter Lipps
  • Ulrich Möncke
  • Reinhard Wilhelm
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 371)

Abstract

OPTRAN is a batch-oriented system for the generation of compilers that support program transformations. Programs are represented by attributed abstract syntax trees (AAST). The transformation of AAST's is a powerful method to describe problems in compiler writing such as machine-independent optimisations, language-based editors, and source-to-source translations.

The specification language OPTRAN allows for a static and declarative description of tree transformations. Given such a specification, the system will automatically generate the transformation system, mainly consisting of an attribute evaluator and reevaluator, as well as a tree analyzer and transformer.

The paper presents an introduction to the description mechanisms together with an overview of the system, showing the interaction of several generators. The main goal of the system design is the usage of precomputation methods wherever possible. This generative approach is explained. The static view of transformations makes it possible to generate highly efficient transformers but also has its limitations, which we mention.

The system is written in Pascal and generates Pascal programs. Pascal also serves as host language, i.e. semantic rules are specified as Pascal procedures. This complicates the error diagnosis of the runtime system as the semantics of these procedures is not obvious to the generator system. Furthermore it inhibits the recognition of certain properties of the specification like invariance of attribute assignments under non-trivial transformations.

We report practical experiences for some applications, e.g. a compiler for MiniPascal producing M68000 code and a frontend for Ada producing DIANA intermediate descriptions. [Li88] contains an annotated bibliography on OPTRAN.

Keywords

Transformation Unit Input Pattern Transformation Rule Rule Application Diploma Thesis 
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

  1. [BMR85]
    Badt, P., P. Raber, and U. Möncke, Attributation Schemata for List-Structured Nodes, ESPRIT: PROSPECTRA Project Report S.1.3-R-1.0, FB 10 — Informatik, Universität des Saarlandes, 1985.Google Scholar
  2. [BMR86]
    Badt, P., P. Raber, and U. Möncke, Specification of Recursive Patterns, ESPRIT: PROSPECTRA Project Report S.1.6-SN-4.0, FB 10 — Informatik, Universität des Saarlandes, 1986.Google Scholar
  3. [BMW87]
    Börstler, J., U. Möncke, and R. Wilhelm, Table Compression for Tree Automata, Aachener Informatik Berichte No. 87-12, RWTH Aachen, Fachgruppe Informatik, Aachen, 1987.Google Scholar
  4. [Ba86]
    Badt, P., OPTRAN — Ein System zur Generierung von Baumtransformatoren: Rekursive Schablonen und Listenkonstrukte, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  5. [Eu88]
    Eulenstein, M., POCO — Ein portables System zur Generierung portabler Compiler, Informatik Fachberichte 164,1988.Google Scholar
  6. [FY86]
    Farrow, R. and D. Yellin, A Comparison of Storage Optimizations in Automatically-Generated Attribute Evaluators, Acta Informatica 23(4),Springer-Verlag, 1986.Google Scholar
  7. [GMW80]
    Glasner, I., U. Möncke, and R. Wilhelm, OPTRAN — A Language for the Specification of Program Transformations, pp. 125–142 in Informatik Fachberichte, 7th GI Workshop on Programming Languages and Program Development, Springer-Verlag, 1980.Google Scholar
  8. [GMW81]
    Giegerich, R., U. Möncke, and R. Wilhelm, Invariance of Approximative Semantics with respect to Program Transformations, pp. 1–10 in 11. GI Fachtagung für Programmiersprachen und Programmentwicklung,Informatik Fachberichte 50,, Springer-Verlag, 1981.Google Scholar
  9. [GPSW86]
    Greim, M., St. Pistorius, M. Solsbacher, and B. Weisgerber, POPSY and OPTRAN-Manual, ESPRIT: PROSPECTRA-Project Report, S.1.6-R-3.0, Technical Report No. A 08/86, FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  10. [He86a]
    Heckmann, R., An efficient ELL(1)-Parser Generator, Acta Informatica 23, pp. 127–148, 1986.Google Scholar
  11. [He86b]
    Heckmann, R., Manual for the ELL(2)-Parser Generator and Tree Generator Generator, Technical Report No. A 05/86, FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  12. [He88]
    Heckmann, R., A Functional Language for the Specification of Complex Tree Transformations, Proceedings of the 2nd European Symposium on Programming (ESOP'88), LNCS 300,, pp. 175–190, Springer-VerlagGoogle Scholar
  13. [Ho86]
    Hoover, R., Dynamically Bypassing Copy Rule Chains in Attribute Grammars, ACM Symposium on Principles of Programming Languages, January 1986.Google Scholar
  14. [Ho88]
    Horsch, G., Source-to-source-Transformationen: Eine Studie des Compiler-Generierenden Systems OPTRAN anhand eines SPL4→C-Compilers, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  15. [KM88]
    Keller, P. and Th. Maas, An OPTRAN generated Ada→DIANA frontend, Technical Report (forthcoming), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  16. [KW76]
    Kennedy, K. and S.K. Warren, Automatic Generation of Efficient Evaluators for Attribute Grammars, Conf. Record of 3rd Symposium on Principles of Programming Languages,, pp. 32–49, 1976.Google Scholar
  17. [Ke88]
    Keller, P., Spezifikation und Implementierung eines Compilerfrontends für Ada: Deklarations-und Nameclassanalyse, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  18. [LMOW87]
    Lipps, P., M. Olk, U. Möncke, and R. Wilhelm, Attribute (Re)evaluation in OPTRAN, ESPRIT: PROSPECTRA Project Report S.1.3-R-5.0, FB 10 — Informatik, Universität des Saarlandes, 1987. (to be published in Acta Informatica)Google Scholar
  19. [Li88]
    Lipps, P., OPTRAN: A Language/System for the Specification of Program Transformations — Annotated Bibliography, Internal Report, FB 10 — Informatik, Universität des Saarlandes, 1988.Google Scholar
  20. [Li86]
    Lipps, P., Komplexe Attribute — Mechanismen zur Verwaltung und Berechnung in einem baumtransformierenden System, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  21. [MW83]
    Möncke, U. and R. Wilhelm, Iterative algorithms on grammar graphs, pp. 177–194 in Proc. 8th Conference on Graphtheoretic Concepts in Computer Science, ed. H.J. Schneider, H. Goettler, Hanser Verlag, München, 1983.Google Scholar
  22. [MWW84]
    Möncke, U., B. Weisgerber, and R. Wilhelm, How to implement a system for manipulation of attributed trees, pp. 112–127 in Informatik Fachberichte, 8th GI Workshop on Programming Languages and Program Development, Springer-Verlag, Zürich, March 1984.Google Scholar
  23. [MWW86]
    Möncke, U., B. Weisgerber, and R. Wilhelm, Generative support for transformational programming, pp. 511–527 in ESPRIT: Status Report of Continuing Work, Elsevier Sc., Brussels, 1986.Google Scholar
  24. [Mö85]
    Möncke, U., Generierung von Systemen zur Transformation attributierter Operatorbäume — Komponenten des Systems und Mechanismen der Generierung, Ph.D. Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1985.Google Scholar
  25. [Mö86a]
    Möncke, U., Grammar Flow Analysis, ESPRIT: PROSPECTRA-Project Report S.1.3-R-2.1, FB 10 — Informatik, Universität des Saarlandes, 1986. (submitted for publication)Google Scholar
  26. [Mö86b]
    Möncke, U., Production Local Attributes, ESPRIT: PROSPECTRA-Project Study Notes, S.1.3-SN-3.0, FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  27. [Mö87]
    Möncke, U., Simulating Automata for Weighted Tree Reductions, ESPRIT: PROSPECTRA-Project Report S.1.6-R-5.1 and Technical Report No. A 10/87, FB 10 — Informatik, Universität des Saarlandes, 1987.Google Scholar
  28. [Ma88]
    Mass, T., Spezifikation und Implementierung eines Compilerfrontends für Ada: Auflösung der Überladung und Erzeugung von DIANA, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  29. [Ol86]
    Olk, M., Generierung eines effizienten Attributschedulers für ein baumtransformierendes System, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  30. [Ra86]
    Raber, P., Listenkonstrukte und ihre Attributierung in einem System zur Generierung von Baumtransformatoren, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  31. [Ra86]
    Rauber, Th., Registerverteilung und Codeselektion für wechselnde Zielmaschinen, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  32. [Re82]
    Reps, Th., Generating Language-Based Environments, Ph.D. Thesis, Cornell University, 1982.Google Scholar
  33. [SSW82]
    Schmigalla, M., A. Schütte, and B. Weisgerber, OPTRAN'82-Manual, Internal Report, FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, December 1982.Google Scholar
  34. [Th88]
    Thome, W., Ein Konzept zur Bibliotheksverwaltung von Transformationseinheiten und deren Hintereinanderschaltung, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  35. [Ti88]
    Tieser, E., Attributauswertung für zyklische Attributierung, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1988.Google Scholar
  36. [Ti86]
    Tittelbach, H., Effiziente Attributspeicherverwaltung für ein baumtransformierendes System, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1986.Google Scholar
  37. [We83]
    Weisgerber, B., Attributierte Transformationsgrammatiken: Die Baumanalyse und Untersuchungen zu Transformationsstrategien, Diploma Thesis (in german), FB 10 — Informatik, Universität des Saarlandes, Saarbrücken, 1983.Google Scholar
  38. [Wi79a]
    Wilhelm, R., Computation and Use of Data Flow Information in Optimizing Compilers, Acta Informatica 12, pp. 209–225, Springer-Verlag, 1979.Google Scholar
  39. [Wi81]
    Wilhelm, R., A Modified Tree-To-Tree Correction Problem, Information Processing Letters 12(3), pp. 127–132, North-Holland, 1981.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Peter Lipps
    • 1
  • Ulrich Möncke
    • 1
  • Reinhard Wilhelm
    • 1
  1. 1.FB 10 - InformatikUniversität des SaarlandesSaarbrückenFederal Republic of Germany

Personalised recommendations