Treffer: Zipper-based embedding of strategic attribute grammars.

Title:
Zipper-based embedding of strategic attribute grammars.
Authors:
Macedo, José Nuno1 (AUTHOR) jose.n.macedo@inesctec.pt, Rodrigues, Emanuel1 (AUTHOR) jose.e.rodrigues@inesctec.pt, Viera, Marcos2 (AUTHOR) mviera@fing.edu.uy, Saraiva, João1 (AUTHOR) saraiva@di.uminho.pt
Source:
Journal of Systems & Software. May2024, Vol. 211, pN.PAG-N.PAG. 1p.
Database:
Business Source Elite

Weitere Informationen

Strategic term re-writing and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies to apply term re-write rules in defining large-scale language transformations, while the latter is suitable to express context-dependent language processing algorithms. These two techniques can be expressed and combined via a powerful navigation abstraction: generic zippers. This results in a concise zipper-based embedding offering the expressiveness of both techniques. In addition, we increase the functionalities of strategic programming, enabling the definition of outwards traversals; i.e. outside the starting position. Such elegant embedding has a severe limitation since it recomputes attribute values. This paper presents a proper and efficient embedding of both techniques. First, attribute values are memoized in the zipper data structure, thus avoiding their re-computation. Moreover, strategic zipper based functions are adapted to access such memoized values. We have hosted our memoized zipper-based embedding of strategic attribute grammars both in the Haskell and Python programming languages. Moreover, we benchmarked the libraries supporting both embedding against the state-of-the-art Haskell-based Strafunski and Scala-based Kiama libraries. The first results show that our Haskell Ztrategic library is very competitive against those two well established libraries. • Strategic traversal combinators that support memoized Attribute Grammars. • Showcase that the technique is language-agnostic by defining them in Haskell and Python. • Outward strategic traversals as well as Attribute Grammar propagation patterns as embedding first-class citizens. • Detailed study of the performance of this approach compared to state-of-the-art libraries. [ABSTRACT FROM AUTHOR]

Copyright of Journal of Systems & Software is the property of Elsevier B.V. and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)