Advertisement

Deterministic, error-correcting combinator parsers

  • S. Doaitse Swierstra
  • Luc Duponcheel
Conference paper
Part of the Lecture Notes in Computer Science book series (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.

Keywords

Input Sequence Error Message Error Recovery Input Symbol Binary Search Tree 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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. 2.
    Graham Hutton. Higher-order functions for parsing. Journal of functional programming, 2:323–343, 1992.Google Scholar
  3. 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. 4.
    Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program generation. Prentice-Hall, 1993.Google Scholar
  5. 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. 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. 7.
    Maarten Pennings. Generating Incremental Attribute Evaluators. PhD thesis, Utrecht University, Dept. of Computer Science, 1994. www.cs.ruu.nl.Google Scholar
  8. 8.
    Niklas Röjemo. Garbage collection, and memory efficiency, in lazy functional languages. PhD thesis, Chalmers, rojemo@cs.chalmers.se, 1995.Google Scholar
  9. 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

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • S. Doaitse Swierstra
    • 1
  • Luc Duponcheel
    • 1
  1. 1.Dept. of Computer ScienceUtrecht UniversityTB UtrechtThe Netherlands

Personalised recommendations