Andersen, Jacob9; Brabrand, Claus6; Christiansen, David Raymond4
1 Programming, Logic and Semantics, Software & Systems, The Department2 Theoretical Computer Science, The Department3 Software & Systems, The Department4 Software Development Group, Software & Systems, The Department5 Software Development Group, Theoretical Computer Science, The Department6 Process and System Models, Software & Systems, The Department7 Computer Science, IT University of Copenhagen8 University of Copenhagen9 University of Copenhagen
We propose an algebra of languages and transformations as a means of compositional syntactic language extension. The algebra provides a layer of high-level abstractions built on top of languages (captured by context-free grammars) and transformations (captured by constructive catamorphisms). The algebra is self-contained in that any term of the algebra specifying a transformation can be reduced to a constant catamorphism, before the transfor- mation is run. Thus, the algebra comes “for free” without sacrificing the strong safety and efficiency properties of constructive catamorphisms. The entire algebra as presented in the paper is implemented as the Banana Algebra Tool which may be used to syntactically extend languages in an incremental and modular fashion via algebraic composition of previously defined languages and transformations. We demonstrate and evaluate the tool via several kinds of extensions.
Science of Computer Programming, 2013, Vol 78, Issue 10, p. 1845-1870