Skip to main content

Integrating Attribute Grammar and Functional Programming Language Features

  • Conference paper
Software Language Engineering (SLE 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6940))

Included in the following conference series:

Abstract

While attribute grammars have several features making them advantageous for specifying language processing tools, functional programming languages offer a myriad of features also well-suited for such tasks. Much other work shows the close relationship between these two approaches, often in the form of embedding attribute grammars into lazy functional languages. This paper continues in this tradition, but in the other direction, by integrating various functional language features into attribute grammars. Specifically we integrate rich static types (including parametric polymorphism, typed distinctions between decorated and undecorated trees, limited type inference, and generalized algebraic data-types) and pattern-matching, all in a manner that maintains familiar and convenient attribute grammar notations and especially their highly extensible nature.

This work is partially supported by NSF Awards No. 0905581 and 1047961.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Boyland, J.T.: Remote attribute grammars. J. ACM 52(4), 627–687 (2005)

    Article  MathSciNet  Google Scholar 

  2. Farrow, R.: Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars. SIGPLAN Notices 21(7) (1986)

    Google Scholar 

  3. Ganzinger, H., Giegerich, R.: Attribute coupled grammars. SIGPLAN Notices 19, 157–170 (1984)

    Article  Google Scholar 

  4. Gao, J.: An Extensible Modeling Language Framework via Attribute Grammars. Ph.D. thesis, University of Minnesota, Department of Computer Science and Engineering, Minneapolis, Minnesota, USA (2007)

    Google Scholar 

  5. Hedin, G.: Reference attribute grammars. Informatica 24(3), 301–317 (2000)

    MATH  Google Scholar 

  6. Johnsson, T.: Attribute grammars as a functional programming paradigm. In: Kahn, G. (ed.) FPCA 1987. LNCS, vol. 274, pp. 154–173. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  7. Klint, P., van der Storm, T., Vinju, J.: Rascal: a domain specific language for source code analysis and manipulation. In: Proc. of Source Code Analysis and Manipulation, SCAM 2009 (2009)

    Google Scholar 

  8. Knuth, D.E.: Semantics of context-free languages. Mathematical Systems Theory 2(2), 127–145 (1968); corrections in 5, 95–96 (1971)

    Google Scholar 

  9. Läufer, K., Odersky, M.: Polymorphic type inference and abstract data types. ACM Trans. on Prog. Lang. and Systems (TOPLAS) 16(5), 1411–1430 (1994)

    Article  Google Scholar 

  10. Odersky, M., Spoon, L., Venners, B.: Programming in Scala, 2nd edn. Artima (2010)

    Google Scholar 

  11. Peyton Jones, S., Vytiniotis, D., Weirich, S., Washburn, G.: Simple unification-based type inference for GADTs. In: Proc. of the Eleventh ACM SIGPLAN International Conf. on Functional Programming, pp. 50–61. ACM (2006)

    Google Scholar 

  12. Saraiva, J., Swierstra, D.: Generic Attribute Grammars. In: 2nd Workshop on Attribute Grammars and their Applications, pp. 185–204 (1999)

    Google Scholar 

  13. Schrijvers, T., Peyton Jones, S., Sulzmann, M., Vytiniotis, D.: Complete and decidable type inference for GADTs. In: Proc. of the 14th ACM SIGPLAN International Conf. on Functional Programming, pp. 341–352. ACM (2009)

    Google Scholar 

  14. Sloane, A., Kats, L., Visser, E.: A pure object-oriented embedding of attribute grammars. In: Proc. of Language Descriptions, Tools, and Applications (LDTA 2009). ENTCS, vol. 253, pp. 205–219. Elsevier Science (2010)

    Google Scholar 

  15. Swierstra, S., Alcocer, P., Saraiva, J.: Designing and Implementing Combinator Languages. In: Swierstra, S.D., Oliveira, J.N. (eds.) AFP 1998. LNCS, vol. 1608, pp. 150–206. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  16. Van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P.: Forwarding in Attribute Grammars for Modular Language Design. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 128–142. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  17. Van Wyk, E., Bodin, D., Gao, J., Krishnan, L.: Silver: an extensible attribute grammar system. Science of Computer Programming 75(1-2), 39–54 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  18. Viera, M., Swierstra, S.D., Swierstra, W.: Attribute grammars fly first-class: How to do aspect oriented programming in Haskell. In: Proc. of 2009 International Conf. on Functional Programming, ICFP 2009 (2009)

    Google Scholar 

  19. Vogt, H., Swierstra, S.D., Kuiper, M.F.: Higher-order attribute grammars. In: ACM Conf. on Prog. Lang. Design and Implementation (PLDI), pp. 131–145 (1990)

    Google Scholar 

  20. Wadler, P.: Efficient compilation of pattern matching. In: The Implementation of Functional Programming Languages, pp. 78–103. Prentice-Hall (1987)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kaminski, T., Van Wyk, E. (2012). Integrating Attribute Grammar and Functional Programming Language Features. In: Sloane, A., Aßmann, U. (eds) Software Language Engineering. SLE 2011. Lecture Notes in Computer Science, vol 6940. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28830-2_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-28830-2_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-28829-6

  • Online ISBN: 978-3-642-28830-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics