ABSTRACT
In the traditional formulation of attribute grammars (AGs) circularities are not allowed, that is, no attribute-instance in any derivation tree may be defined in terms of itself. Elsewhere in mathematics and computing, though, circular (or recursive) definitions are commonplace, and even essential. Given appropriate constraints, recursive definitions are well-founded, and the least fixed-points they denote are computable. This is also the case for circular AGs.
This paper presents constraints on individual attributes and semantic functions of an AG that are sufficient to guarantee that a circular AG specifies a well-defined translation and that circularly-defined attribute-instances can be computed via successive approximation. AGs that satisfy these constraints are called finitely recursive.
An attribute evaluation paradigm is presented that incorporates successive approximation to evaluate circular attribute-instances, along with an algorithm to automatically construct such an evaluator. The attribute evaluators so produced are static in the sense that the order of evaluation at each production-instance in the derivation-tree is determined at the time that each translator is generated.
A final algorithm is presented that tells which individual attributes and functions must satisfy the constraints.
- 1.Alfred V. Aho and Jeffery D. Ullman. Principles of Compiler Desiqn. Addison'Wesley, 1977. Google ScholarDigital Library
- 2.Bijan Arbab. Compiling Attribute Grammars into Prolog. IBM Los Angeles Scientific Center, July 1985.Google Scholar
- 3.W. Babich and M. Jazayeri. Data-flow Analysis: the Method of Attributes. Acta informatica , March, 1978.Google Scholar
- 4.L.M. Chirica and D. F. Martin. An algebraic formulation of Knuthian semantics. Mathematical Systems Theory 13:1-27, 1979.Google ScholarCross Ref
- 5.B. Courcelle and P. Franchi-Zannettacci. Attribute Grammars and Recursive Program Schemes. In Theoretlcal Computer Science i_/7, pages 163-191. , 1982.Google Scholar
- 6.Rodney Farrow. Sub-Protocol Evaluators for Attribute Grammars. In Proceedlnqs of the SIGPLA/~ 84 SYmposium on Com611~r Construction. ACM, June, 1984. Google ScholarDigital Library
- 7.Rodney Farrow. LINGUIST-86 Yet another translator writing system based on attribute grammars. In Proceedings of the SIGPLAN 82 symposium on Com~ Construction. ACM, June, 1982. Google ScholarDigital Library
- 8.Rodney Farrow. covers of Attribute Grammars and Sub-Protocol Attr1~e -- Evaluators. Technical Report, Department of Computer Science, Columbia University, New York, NY 10027, September, 1983.Google Scholar
- 9.H. Ganzinger, R. Giegerich, U. Moncke and R. Wilhelm. A Truly Generative Semantics- Directed Compiler Generator. In Proceedings of the SIGPLAN Symposium on Com~ Construction. ACM, June, 1982. Google ScholarDigital Library
- 10.Larry G. Jones and Janos Simon. Hierarchical VLSI Design Systems Based on Attribute Grammars. In Conference Record of the Thirteenth ACM Symp6s~-~ on Principles of Languages. ACM, January, 1986. Google ScholarDigital Library
- 11.J. B. Kam and J. D. Ullman. Global data flow analysis and iterative algorithms. ~. ACM 23(1), 19V6. Google ScholarDigital Library
- 12.Uwe Kastens, Br~gitte Hutt, and Erich Zimmermann. GAG:A Practical ~ G@nerator. Spring---~ag~ Berlzn-Heidelberg-New York, 1982.Google Scholar
- 13.U. Kastens. Ordered attribute grammars. Acta Informatica 13, 1980.Google Scholar
- 14.Takuya Katayama. Translation of Attribute Grammars into Procedures. ACM Transactions on Proqrammlnq Lanquages and S s_~ 6(3), July, 1984. Google ScholarDigital Library
- 15.K. Kennedy and J. Ramanathan. A deterministic attribute grammar svaluator based on dynamic sequencing. ACM TOPLAS i, 1979. Google ScholarDigital Library
- 16.K. Kennedy and S. K. Warren. Automatic generation of efficient evaluators for attribute grammars. In Conference Record of the Third ACM symposium on Prlnc-{Dles of P-~gramming Languages. ACM, Google ScholarDigital Library
- 17.G. A. Kilda11. A unified approach to global program optimization, In Conference Record of the ACM S~osium on Pr-~cTDles of Programmlng Languages. ACM, October, 1973. Google ScholarDigital Library
- 18.D. E. Knuth. Semantics of context-free languages. Mathematica! S_~stems Theoz~f 2, 1968. correction in volume 5, number i.Google Scholar
- 19.Brian H. Mayoh. Attribute Grammars and Mathematical Semantics. SIAM Journal of Computing 10(3), August, 1981.Google Scholar
- 20.Lawrence Paulson. A Semantics-Directed Compiler Generator. In Conference Record of the Ninth ACM Symposium on Prlnc-'~ples of Lanquaggs. ACM, January, 1982. Google ScholarDigital Library
- 21.Kari-Jouko Raiha, M. Saarinen, M. Sarjakoski, S. Sippu, E. Soisalon-Soininen and M. Tienari. Revised R_~ort on the Compiler wri~inqs~Z-~t~ ~8. - Technical Report A-1983-I, Dept. of Computer Science, Univ. of Helsinkl, 1983.Google Scholar
- 22.W.A. Schulz. language Synthesis ~n a translator. P hD-~hesis,~University of Colorado, Boulder, Colorado, July, 1976.Google Scholar
- 23.Stephen K. Skedzeleski. Definition and Use of Attribute Reevaluatxon In A-ttribUted Grammars. PhD thesis, University of Wisconsin, Madison, Wisconsin, December, 1978. Google ScholarDigital Library
Index Terms
- Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars
Recommendations
Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars
In the traditional formulation of attribute grammars (AGs) circularities are not allowed, that is, no attribute-instance in any derivation tree may be defined in terms of itself. Elsewhere in mathematics and computing, though, circular (or recursive) ...
Automatic generation of efficient evaluators for attribute grammars
POPL '76: Proceedings of the 3rd ACM SIGACT-SIGPLAN symposium on Principles on programming languagesThe translation process may be divided into a syntactic phase and a semantic phase. Context-free grammars can be used to describe the set of syntactically correct source texts in a formal yet intuitively appealing way, and many techniques are now known ...
Circular attribute grammars with remote attribute references and their evaluators
AbstractAttribute grammars (AGs) are a suitable formalism for the development of language processing systems. However, for languages including unrestricted labeled jumps, such as “goto” in C, the optimizers in compilers are difficult to write in AGs. This ...
Comments