UUAG meets AspectAG

Autor: Doaitse Swierstra, Marcos Viera, Arie Middelkoop
Rok vydání: 2012
Předmět:
Zdroj: LDTA
Popis: The Utrecht University Attribute Grammar Compiler takes attribute grammar declarations from multiple source files and generates an attribute grammar evaluator consisting of a single Haskell source text. The problem with such generative approaches is that, once the code is generated and compiled, neither new attributes can be introduced nor existing ones can be modified without providing access to all the source code and without having to regenerate and recompile the entire program.In contrast to this textual approach we recently constructed the Haskell combinator library AspectAG with which one can construct attribute grammar fragments as a Haskell value. Such descriptions can be individually type-checked, compiled, distributed and composed to construct a compiler. This method however results in rather inefficient compilers, due to the costs incurred by the increased flexibility.We show how to combine the two approaches by generating AspectAG code fragments from UUAGC sources, thus making it possible to trade between efficiency and flexibility; besides enabling a couple of optimizations for AspectAG resulting in a considerable speed improvement this makes existing UUAGC code reusable in a flexible environment.
Databáze: OpenAIRE