A Deterministic Attribute Grammar Evaluator Based on Dynamic Scheduling

The problem of semantic evaluation in a compiler-generating system can be addressed by specifying language semantics in an attribute grammar [19], a context-free grammar augmented with “attributes” for the nonterminals and “semantic functions” to compute the attributes. A deterministic method for evaluating all attributes in a “semantic” parse tree is derived and shown to have time and space complexities which are essentially linear in the size of the tree. In a prepass through the parse tree, the method determines an evaluation sequence for the attributes; thus it is somewhat analogous to dynamic programming. The constructor-evaluator system described should be suitable for inclusion in a general translator-writing system. for inclusion in a general translator-writing system.

[1]  Isu Fang,et al.  FOLDS, a declarative formal language definition system , 1972 .

[2]  Alfred V. Aho,et al.  Node listings for reducible flow graphs , 1975, STOC '75.

[3]  Edgar T. Irons,et al.  Towards more versatile mechanical translators , 1963 .

[4]  Donald E. Knuth,et al.  The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition , 1997 .

[5]  Richard Edwin Stearns,et al.  Syntax-Directed Transduction , 1966, JACM.

[6]  Alfred V. Aho,et al.  Indexed Grammars—An Extension of Context-Free Grammars , 1967, SWAT.

[7]  Richard Edwin Stearns,et al.  Property Grammars and Table Machines , 1968, SWAT.

[8]  D. Neel,et al.  Removal of invariant statements from nested-loops in a single effective compiler pass , 1975 .

[9]  Ken Kennedy,et al.  Node listings applied to data flow analysis , 1975, POPL '75.

[10]  Daniel J. Rosenkrantz,et al.  Programmed Grammars and Classes of Formal Languages , 1969, JACM.

[11]  Alfred V. Aho Indexed Grammars-An Extension of Context Free Grammars , 1967, SWAT.

[12]  Ken Kennedy,et al.  Automatic generation of efficient evaluators for attribute grammars , 1976, POPL.

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

[14]  D. Neel,et al.  Removal of invariant statements from nested-loops in a single effective compiler pass , 1975, Programming Languages and Compilers for Parallel and Vector Machines.

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

[16]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[17]  Mehdi Jazayeri,et al.  On attribute grammars and the semantic specification of programming languages. , 1975 .

[18]  Alfred V. Aho,et al.  The Theory of Parsing, Translation, and Compiling , 1972 .

[19]  Alfred V. Aho,et al.  Properties of Syntax Directed Translations , 1969, J. Comput. Syst. Sci..

[20]  Wayne Theodore Wilner Declarative semantic definition, as illustrated by a definition of Simula 67 , 1971 .

[21]  Daniel J. Rosenkrantz,et al.  Attributed translations(Extended Abstract) , 1973, STOC.

[22]  B. J. Mailloux,et al.  Report of Algorithmic Language ALGOL 68 , 1969 .

[23]  John E. Hopcroft,et al.  Scattered Context Grammars , 1969, J. Comput. Syst. Sci..

[24]  Donald E. Knuth,et al.  Examples of formal semantics , 1971, Symposium on Semantics of Algorithmic Languages.

[25]  Donald E. Knuth,et al.  The art of computer programming: V.1.: Fundamental algorithms , 1997 .

[26]  B. J. Mailloux,et al.  Report on the Algorithmic Language ALGOL 68 , 1969 .