Results 1 -
4 of
4
Forwarding in attribute grammars for modular language design
- In Proc. 11th Intl. Conf. on Compiler Construction, volume 2304 of LNCS
, 2002
"... Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a sma ..."
Abstract
-
Cited by 30 (11 self)
- Add to MetaCart
Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a small extension of standard higher-order attribute grammars. The usual tools for manipulating higher-order attribute grammars, including the circularity check (which tests for cyclic dependencies between attribute values), carry over without modification. The closure test (which checks that each attribute has a defining equation) needs modification, however, because the resulting higher-order attribute grammars may contain spurious attributes that are never evaluated, and indeed that need not be defined. 1
Using Circular Programs to Deforest in Accumulating Parameters
, 2002
"... Functional languages allow a modular programming style by function composition, which however can lead to inefficient runtime behavior due to production and consumption of intermediate results. We present a new mechanizable transformation technique for removing intermediate data structures in the co ..."
Abstract
-
Cited by 13 (4 self)
- Add to MetaCart
Functional languages allow a modular programming style by function composition, which however can lead to inefficient runtime behavior due to production and consumption of intermediate results. We present a new mechanizable transformation technique for removing intermediate data structures in the composition of two functions from a class of recursive functions with accumulating parameters, for which classical deforestation techniques fail. In order to avoid multiple traversals of the input data structure, the composition algorithm produces circular programs that make essential use of lazy evaluation and local recursion. The resulting programs are simplified using a post-processing phase presented in the paper.
A Translation from Attribute Grammars to Catamorphisms
, 1994
"... G has a simple form, so that the actual translation can be formulated without too many indices and the like. 1 . The context free grammar G determines a functor F . . Lemma T is a subset of the carrier of the initial F -algebra. . The attribute evaluation rules A determine a function # : (X ..."
Abstract
-
Cited by 10 (2 self)
- Add to MetaCart
G has a simple form, so that the actual translation can be formulated without too many indices and the like. 1 . The context free grammar G determines a functor F . . Lemma T is a subset of the carrier of the initial F -algebra. . The attribute evaluation rules A determine a function # : (X Y ) . . Theorem [[A]](t, x) = ([F| #]) t x . We assume that we are working in the category Set , or in a Set -like category, like CPO . Simplification of the attribute grammar For notational simplicity we make the following three assumptions, without loss of generality. (1) Any terminal a is produced only by rules of the form lhs a where a in the right hand side has no attributes. This can be achieved by the addition of auxiliary nonterminal symbols, say one for each terminal symbol a . (2) Any nonterminal has precisely one inherited and one synthesized attribute. This can be achieved for any AG by tupling the inherited attributes of each nonterminal, and also the synthesized on
A Functional Semantics of Attribute Grammars
- In International Conference on Tools and Algorithms for Construction and Analysis of Systems, Lecture Notes in Computer Science
, 2002
"... A definition of the semantics of attribute grammars is given, using the lambda calculus. We show how this semantics allows us to prove results about attribute grammars in a calculational style. In particular, we give a new proof of Chirica and Martin's result [6], that the attribute values can be co ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
A definition of the semantics of attribute grammars is given, using the lambda calculus. We show how this semantics allows us to prove results about attribute grammars in a calculational style. In particular, we give a new proof of Chirica and Martin's result [6], that the attribute values can be computed by a structural recursion over the tree. We also derive a new definedness test, which encompasses the traditional closure and circularity tests. The test is derived by abstract interpretation.

