×

Declarative rewriting through circular nonterminal attributes. (English) Zbl 1387.68150

Summary: Reference attribute grammars (RAGs) provide a practical declarative means to implement programming language compilers and other tools. RAGs have previously been extended to support nonterminal attributes (also known as higher-order attributes), circular attributes, and context-dependent declarative rewrites of the abstract syntax tree. In this previous work, interdependencies between these extensions are not considered. In this article, we investigate how these extensions can interact, and still be well defined. We introduce a generalized evaluation algorithm that can handle grammars where circular attributes and rewrites are interdependent. To this end, we introduce circular nonterminal attributes, and show how RAG rewrites are equivalent to such attributes.

MSC:

68Q42 Grammars and rewriting systems
Full Text: DOI

References:

[6] Apel, S.; Kolesnikov, S.; Liebig, J.; Kästner, C.; Kuhlemann, M.; Leich, T., Access control in feature-oriented programming, Sci Comput Program, 77, 3, 174-187 (2012)
[7] Knuth, D. E., Semantics of context-free languages, Math Syst Theory, 2, 2, 127-145 (1968), correction: Mathematical Systems Theory 1971:5(1);95-6 · Zbl 0169.01401
[10] Jones, L. G., Efficient evaluation of circular attribute grammars, ACM Trans Program Lang Syst, 12, 3, 429-462 (1990)
[11] Magnusson, E.; Hedin, G., Circular reference attributed grammars - their evaluation and applications, Sci Comput Program, 68, 1, 21-37 (2007) · Zbl 1188.68166
[12] Söderberg, E.; Ekman, T.; Hedin, G.; Magnusson, E., Extensible intraprocedural flow analysis at the abstract syntax tree level, Sci Comput Program, 78, 10, 1809-1827 (2013)
[13] Ekman, T.; Hedin, G., Rewritable reference attributed grammars, (Odersky, M., ECOOP 2004 - Object-Oriented Programming, Vol. 3086 of Lecture Notes in Computer Science (2004), Springer: Springer Berlin Heidelberg), 147-71 doi:10.1007/978-3-540-24851-4_7. URL http://dx.doi.org/10.1007/978-3-540-24851-4_7
[14] Ekman, T.; Hedin, G., Modular name analysis for java using jastadd, (Lämmel, R.; Saraiva, J.; Visser, J., Generative and Transformational Techniques in Software Engineering, Vol. 4143 of Lecture Notes in Computer Science (2006), Springer: Springer Berlin Heidelberg), 422-36 doi:10.1007/11877028_18. URL http://dx.doi.org/10.1007/11877028_18
[15] Ekman, T.; Hedin, G., The JastAdd system - modular extensible compiler construction, Sci Comput Program, 69, 1-3, 14-26 (2007) · Zbl 1147.68437
[16] Söderberg, E.; Hedin, G., Circular higher-order reference attribute grammars, (Erwig, M.; Paige, R.; Van Wyk, E., Software Language Engineering, Vol. 8225 of Lecture Notes in Computer Science, Springer International Publishing (2013)), 302-21. doi:10.1007/978-3-319-02654-1_17. URL http://dx.doi.org/10.1007/978-3-319-02654-1_17
[17] Jourdan, M., An optimal-time recursive evaluator for attribute grammars, (Paul, M.; Robinet, B., International Symposium on Programming, Vol. 167 of Lecture Notes in Computer Science (1984), Springer: Springer Berlin Heidelberg), 167-78 · Zbl 0539.68068
[22] Blackburn, S. M.; McKinley, K. S.; Garner, R.; Hoffmann, C.; Khan, A. M.; Bentzur, R., Wake up and smell the coffeeevaluation methodology for the 21st century, Commun ACM, 51, 8, 83-89 (2008)
[23] Söderberg, E.; Hedin, G., Automated selective caching for reference attribute grammars, (Malloy, B.; Staab, S.; van den Brand, M., Software Language Engineering, Vol. 6563 of Lecture Notes in Computer Science (2011), Springer: Springer Berlin Heidelberg), 2-21. doi:10.1007/978-3-642-19440-5_2. URL http://dx.doi.org/10.1007/978-3-642-19440-5_2
[24] Boyland, J. T., Remote attribute grammars, J ACM, 52, 4, 627-687 (2005) · Zbl 1316.68060
[25] Visser, E., Stratego: A language for program transformation based on rewriting strategies system description of stratego 0.5, (Middeldorp, A., Rewriting Techniques and Applications, Vol. 2051 of Lecture Notes in Computer Science (2001), Springer: Springer Berlin Heidelberg), 357-61. doi:10.1007/3-540-45127-7_27. URL http://dx.doi.org/10.1007/3-540-45127-7_27 · Zbl 0981.68679
[26] van den Brand, M.; van Deursen, A.; Heering, J.; de Jong, H.; de Jonge, M.; Kuipers, T.; Klint, P.; Moonen, L.; Olivier, P.; Scheerder, J.; Vinju, J.; Visser, E.; Visser, J., The asf+sdf meta-environment: A component-based language development environment, (Wilhelm, R., Compiler Construction, Vol. 2027 of Lecture Notes in Computer Science (2001), Springer: Springer Berlin Heidelberg), 365-70. doi:10.1007/3-540-45306-7_26. URL http://dx.doi.org/10.1007/3-540-45306-7_26 · Zbl 0977.68762
[27] Cordy, J. R., The TXL source transformation language, Sci Comput Program, 61, 3, 190-210 (2006) · Zbl 1102.68434
[29] Van Wyk, E.; de Moor, O.; Backhouse, K.; Kwiatkowski, P., Forwarding in attribute grammars for modular language design, (Horspool, R., Compiler Construction, Vol. 2304 of Lecture Notes in Computer Science (2002), Springer: Springer Berlin Heidelberg), 128-42. doi:10.1007/3-540-45937-5_11. URL http://dx.doi.org/10.1007/3-540-45937-5_11 · Zbl 1051.68839
[30] Martins, P.; Fernandes, J.; Saraiva, J., Zipper-based attribute grammars and their extensions, (Du Bois, A.; Trinder, P., Programming Languages, Vol. 8129 of Lecture Notes in Computer Science (2013), Springer: Springer Berlin Heidelberg), 135-49. doi:10.1007/978-3-642-40922-6_10. URL http://dx.doi.org/10.1007/978-3-642-40922-6_10 · Zbl 1405.68161
[33] Krishnan, L.; VanWyk, E., Termination analysis for higher-order attribute grammars, (Czarnecki, K.; Hedin, G., Software language engineering, vol. 7745 of lecture notes in computer science (2013), Springer: Springer Berlin, Heidelberg), 44-63, doi:10.1007/978-3-642-36089-3_4. URL http://dx.doi.org/10.1007/978-3-642-36089-3_4
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.