Abstract
The problem of constructing multi-pass evaluators for attribute grammars is studied. The algorithm used heretofore is demonstrated to be able to produce evaluators which perform almost twice as many passes through the parse tree as necessary. The problem of constructing a shortest possible evaluation order is then shown to be NP-complete. Based on a new characterization of multi-pass attribute grammars, a modified construction algorithm is then developed. The new heuristics is motivated by experience with real grammars.
Preview
Unable to display preview. Download preview PDF.
References
Alblas,H.: The limitations of attribute evaluation in passes. Manuscript, Department of Applied Mathematics, Twente University of Technology, Enschede, Dec. 1979.
Bochmann, G.V.: Semantic evaluation from left to right. CACM 19,2 (Feb. 1976), 55–62.
Cohen,R. and Harry,E.: Automatic generation of near-optimal linear-time translators for non-circular attribute grammars. Conf. Record of the Sixth ACM Symposium on Principles of Programming Languages, 1979, 121–134.
Jazayeri, M.: On attribute grammars and the semantic specification of programming languages. Report 1159, Jennings Computing Centre, Case Western Reserve University, Cleveland, Ohio, Oct. 1974.
Jazayeri, M.: Live variable analysis, attribute grammars, and program optimization. Manuscript, Dept. of Computer Science, Univ. of North Carolina, Chapel Hill, N.C., March 1975.
Jazayeri, M. and Pozefsky, D.: Algorithms for efficient evaluation of multi-pass attribute grammars without a parse tree. Report TR 77-001, Dept. of Computer Science, Univ. of North Carolina, Chapel Hill, N.C., Feb. 1977 (revised May 1979).
Jazayeri,M. and Walter,K.G.: Alternating semantic evaluator. Proc. of the ACM Annual Conference, Oct. 1975, 230–234.
Kennedy,K. and Warren,S.K.: Automatic generation of efficient evaluators for attribute grammars. Conf. Record of the Third ACM Symposium on Principles of Programming Languages, 1976, 32–49.
Knuth, D.E.: Semantics of context-free languages. Mathematical Systems Theory 2,2 (1968), 127–145. Correction in Mathematical Systems Theory 5,1 (1971), 95–96.
Maier, D.: The complexity of some problems on subsequences and supersequences. Journal of the ACM 25,2 (April 1978), 322–336.
Pozefsky, D.: Building efficient pass-oriented attribute evaluators. Report TR 79-006, Dept. of Computer Science, Univ. of North Carolina, Chapel Hill, N.C., 1979.
Pozefsky,D. and Jazayeri,M.: A family of pass-oriented attribute grammar evaluators. Proc. of the ACM Annual Conference, Dec. 1978, 261–270.
Räihä, K.-J.: On attribute grammars and their use in a compiler writing system. Report A-1977-4, Dept. of Computer Science, Univ. of Helsinki, Helsinki, Aug. 1977.
Räihä, K.-J.: Experiences with the compiler writing system HLP. Proc. of the Aarhus Workshop on Semantics-Directed Compiler Generation, Springer-Verlag, Berlin — Heidelberg — New York, 1980.
Räihä, K.-J., Saarinen, M., Soisalon-Soininen, E. and Tienari, M.: The compiler writing system HLP (Helsinki Language Processor). Report A-1978-2, Dept. of Computer Science, Univ. of Helsinki, Helsinki, March 1978.
Räihä, K.-J. and Ukkonen, E.: The shortest common supersequence problem over binary alphabet is NP-complete. Report C-1979-95, Dept. of Computer Science, Univ. of Helsinki, Helsinki, Sept. 1979.
Räihä, K.-J. and Ukkonen, E.: Minimizing the number of evaluation passes for attribute grammars. Report C-1979-121, Dept. of Computer Science, Univ. of Helsinki, Helsinki, Nov. 1979.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1980 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Räihä, KJ., Ukkonen, E. (1980). On the optimal assignment of attributes to passes in multi-pass attribute evaluators. In: de Bakker, J., van Leeuwen, J. (eds) Automata, Languages and Programming. ICALP 1980. Lecture Notes in Computer Science, vol 85. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-10003-2_94
Download citation
DOI: https://doi.org/10.1007/3-540-10003-2_94
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-10003-4
Online ISBN: 978-3-540-39346-7
eBook Packages: Springer Book Archive