Difference between revisions of "WG211/M15Sloane"
(Created page with "''Respect Your Parents: How Attribution and Rewriting Can Get Along'' Anthony Sloane, Macquarie University Attribute grammars describe how to decorate static trees. Rewriting s...") |
(Add slides for Sloane talk) |
||
Line 4: | Line 4: | ||
Attribute grammars describe how to decorate static trees. Rewriting systems describe how to transform trees into new trees. Attri- bution is undermined by rewriting because a node may appear in both the source and product of a transformation. If an attribute of that node depends on the node’s context, then a previously computed value may not be valid. We explore this problem and formalise it as a question of ancestry: the context of a node is given by the tree’s parent relationships and we must use the appropriate parents to calculate attributes that de- pend on the context. We show how respecting parents naturally leads to a view of context-dependent attributes as tree-indexed attribute families. Viewed in this way, attribution co-exists easily with rewriting transfor- mations. We demonstrate the practicality of our approach by describing our implementation in the Kiama language processing library. | Attribute grammars describe how to decorate static trees. Rewriting systems describe how to transform trees into new trees. Attri- bution is undermined by rewriting because a node may appear in both the source and product of a transformation. If an attribute of that node depends on the node’s context, then a previously computed value may not be valid. We explore this problem and formalise it as a question of ancestry: the context of a node is given by the tree’s parent relationships and we must use the appropriate parents to calculate attributes that de- pend on the context. We show how respecting parents naturally leads to a view of context-dependent attributes as tree-indexed attribute families. Viewed in this way, attribution co-exists easily with rewriting transfor- mations. We demonstrate the practicality of our approach by describing our implementation in the Kiama language processing library. | ||
+ | |||
+ | [https://speakerdeck.com/inkytonik/respect-your-parents-how-attribution-and-rewriting-can-get-along-1 Slides] |
Latest revision as of 14:07, 10 November 2015
Respect Your Parents: How Attribution and Rewriting Can Get Along
Anthony Sloane, Macquarie University
Attribute grammars describe how to decorate static trees. Rewriting systems describe how to transform trees into new trees. Attri- bution is undermined by rewriting because a node may appear in both the source and product of a transformation. If an attribute of that node depends on the node’s context, then a previously computed value may not be valid. We explore this problem and formalise it as a question of ancestry: the context of a node is given by the tree’s parent relationships and we must use the appropriate parents to calculate attributes that de- pend on the context. We show how respecting parents naturally leads to a view of context-dependent attributes as tree-indexed attribute families. Viewed in this way, attribution co-exists easily with rewriting transfor- mations. We demonstrate the practicality of our approach by describing our implementation in the Kiama language processing library.