Rule splitting and attribute-directed parsing

Rule splitting is a phenomenon, most clearly exhibited by attribute grammars and affix grammars, in which the syntactic structure of a phrase is constrained by its attributes. In this paper, rule splitting is illustrated by examples taken from real programming languages, and two varieties of rule splitting are identified and formalized. Implementations of rule splitting (attribute-directed parsing) are demonstrated for top-down and bottom-up parsers, both one-pass and multi-pass. Finally, the problems of exploiting rule splitting in a compiler writing system based on attribute grammars are explored.

[1]  Mehdi Jazayeri,et al.  Alternating semantic evaluator , 1975, ACM '75.

[2]  Henry J. Bowlden,et al.  Algol 68 Implementation , 1971, IFIP Congress.

[3]  Reinhard Wilhelm,et al.  Automatic Generation of Optimizing Multipass Compilers , 1977, IFIP Congress.

[4]  Daniel J. Rosenkrantz,et al.  Attributed Translations , 1974, J. Comput. Syst. Sci..

[5]  Cornelis H. A. Koster,et al.  Methods of Algorithmic Language Implementation , 1977, Lecture Notes in Computer Science.

[6]  Bent Bruun Kristensen,et al.  The BOBS-System , 1982 .

[7]  David A. Watt,et al.  Analysis-oriented two-level grammars , 1974 .

[8]  William M. Waite,et al.  Compiler Construction: An Advanced Course , 1974 .

[9]  Edsger W. Dijkstra,et al.  Structured programming , 1972, A.P.I.C. Studies in data processing.

[10]  Gregor von Bochmann,et al.  A (Truly) Usable and Portable Compiler Writing System , 1974, IFIP Congress.

[11]  Ole Lehrmann Madsen On defining semantics by means of extended attribute grammars , 1980, Semantics-Directed Compiler Generation.

[12]  Bernard Lorho Semantic attributes processing in the system DELTA , 1975, Methods of Algorithmic Language Implementation.

[13]  Gregor von Bochmann,et al.  Semantic evaluation from left to right , 1976, CACM.

[14]  Cornelis H. A. Koster,et al.  A compiler compiler , 1971 .

[15]  Tony Hoare,et al.  Notes on Data Structuring , 1972 .

[16]  David A. Watt,et al.  An extended attribute grammar for Pascal , 1979, SIGP.

[17]  David Crowe,et al.  Generating parsers for affix grammars , 1972, Commun. ACM.