Skip to main content

Functional parsers

  • Conference paper
  • First Online:

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

Abstract

In an informal way the ‘list of successes’ method for writing parsers using a lazy functional language (Gofer) is described. The library of higher-order functions (known as ‘parser combinators’) that is developed is used for writing parsers for nested parentheses and operator expressions with an arbitrary number of priorities. The method is applied on itself to write a parser for grammars, that yields a parser for the language of the grammar. In the text exercises are provided, the solutions of which are given at the end of the article.

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

  1. R. Bird and P. Wadler, Introduction to Functional Programming. Prentice Hall, 1988.

    Google Scholar 

  2. W.H. Burge, ‘Parsing'. In Recursive Programming Techniques, Addison-Wesley, 1975.

    Google Scholar 

  3. Graham Hutton, ‘Higher-order functions for parsing'. J. Functional Programming 2:323–343.

    Google Scholar 

  4. Mark Jones, Gofer 2.30 release notes. http://www.cs.nott.ac.uk:80/Department/Staff/mpj/.

    Google Scholar 

  5. P. Wadler, ‘How to replace failure by a list of successes: a method for exception handling, backtracking, and pattern matching in lazy functional languages'. In Functional Programming Languages and Computer Architecture, (J.P.Jouannaud, ed.), Springer, 1985 (LNCS 201), pp. 113–128.

    Google Scholar 

  6. Philip Wadler, ‘Monads for functional programming'. In Program design calculi, proc. of the Marktoberdorf Summer School, (M. Broy, ed.) Springer, 1992.

    Google Scholar 

  7. Philip Wadler, ‘Monads for functional programming'. In J. Jeuring and E.Meijer, editors. Lecture notes on Advanced Functional Programming Techniques, LNCS, Springer-Verlag, 1995.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Johan Jeuring Erik Meijer

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fokker, J. (1995). Functional parsers. In: Jeuring, J., Meijer, E. (eds) Advanced Functional Programming. AFP 1995. Lecture Notes in Computer Science, vol 925. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59451-5_1

Download citation

  • DOI: https://doi.org/10.1007/3-540-59451-5_1

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-59451-2

  • Online ISBN: 978-3-540-49270-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics