Total parser combinators

  • Authors:
  • Nils Anders Danielsson

  • Affiliations:
  • University of Nottingham, Nottingham, United Kingdom

  • Venue:
  • Proceedings of the 15th ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library's interface is similar to those of many other parser combinator libraries, with two important differences: one is that the interface clearly specifies which parts of the constructed parsers may be infinite, and which parts have to be finite, using dependent types and a combination of induction and coinduction; and the other is that the parser type is unusually informative. The library comes with a formal semantics, using which it is proved that the parser combinators are as expressive as possible. The implementation is supported by a machine-checked correctness proof.