Skip to main content

Component-Based Programming for Higher-Order Attribute Grammars

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2487))

Abstract

This paper presents techniques for a component-based style of programming in the context of higher-oder attribute grammars (HAG). Attribute grammar components are “plugged in” into larger attribute grammar systems through higher-order attribute grammars. Higher-order attributes are used as (intermediate) “gluing” data structures.

This paper also presents two attribute grammar components that can be re-used across different language-based tool specifications: a visualizer and animator of programs and a graphical user interface AG component. Both components are reused in the definition of a simple language processor. The techniques presented in this paper are implemented in LrC: a purely functional, higher-order attribute grammar-based system that generates language-based tools.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Loic Correnson, Etienne Duris, Didier Parigot, and Gilles Roussel. Generic Programming by Program Composition. In Proceedings of the Workshop on Generic Programming, pages 1–13, June 1998.

    Google Scholar 

  2. Oege de Moor, Kevin Backhouse, and Doaitse Swierstra. First-Class Attribute Grammars. In D. Parigot and M. Mernik, editors, Third Workshop on Attribute Grammars and their Applications, WAG A’99, pages 1–20, Ponte de Lima, Portugal, July 2000. INRIA Rocquencourt.

    Google Scholar 

  3. Oege de Moor, Simon Peyton-Jones, and Eric van Wyk. Aspect-Oriented Compilers. In Proceedings of the First International Symposium on Generative and Component-Based Software Engineering (GCSE’ 99), LNCS, September 1999.

    Google Scholar 

  4. Rodney Farrow, Thomas J. Marlowe, and Daniel M. Yellin. Composable Attribute Grammars: Support for Modularity in Translator Design and Implementation. In 19th ACM Symp. on Principles of Programming Languages, pages 223–234, Albuquerque, NM, January 1992. ACM press.

    Google Scholar 

  5. Harald Ganzinger and Robert Giegerich. Attribute Coupled Grammars. In ACM SIGPLAN’ 84 Symposium on Compiler Construction, volume 19, pages 157–170, Montréal, June 1984.

    Google Scholar 

  6. Emden R. Gransner and Stephen C. North. An open graph visualization system and its applications to software engineering. Software Practice and Experience, 00(S1):1–29, 1999.

    Google Scholar 

  7. Matthijs Kuiper and João Saraiva. Lrc-A Generator for Incremental Language-Oriented Tools. In Kay Koskimies, editor, 7th International Conference on Compiler Construction, CC/ETAPS’98, volume 1383 of LNCS, pages 298–301. Springer-Verlag, April 1998.

    Chapter  Google Scholar 

  8. Uwe Kastens and William Waite. Modularity and reusability in attribute grammar. Acta Informatica, 31:601–627, June 1994.

    Google Scholar 

  9. Julia L. Lawall. Implementing Circularity Using Partial Evaluation. In Proceedings of the Second Symposium on Programs as Data Objects PADO II, volume 2053 of LNCS, May 2001.

    Chapter  Google Scholar 

  10. Carole Le Bellec, Martin Jourdan, Didier Parigot, and Gilles Roussel. Specification and Implementation of Grammar Coupling Using Attribute Grammars. In Maurice Bruynooghe and Jaan Penjam, editors, Programming Language Implementation and Logic Programming (PLILP’ 93), volume 714 of LNCS, pages 123–136, Tallinn, August 1993. Springer-Verlag.

    Google Scholar 

  11. J.K. Ousterhout. Tcl and the Tk toolkit. Addison Wesley, 1994.

    Google Scholar 

  12. Maarten Pennings. Generating Incremental Evaluators. PhD thesis, Department of Computer Science, Utrecht University, The Netherlands, November au]1994. ftp://ftp.cs.uu.nl/pub/RUU/CS/phdtheses/Pennings/ .

  13. T. Reps and T. Teitelbaum. The Synthesizer Generator. Springer, 1989.

    Google Scholar 

  14. João Saraiva. Purely Functional Implementation of Attribute Grammars. PhD thesis, Department of Computer Science, Utrecht University, The Netherlands, December 1999. ftp://ftp.cs.uu.nl/pub/RUU/CS/phdtheses/Saraiva/ .

    Google Scholar 

  15. João Saraiva and Doaitse Swierstra. Data Structure Free Compilation. In Stefan Joahnichen, editor, 8th International Conference on Compiler Construction, CC/ETAPS’99, volume 1575 of LNCS, pages 1–16. Springer-Verlag, March 1999.

    Google Scholar 

  16. João Saraiva and Doaitse Swierstra. Generic Attribute Grammars. In D. Parigot and M. Mernik, editors, Second Workshop on Attribute Grammars and their Applications, WAGA’99, pages 185–204, Amsterdam, The Netherlands, March 1999. INRIA Rocquencourt.

    Google Scholar 

  17. João Saraiva, Doaitse Swierstra, and Matthijs Kuiper. Strictification of Computations on Trees. Technical report UU-CS-1997-30, Department of Computer Science, Utrecht University, August 1997. ftp://ftp.cs.ruu.nl/pub/RUU/CS/techreps/CS-1997/1997-30.ps.gz .

  18. João Saraiva, Doaitse Swierstra, and Matthijs Kuiper. Functional Incremental Attribute Evaluation. In David Watt, editor, 9th International Conference on Compiler Construction, CC/ETAPS2000, volume 1781 of LNCS, pages 279–294. Springer-Verlag, March 2000.

    Google Scholar 

  19. Tim Teitelbaum and Richard Chapman. Higher-order attribute grammars and editing environments. In ACM SIGPLAN’90 Conference on Principles of Programming Languages, volume 25, pages 197–208. ACM, June 1990.

    Google Scholar 

  20. Harald Vogt, Doaitse Swierstra, and Matthijs Kuiper. Higher order attribute grammars. In ACM SIGPLAN’ 89 Conference on Programming Language Design and Implementation, volume 24, pages 131–145. ACM, July 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Saraiva, J. (2002). Component-Based Programming for Higher-Order Attribute Grammars. In: Batory, D., Consel, C., Taha, W. (eds) Generative Programming and Component Engineering. GPCE 2002. Lecture Notes in Computer Science, vol 2487. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45821-2_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-45821-2_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-44284-4

  • Online ISBN: 978-3-540-45821-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics