compilers@ima.UUCP (01/07/86)
[from ] My submition to mod.compilers had an error. I stated that node C had three attribute, when in fact node C has one attribute. Below is a copy of the fixed article. Sorry, Bill [The submission already went out, because I didn't catch it either. Sorry, too. -John] --------------- I'm interested in finding people that have used attribute grammars to aid the development of a real live compiler. I am specifically interested in finding out the pragmatics used in specifying the AG. What I mean by pragmatics is "what was specified, from what kind of node, and to what kind of node." Here is an example of what I mean: The grammar is as follows A ::= B C [ A.j := B.i * C.k; A.i := B.i; A.k := C.k;] B ::= By [ B.i := B.i + 1;] B ::= y [ B.i := 1;] C ::= Bx [ C.k := B.i + 1;] Node A has three attributes (A.i, A.j, A.k). Node B has one attribute (B.i). Node C has one attributes (C.k). Since A is copying attributes i and k from a child and also calculating attribute j from the same attributes, is it better to get the values (that j is calculated) from the children nodes or to calcuate them from attributes in the same node? This type of example appears many times when specifying attributes. Other pragmatic issues are "How far down the tree, or up the tree should you calculate information?" and "What should be calculated with attributes and What should be calculated by a backend?" Please respond to mod.compilers, so we can get ideas flowing!