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.
References
R. Bird and P. Wadler, Introduction to Functional Programming. Prentice Hall, 1988.
W.H. Burge, ‘Parsing'. In Recursive Programming Techniques, Addison-Wesley, 1975.
Graham Hutton, ‘Higher-order functions for parsing'. J. Functional Programming 2:323–343.
Mark Jones, Gofer 2.30 release notes. http://www.cs.nott.ac.uk:80/Department/Staff/mpj/.
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.
Philip Wadler, ‘Monads for functional programming'. In Program design calculi, proc. of the Marktoberdorf Summer School, (M. Broy, ed.) Springer, 1992.
Philip Wadler, ‘Monads for functional programming'. In J. Jeuring and E.Meijer, editors. Lecture notes on Advanced Functional Programming Techniques, LNCS, Springer-Verlag, 1995.
Author information
Authors and Affiliations
Editor information
Rights 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