Skip to main content

Deterministic, error-correcting combinator parsers

  • Conference paper
  • First Online:

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

Abstract

We show how error-correcting, deterministic, combinator parsers can be constructed for grammars which have the LL(1) property. The normal disadvantages of conventional combinator parsers, such as their lack of speed and their poor error reporting, are remedied. Parsers constructed with these combinators are implicitly specialised for the grammar they describe. Because of this property the combinators act as a parser generator for LL(1) grammars. The techniques used to construct the combinators illustrate how partial parametrisation and careful ordering of computations can be used to achieve implicit partial evaluation in a lazy language.

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. Jeroen Fokker. Functional parsers. In Johan Jeuring and Erik Meijer, editors, Advanced functional programming, Baastad Summerschool Tutorial Text, volume 925 of LNCS, pages 1–23. Springer, 1995.

    Google Scholar 

  2. Graham Hutton. Higher-order functions for parsing. Journal of functional programming, 2:323–343, 1992.

    Google Scholar 

  3. Mark, P. Jones A System of Constructor Classes: Overloading and Implicit Higher-Order Polymorphism Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, pages 52–64, ACM, 1993.

    Google Scholar 

  4. Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program generation. Prentice-Hall, 1993.

    Google Scholar 

  5. Andrew Partridge and David Wright. Parser combinators need four values to report errors. Technical report, Department of Computer Science, Tasmania, 1994.

    Google Scholar 

  6. M. Pennings, S.D. Swierstra, and H.H. Vogt. Using cached functions and constructors for incremental attribute evaluation. In M. Bruynooghe and M. Wirsing, editors, Programming Language Implementation and Logic Programming, volume 631 of LNCS, pages 130–144. Springer, 1992.

    Google Scholar 

  7. Maarten Pennings. Generating Incremental Attribute Evaluators. PhD thesis, Utrecht University, Dept. of Computer Science, 1994. www.cs.ruu.nl.

    Google Scholar 

  8. Niklas Röjemo. Garbage collection, and memory efficiency, in lazy functional languages. PhD thesis, Chalmers, rojemo@cs.chalmers.se, 1995.

    Google Scholar 

  9. Philip Wadler. Monads for functional programming. In Johan Jeuring and Erik Meijer, editors, Advanced functional programming, Baastad Summerschool Tutorial Text, volume 925 of LNCS, pages 24–52. Springer, 1995.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

John Launchbury Erik Meijer Tim Sheard

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Swierstra, S.D., Duponcheel, L. (1996). Deterministic, error-correcting combinator parsers. In: Launchbury, J., Meijer, E., Sheard, T. (eds) Advanced Functional Programming. AFP 1996. Lecture Notes in Computer Science, vol 1129. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61628-4_7

Download citation

  • DOI: https://doi.org/10.1007/3-540-61628-4_7

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61628-3

  • Online ISBN: 978-3-540-70639-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics