Abstract
For a long time, attribute grammars have formed an isolated programming formalism. We show how we may embed the attribute grammar approach in a modern functional programming language. The advantages of both sides reinforce each other: the former provides compositionality and the latter naming abstraction and higher-orderness. Through a sequence of program transformations we show different aspects of the techniques involved. We conclude with the observation that an attribute grammar oriented algorithm development may be a fruitful one, and may go hand in hand with a more algebraic style of program development.
Keywords
Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
References
Azero P. and Swierstra S.D. (1997) Design and implementation of a pretty printing library. (In preparation)
Fokker J. (1995) Functional Parsers, in Advanced Functional Programming (eds. J. Jeuring and E. Meijer), LNCS 925. Springer, Berlin.
Gamma E, Helm R., Johnson R. and Vlissides J. (1995) Design Patterns, Addison-Wesley, Reading, Mass.
Hammond K. and Peterson J., eds (1997) Haskell 1.4 Report. Available at: http://haskell.org
Hudak P. (1996) Haskore Music Tutorial, in Advanced Functional Programming: Second International School (eds. J. Launchbury, E. Meijer and T. Sheard), LNCS 1129. Springer, Berlin.
Hughes J. (1995) The design of a pretty-printing library, in Advanced Functional Programming (eds. J. Jeuring and E. Meijer), LNCS 925. Springer, Berlin.
Meijer E., Fokkinga M. and Paterson R. (1991) Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire, in Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture (ed. J. Hughes).
Jeuring J. and Jansson P. (1996) Polytypic Programming, in Advanced Functional Programming: Second International School (eds. J. Launchbury, E. Meijer and T. Sheard), LNCS 1129. Springer, Berlin.
Swierstra S.D. and de Moor, O. (1993) Virtual Data Structures, in Formal Program Development (eds. B. Möller and H. Partsch and S. Schuman), LNCS 755. Springer, Berlin.
Swierstra S.D. and Duponcheel L. (1996) Deterministic, Error Correcting Combinator Parsers, in Advanced Functional Programming: Second International School (eds. J. Launchbury, E. Meijer and T. Sheard), LNCS 1129. Springer, Berlin.
Wadler P. (1990) Deforestation: Transforming Programs to Eliminate Trees. Theoretical Computer Science, 73, 231–48.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1998 IFIP
About this chapter
Cite this chapter
Swierstra, S.D., Azero, P.R. (1998). Attribute grammars in the functional style. In: Horspool, R.N. (eds) Systems Implementation 2000. IFIP Advances in Information and Communication Technology. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-35350-0_14
Download citation
DOI: https://doi.org/10.1007/978-0-387-35350-0_14
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-5041-2873-5
Online ISBN: 978-0-387-35350-0
eBook Packages: Springer Book Archive