Abstract
This paper presents strategy attributes, a seamless integration of strategic term rewriting into attribute grammars. Strategy attributes are specified using rewrite rules with strategies that control their application. The rules can reference contextual information held in attributes on the trees being rewritten. This use of attributes leads to rewriting on decorated trees instead of undecorated terms. During rewriting, attributes are (lazily) computed on new trees to ensure they are correct with respect to their defining equations. Attributes and strategic rewriting can each be used where most appropriate, thus avoiding the cumbersome aspects of each. Strategy attributes are essentially higher-order attributes for which the defining equations are automatically generated from the attributes' strategy expressions. They are thus compatible with other attribute grammar features such as reference attributes, forwarding, and attribute flow analyses for well-definedness. A conservative static analysis checks if a strategy is intended to always succeed or to be partial, thus simplifying its use and optimizing its translation. Strategy attributes are demonstrated in the optimization of a simple expression language, evaluation of the lambda calculus, and optimization of strategy attribute translations.
Original language | English (US) |
---|---|
Title of host publication | SLE 2020 - Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering, Co-located with SPLASH 2020 |
Editors | Ralf Lammel, Laurence Tratt, Juan de Lara |
Publisher | Association for Computing Machinery, Inc |
Pages | 210-229 |
Number of pages | 20 |
ISBN (Electronic) | 9781450381765 |
DOIs | |
State | Published - Nov 16 2020 |
Event | 13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, co-located with SPLASH 2020 - Virtual, Online, United States Duration: Nov 16 2020 → Nov 17 2020 |
Publication series
Name | SLE 2020 - Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering, Co-located with SPLASH 2020 |
---|
Conference
Conference | 13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, co-located with SPLASH 2020 |
---|---|
Country/Territory | United States |
City | Virtual, Online |
Period | 11/16/20 → 11/17/20 |
Bibliographical note
Publisher Copyright:© 2020 ACM.
Keywords
- attribute grammars
- term rewriting