Skip to main content
Log in

One-pass transformations of attributed program trees

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

The classical attribute grammar framework can be extended by allowing the specification of tree transformation rules. A tree transformation rule consists of an input template, an output template, enabling conditions which are predicates on attribute instances of the input template, and re-evaluation rules which define the values of attribute instances of the output template. A tree transformation may invalidate attribute instances which are needed for additional transformations.

In this paper we investigate whether consecutive tree transformations and attribute re-evaluations are safely possible during a single pass over the derivation tree. This check is made at compiler generation time rather than at compilation time.

A graph theoretic characterization of attribute dependencies is given, showing in which cases the recomputation of attribute instances can be done in parallel with tree transformations.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Alblas, H.: A characterization of attribute evaluation in passes. Acta Inf. 16, 427–464 (1981)

    Google Scholar 

  2. Alblas, H.: Finding minimal pass sequences for attribute grammars. SIAM J. Comput. 14, 889–914 (1985)

    Google Scholar 

  3. Alblas, H.: Incremental simple multi-pass attribute evaluation. Proc. NGI/SION Symposium 1986, 319–342 (1986)

    Google Scholar 

  4. Babich, W.A., Jazayeri, M.: The method of attributes for data flow analysis, Part I. Exhaustive analysis. Acta Inf. 10, 245–264 (1978)

    Google Scholar 

  5. Bochmann, G.V.: Semantic evaluation from left to right. Commun. ACM 19, 55–62 (1976)

    Google Scholar 

  6. Demers, A., Reps, T., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. Proc. Eighth ACM Symp. Principles Programm. Lang., pp. 105–116 (1981)

  7. DeRemer, F.L.: Transformational grammars. In: Compiler construction: An Advanced Course. Bauer, F.L., Eickel, J. (eds), Lect. Notes Comput. Sci., Vol. 21, pp. 121–145. Berlin-Heidelberg-New York: Springer 1974

    Google Scholar 

  8. Engelfriet, J.: Attribute grammars: Attribute Evaluation Methods. In: Methods and Tools for Compiler Construction, pp. 103–138. Cambridge University Press 1984

    Google Scholar 

  9. Ganzinger, H., Giegerich, R.: A truly generative semantics directed compiler generator. In: Proc. SIGPLAN 1982 Symposium on Compiler Construction. SIGPLAN Notices 17, 6 172–184 (1982)

    Google Scholar 

  10. Giegerich, R., Möncke, U., Wilhelm, R.: Invariance of approximative semantics with respect to program transformations. In: Informatik-Fachberichte, Vol. 50, pp. 1–10. Berlin-Heidelberg-New York: Springer 1981

    Google Scholar 

  11. Glasner, I., Möncke, U., Wilhelm, R.: OPTRAN, a language for the specification of program transformations. In: Informatik-Fachberichte, Vol. 34, pp. 125–142. Berlin-Heidelberg-New York: Springer 1980

    Google Scholar 

  12. Jazayeri, M., Ogden, W.F., Rounds, W.C.: The intrinsically exponential complexity of the circularity problem for attribute grammars. Commun. ACM 18, 697–706 (1975)

    Google Scholar 

  13. Jazayeri, M.: A simpler construction for showing the intrinsically exponential complexity of the circularity problem for attribute grammars. J. ACM 28, 715–720 (1981)

    Google Scholar 

  14. Jazayeri, M., Walter, K.G.: Alternating semantic evaluator. Proc. ACM 1975 Annual Conference, 230–234 (1975)

    Google Scholar 

  15. Kastens, U.: Ordered attribute grammars. Acta Inf. 13, 229–256 (1980)

    Google Scholar 

  16. Kennedey, K., Warren, S.K.: Automatic generation of efficient evaluators for attribute grammars. Proc. Third ACM Symp. Principles Programm. Lang., pp. 32–49 (1976)

  17. Knuth, D.E.: Semantics of context-free languages. Math. Syst. Theory 2, 127–145 (1968)

    Google Scholar 

  18. Knuth, D.E.: Semantics of context-free languages: Correction. Math. Syst. Theory 5, 95–96 (1971)

    Google Scholar 

  19. Möncke, U., Weisgerber, B., Wilhelm, R.: How to implement a system for manipulation of attributed trees. In: Informatik Fachberichte, Vol. 77, pp. 112–127. Berlin-Heidelberg-New York-Tokyo: Springer 1984

    Google Scholar 

  20. Möncke, U., Wilhelm, R.: Iterative algorithms on grammar graphs. In: Proc 8th Conference on Graphtheoretic Concepts in Computer Science, pp. 177–194. München-Wien: Hanser 1982

    Google Scholar 

  21. Nestor, J.R., Mishra, B., Scherlis, W.L., Wulf, W.A.: Extensions to attribute grammars. Technical Report TL 83-36, Tartan Laboratories Incorporated, 1983

  22. Räihä, K.-J., Saarinen, M.: Testing attribute grammars for circularity. Acta Inf. 17, 185–192 (1982)

    Google Scholar 

  23. Reps, T.: Optimal-time incremental semantic analysis for syntax directed editors. Proc. Ninth ACM Symp. Principles Programm. Lang. pp. 169–176 (1982)

  24. Reps, T., Teitelbaum, T., Demers, A.: Incremental context-dependent analysis for language based editors. ACM Trans. Programm. Lang. 5, 449–477 (1983)

    Google Scholar 

  25. Wilhelm, R.: Computation and use of data flow information in optimizing compilers. Acta Inf. 12, 209–225 (1979)

    Google Scholar 

  26. Yeh, D.: On incremental evaluation of ordered attribute grammars. BIT 23, 308–320 (1983)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Part of this work was done while the author was visiting Tartan Laboratories Inc., Pittsburgh, PA, USA

Rights and permissions

Reprints and permissions

About this article

Cite this article

Alblas, H. One-pass transformations of attributed program trees. Acta Informatica 24, 299–352 (1987). https://doi.org/10.1007/BF00265992

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00265992

Keywords

Navigation