Abstract

Attribute grammars are a powerfull, well-known formalism to implement and reason about programs which, by design, are conveniently modular. In this work we focus on a state of the art zipper-based embedding of classic attribute grammars and higher-order attribute grammars. We improve their execution performance through controlling attribute (re)evaluation by means of memoization techniques. We present the results of our optimizations by comparing their impact in various implementations of different, well-studied, attribute grammars and their Higher-Order extensions. • We introduce a memoization mechanism to a zipper-based embedding of AGs in Haskell. • We also analyze the memoization mechanism in the context of higher-order AGs. • Benchmarks are performed to evaluate the impact of introducing memoization. • Results are presented in terms of runtime and memory consumption. • We also do tests considering selective memoization.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call