Abstract
Transformations of attributed program trees form an essential part of compiler optimizations. A tree transformation may invalidate attribute instances, not only in the restructured part of the tree but also elsewhere in the tree. To make the attribution of the tree correct again a re-evaluator has to be activated.
Criteria are formulated which allow a delay in calling the re-evaluator. These criteria allow a strategy of repeatedly applying alternate attribute evaluation and tree transformation phases. An attribute evaluation phase consists of a tree walk in which all attribute instances receive their correct values. A tree transformation phase consists of a tree walk in which as many tree transformations are performed as possible. The transformation phase is never interrupted to carry out a re-evaluation.
For re-evaluation purposes an incremental simple multi-pass evaluator is presented, which works optimally in the number of recomputations and in the number of visits to subtrees during each pass.
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
Alblas, H.: A characterization of attribute evaluation in passes. Acta Informatica 16, 427–464 (1981).
Alblas, H.: Incremental simple multi-pass attribute evaluation. Proc. NGI-SION 1986 Symposium (1986), pp. 319–342.
Alblas, H.: Optimal incremental simple multi-pass attribute evaluation. Memorandum INF 86-27, University of Twente (1986).
Alblas, H.: Iteration of transformation passes over attributed program trees. Memorandum INF 87-28, University of Twente (1987).
Alblas, H.: Attribute evaluation methods. Memorandum, University of Twente, to appear (1988).
DeRemer, F.L.: Transformational grammars. In: Compiler Construction: An advanced course, F.L. Bauer, J. Eickel (eds.). Lecture Notes in Computer Science, Vol. 21, Springer 1974, pp. 121–145.
Engelfriet, J.: Attribute grammars: Attribute evaluation methods. In: Methods and tools for compiler construction. Cambridge University Press 1984, pp. 103–138.
Engelfriet, J., Filè, G.: Simple multi-visit attribute grammars, JCSS 24, 283–314 (1982).
Ganzinger, H. and Giegerich, R.: A truly generative semantics directed compiler generator. In: Proc. SIGPLAN 1982 Symposium on Compiler Construction, SIGPLAN Notices 17, 6 (1982), pp. 172–184.
Giegerich, R., Möncke, U., Wilhelm, R.: Invariance of approximative semantics with respect to program transformations. Informatik-Fachberichte 50, Springer 1981, pp. 1–10.
Glasner, I., Möncke, U., Wilhelm, R.: OPTRAN, a language for the specification of program transformations. Informatik-Fachberichte 34, Springer 1980, pp. 125–142.
Kastens, U.: Ordered attribute grammars. Acta Informatica 13, 229–256 (1980).
Knuth, D.E.: Semantics of context-free languages. Math. Systems Theory 2, 127–145 (1968). Correction in: Math. Systems Theory 5, 95–96 (1971).
Möncke, U., Weisgerber, B., Wilhelm, R.: How to implement a system for manipulation of attributed trees. Informatik-Fachberichte 77, Springer 1984, pp. 112–127.
Nestor, J.R., Mishra, B., Scherlis, W.L., Wulf, W.A.: Extensions to attribute grammars. Technical Report TL 83-36, Tartan Laboratories Inc., 1983.
Reps, T., Teitelbaum, T., Demers, A.: Incremental context-dependent analysis for language based editors. ACM TOPLAS 5, 449–477 (1983).
Wilhelm, R.: Computation and use of data flow information in optimizing compilers. Acta Informatica 12, 209–225 (1979).
Yeh, D.: On incremental evaluation of ordered attribute grammars, BIT 23, 308–320 (1983).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Alblas, H. (1989). Attributed tree transformations with delayed and smart re-evaluation. In: Hammer, D. (eds) Compiler Compilers and High Speed Compilation. CCHSC 1988. Lecture Notes in Computer Science, vol 371. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51364-7_13
Download citation
DOI: https://doi.org/10.1007/3-540-51364-7_13
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51364-3
Online ISBN: 978-3-540-46200-2
eBook Packages: Springer Book Archive