Strategic term rewriting and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies (recursion schemes) to apply term rewrite rules in defining transformations, while the latter is suitable for expressing context-dependent language processing algorithms. Each of these techniques, however, is usually implemented by its own powerful and large processor system. As a result, it makes such systems harder to extend and to combine.
We present the embedding of both strategic tree rewriting and attribute grammars in a zipper-based, purely functional setting. The embedding of the two techniques in the same setting has several advantages: First, we easily combine/zip attribute grammars and strategies, thus providing language engineers the best of the two worlds. Second, the combined embedding is easier to maintain and extend since it is written in a concise and uniform setting. We show the expressive power of our library in optimizing Haskell let expressions, expressing several Haskell refactorings and solving several language processing tasks for an Oberon-0 compiler.
Thu 12 MayDisplayed time zone: Osaka, Sapporo, Tokyo change
19:30 - 20:20 | |||
19:30 25mTalk | A Lazy Desugaring System for Evaluating Programs with Sugars FLOPS 2022 Ziyi Yang National University of Singapore, Yushuo Xiao Peking University, Zhichao Guan , Zhenjiang Hu Peking University | ||
19:55 25mTalk | Zipping Strategies and Attribute Grammars FLOPS 2022 José Nuno Macedo University of Minho, Marcos Viera University of the Republic, Uruguay, João Saraiva |