Advertisement

On the optimal assignment of attributes to passes in multi-pass attribute evaluators

  • Kari-Jouko Räihä
  • Esko Ukkonen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 85)

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.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Alblas,H.: The limitations of attribute evaluation in passes. Manuscript, Department of Applied Mathematics, Twente University of Technology, Enschede, Dec. 1979.Google Scholar
  2. 2.
    Bochmann, G.V.: Semantic evaluation from left to right. CACM 19,2 (Feb. 1976), 55–62.Google Scholar
  3. 3.
    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.Google Scholar
  4. 4.
    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.Google Scholar
  5. 5.
    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.Google Scholar
  6. 6.
    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).Google Scholar
  7. 7.
    Jazayeri,M. and Walter,K.G.: Alternating semantic evaluator. Proc. of the ACM Annual Conference, Oct. 1975, 230–234.Google Scholar
  8. 8.
    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.Google Scholar
  9. 9.
    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.Google Scholar
  10. 10.
    Maier, D.: The complexity of some problems on subsequences and supersequences. Journal of the ACM 25,2 (April 1978), 322–336.Google Scholar
  11. 11.
    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.Google Scholar
  12. 12.
    Pozefsky,D. and Jazayeri,M.: A family of pass-oriented attribute grammar evaluators. Proc. of the ACM Annual Conference, Dec. 1978, 261–270.Google Scholar
  13. 13.
    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.Google Scholar
  14. 14.
    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.Google Scholar
  15. 15.
    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.Google Scholar
  16. 16.
    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.Google Scholar
  17. 17.
    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.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1980

Authors and Affiliations

  • Kari-Jouko Räihä
    • 1
  • Esko Ukkonen
    • 1
  1. 1.Department of Computer ScienceUniversity of HelsinkiHelsinki 25Finland

Personalised recommendations