Skip to main content
Log in

A comparison of storage optimizations in automatically-generated attribute evaluators

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Attribute grammars are a value-oriented, non-procedural extension to context-free grammars that facilitate the specification of translations whose domain is described by the underlying context-free grammar. Just as parsers for context-free languages can be automatically constructed from a context-free grammar, so can translators, called attribute evaluators, be automatically generated from an attribute grammar. A major obstacle to generating efficient attribute evaluators is that they typically use large amounts of memory to represent the attributed parse tree. In this report we investigate the problem of efficient representation of the attributed parse tree by analyzing and comparing the strategies of two systems that have been used to automatically generate a translator from an attribute grammar: the GAG system developed at the Universitat de Karlsruhe and the LINGUIST-86 system written at Intel Corporation. Our analysis will characterize the two strategies and highlight their respective strengths and weaknesses. Drawing on the insights given by this analysis, we propose a strategy for storage optimization in automatically generated attribute evaluators that not only incorporates the best features of both GAG and LINGUIST-86, but also contains novel features that address aspects of the problem that are handled poorly by both systems.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Asbrock, B., Kastens, U., Zimmermann, E.: Generating an Efficient Compiler Front-End. Technical Report 17/81, Universität Karlsruhe, Fakultät Für Informatik 1981

  2. Farrow, R.: LINGUIST-86 Yet another translator writing system based on attribute grammars. Proceedings of the SIGPLAN 82 Symposium on Compiler Construction. ACM 1982

  3. Farrow, R.: Experience with an attribute grammar based compiler. Conference Record of the Ninth ACM Symposium on Principles of Programming Languages. ACM 1982

  4. Farrow, R.: Covers of Attribute Grammars and Sub-Protocol Attribute Evaluators. Technical Report, Department of Computer Science, Columbia University, New York 1983

    Google Scholar 

  5. Farrow, R.: Generating a Production Compiler from an Attribute Grammar. IEEE Software 1, 77–93 (1984)

    Google Scholar 

  6. Farrow, R., Yellin, D.M.: A Comparison of Storage Optimizations in Automatically-Generated Attribute Evaluators. Technical Report, Department of Computer Science, Columbia University, New York, 1985 (Extended version)

    Google Scholar 

  7. Ganzinger, H.: On storage optimization for automatically generated compilers. In: Theoretical Computer Science — Fourth GI Conference. (K. Weirauch ed.). Berlin, Heidelberg, New York: Springer 1979

    Google Scholar 

  8. Jazayeri, M., Walter, K.G.: Alternating semantic evaluator. Proc. ACM, pp. 230–234 (1975) (Annual Conference)

  9. Jourdan, M.: Strongly Non-Circular Attribute Grammars and their Recursive Evaluation. Proceedings of the SIGPLAN'84 Symposium on Compiler Construction. SIGPLAN Not. 19, 81–93 (1984)

    Google Scholar 

  10. Kastens, U.: Ordered attribute grammars. Acta Inf. 13, 229–256 (1980)

    Google Scholar 

  11. Kastens, U., Hutt, B., Zimmermann, E.: GAG: A Practical Compiler Generator. Lect. Notes Comput. Sci. 141. Berlin, Heidelberg, New York: Springer 1982

    Google Scholar 

  12. Katayama, T.: Translation of Attribute Grammars into Procedures. ACM TOPLAS 6, (1984)

  13. Kennedy, K., Warren, S.K.: Automatic generation of efficient evaluators for attribute grammars. Conference Record of the Third ACM Symposium on Principles of Programming Languages. ACM, 1976

  14. Raiha, K.-J.: Dynamic allocation of space for attribute-instances in multi-pass evaluators of attribute grammars. Proceedings of the SIGPLAN 79 Symposium on Compiler Construction. ACM, 26–38 (1979)

  15. Reps, T.W.: Generating Language-Based Environments. PhD thesis, Cornell University, Ithaca, New York 1983

    Google Scholar 

  16. Saarinen, M.: On constructing efficient evaluators for attribute grammars. In: Automata, Languages, and Programming: 5th Colloquium. (Ausiello and C. Bohm eds.). Berlin, Heidelberg, New York: Springer 1978

    Google Scholar 

  17. Schulz, W.A.: Semantic analysis and target language synthesis in a translator. PhD thesis, University of Colorado, Boulder, Colorada, 1976

    Google Scholar 

  18. Sethi, R.: Pebble Games For Studying Storage Sharing. Theoret. Comput. Sci. 19, 69–84 (1982)

    Google Scholar 

  19. Yellin, D.M.: A Survey of Tree-Walk Evaluation Strategies for Attribute Grammars. Technical Report, Department of Computer Science, Columbia University, New York, 1984

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

This research was partially supported by the National Science Foundation under grant DCR-83-10930, and partially supported by the Defense Advanced Research Projects Agency under contract number N00039-84-C-0165

Rights and permissions

Reprints and permissions

About this article

Cite this article

Farrow, R., Yellin, D. A comparison of storage optimizations in automatically-generated attribute evaluators. Acta Informatica 23, 393–427 (1986). https://doi.org/10.1007/BF00267865

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00267865

Keywords

Navigation