WG211/M8VanWyk
Bidirectional Attribute Grammars and their use in Extensible Languages
Eric Van Wyk
We discuss how bidirectional transformations can be realized in higher order attribute grammars. In this approach, as in other means for realizing bidirectional transformations, a mapping from a source language to a target language (called the "get" function in bidirectional parlance) is used to generate a function from the target back to the source (called the "put" function). When possible the put function uses the original source language phrase to map the generated target language phrase back to the same source language phrase. When the source phrase is not available the put function should generate source phrases that exhibit desirable properties; for example, expressions that have the minimal number of required parenthesis. Such transformations are useful in extensible languages; for example in generating a host language program from one containing domain specific language extensions, non-transformed source constructs should be recognizable to the programmer. This is joint work with Jo\~ao Saraiva.