Advertisement

Structure sharing in attribute grammars

  • Henning Christiansen
Attribute Grammars And Logic Programming
Part of the Lecture Notes in Computer Science book series (LNCS, volume 348)

Abstract

Structure sharing is commonplace in Prolog implementations in order to achieve a compact representation of data values and to provide the ability to update sets of interrelated values simultaneously. This paper describes a representation of attributed syntax trees — as they appear in syntax-oriented editors — based on structure sharing.

Although the two formalisms, attribute grammars and Prolog programs, do have much in common we can only hope for a partial application of structure sharing: The attributes in a typical attribute grammar concern structural objects as well as other values defined by arbitrary functions. In the present approach, the attribute defining expressions are filtered and classified in order to recognize the potential applications of structure sharing. The propagation of changes when updating the shared attribute representation is measured by an abstract interpretation, the so-called flow algebra.

The results in this paper provide a basis for the study of efficient updating algorithms for attributed syntax trees — and existing algorithms may be improved.

Keywords

Dependency Graph Function Symbol Abstract Interpretation Attribute Descriptor Syntax Tree 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Boyer, R.S. and Moore, J.S., The Sharing of Structure in Theorem-Proving Programs, Machine Intelligence 7, pp. 101–116, 1972.Google Scholar
  2. Demers, A., Rogers, A., and Zadeck, F.K., Attribute Propagation by Message Passing, Sigplan Notices, vol. 20, no. 7, pp. 43–59, 1985.Google Scholar
  3. Deransart, P., Jourdan, M., and Lorho, B., A Survey on Attribute Grammars, Part III: Classified Bibliography, INRIA, Rapports de Recherce, no. 417, 1985.Google Scholar
  4. Deransart, P., Jourdan, M., and Lorho, B., A Survey on Attribute Grammars, Part I: Main Results on Attribute Grammars, INRIA, Rapports de Recherce, no. 485, 1986a.Google Scholar
  5. Deransart, P., Jourdan, M., and Lorho, B., A Survey on Attribute Grammars, Part II: Review of Existing Systems, INRIA, Rapports de Recherce, no. 510, 1986b.Google Scholar
  6. Deransart, P. and Maluszynski, J., Relating Logic Programs and Attribute Grammars. Journal of Logic Programming, vol 2, pp. 119–155, 1985.Google Scholar
  7. Ganzinger, H., On Storage Optimization for Automatically Generated Compilers, Lecture Notes in Computer Science 67, pp. 132–147, Springer-Verlag, 1979.Google Scholar
  8. Goguen, J.A., Thatcher, J.W., and Wagner, E.G., An Initial Algebra Approach to the Specification, Correctness and Implementation of Abstract Data Types, Current Trends in Programming Methodology, vol. IV, ed. R.T. Yeh, Prentice-Hall, 1979.Google Scholar
  9. Hoover, R., Dynamically Bypassing Copy Rule Chains in Attribute Grammars, Proc. of 13th Annual ACM Symposium on Principles of Programming Languages, 1986.Google Scholar
  10. Horwitz, S. and Teitelbaum, T., Generating Editing Environments Based on Relations and Attributes, ACM Transactions on Programming Languages and Systems 8, pp. 577–608, 1986.Google Scholar
  11. Jespersen, P., Madsen, M., and Riis, H., New extended attribute systemsNeats, Computer Science Department, Aarhus University, 1978.Google Scholar
  12. Kastens, U., Hutt, B., and Zimmermann, E., GAG: A Practical Compiler Generator, Lecture Notes in Computer Science 141, 1982.Google Scholar
  13. Knuth, D.E., Semantics of Context-Free Languages, Mathematical Systems Theory 2, pp. 127–125, 1968.Google Scholar
  14. Madsen, O.L., On defining semantics by means of extended attribute grammars, Lecture Notes in Computer Science 94, pp. 259–299, 1980.Google Scholar
  15. Milne, R. and Strachey, C., A theory of programming language semantics, Chapman and Hall, London, 1976.Google Scholar
  16. Mycroft, A., Abstract Interpretation and Optimizing Transformations of Applicative Programs, Edinburgh University, CST-15-81, 1981.Google Scholar
  17. Räihä, K.-J., Dynamic Allocation of Space for Attribute Instances in Multi-Pass Evaluators of Attribute Grammars, Sigplan Notices, vol. 14, no. 8, pp 26–34, 1979.Google Scholar
  18. Reps, T.W., Generating Language-Based Environments, MIT Press, 1984.Google Scholar
  19. Reps, T., Marceau, C., and Teitelbaum, T., Remote Attribute Updating for Language-Based Editors, Proc. of 13th Annual ACM Symposium on Principles of Programming Languages, pp. 1–13, 1986.Google Scholar
  20. Sonnenschein, M., Global Storage Cells for Attributes in an Attribute Grammar, Acta Informatica 22, pp. 397–420, 1985.Google Scholar
  21. Warren, D.H.D., Implementing Prolog — compiling predicate logic programs, D.A.I. Research Reports 39 & 40, Department of Artificial Intelligence, University of Edinburgh, 1977.Google Scholar
  22. Watt, D.A. and Madsen, O.L., Extended Attribute Grammars, DAIMI PB-105, Computer Science Department, Aarhus University, 1979.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Henning Christiansen
    • 1
  1. 1.Roskilde University CentreRoskildeDenmark

Personalised recommendations