compilers@ima.UUCP (01/07/86)
[from wpl at ALLEGRA/PSUVAX1/BURDVAX (William P Loftus)] 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 three 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! William Loftus ..!burdvax!wpl 215-648-7489 SDC Software R&D PO Box 157 Paoli, PA 19301 --------