Skip to main content

Structure sharing in attribute grammars

  • Attribute Grammars And Logic Programming
  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((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.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  • Boyer, R.S. and Moore, J.S., The Sharing of Structure in Theorem-Proving Programs, Machine Intelligence 7, pp. 101–116, 1972.

    Google Scholar 

  • 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 

  • 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 

  • 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 

  • 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 

  • Deransart, P. and Maluszynski, J., Relating Logic Programs and Attribute Grammars. Journal of Logic Programming, vol 2, pp. 119–155, 1985.

    Google Scholar 

  • Ganzinger, H., On Storage Optimization for Automatically Generated Compilers, Lecture Notes in Computer Science 67, pp. 132–147, Springer-Verlag, 1979.

    Google Scholar 

  • 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 

  • Hoover, R., Dynamically Bypassing Copy Rule Chains in Attribute Grammars, Proc. of 13th Annual ACM Symposium on Principles of Programming Languages, 1986.

    Google Scholar 

  • 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 

  • Jespersen, P., Madsen, M., and Riis, H., New extended attribute systemsNeats, Computer Science Department, Aarhus University, 1978.

    Google Scholar 

  • Kastens, U., Hutt, B., and Zimmermann, E., GAG: A Practical Compiler Generator, Lecture Notes in Computer Science 141, 1982.

    Google Scholar 

  • Knuth, D.E., Semantics of Context-Free Languages, Mathematical Systems Theory 2, pp. 127–125, 1968.

    Google Scholar 

  • Madsen, O.L., On defining semantics by means of extended attribute grammars, Lecture Notes in Computer Science 94, pp. 259–299, 1980.

    Google Scholar 

  • Milne, R. and Strachey, C., A theory of programming language semantics, Chapman and Hall, London, 1976.

    Google Scholar 

  • Mycroft, A., Abstract Interpretation and Optimizing Transformations of Applicative Programs, Edinburgh University, CST-15-81, 1981.

    Google Scholar 

  • 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 

  • Reps, T.W., Generating Language-Based Environments, MIT Press, 1984.

    Google Scholar 

  • 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 

  • Sonnenschein, M., Global Storage Cells for Attributes in an Attribute Grammar, Acta Informatica 22, pp. 397–420, 1985.

    Google Scholar 

  • 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 

  • Watt, D.A. and Madsen, O.L., Extended Attribute Grammars, DAIMI PB-105, Computer Science Department, Aarhus University, 1979.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

P. Deransart B. Lorho J. Małuszyński

Rights and permissions

Reprints and permissions

Copyright information

© 1989 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Christiansen, H. (1989). Structure sharing in attribute grammars. In: Deransart, P., Lorho, B., Małuszyński, J. (eds) Programming Languages Implementation and Logic Programming. PLILP 1988. Lecture Notes in Computer Science, vol 348. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-50820-1_48

Download citation

  • DOI: https://doi.org/10.1007/3-540-50820-1_48

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-50820-5

  • Online ISBN: 978-3-540-46092-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics