Parsers in ML

  • Authors:
  • Michel Mauny;Daniel de Rauglaudre

  • Affiliations:
  • -;-

  • Venue:
  • LFP '92 Proceedings of the 1992 ACM conference on LISP and functional programming
  • Year:
  • 1992

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present the operational semantics of streams and stream matching as discussed in. Streams are data structures such as lists, but with different primitive operations. Streams not only provide an interface to usual imput/output channels, but may used as a data structure per se, holding any kind of element. A special pattern matching construct is dedicated to streams and the actual matching process will be called parsing.The primary parsing semantics that we propose here is predictive parsing, i.e. recursive descent semantics with a one token look-ahead: although this choice seems to restrict us to the recognition of LL9(1) languages, we show by examples that full functionality and parameter passing allow us to write parsers for complex languages. The operational semantics of parsers is given by transforming parsers into regular functions.We introduce a non-strict semantics of streams by translating stream expression into more classical data structures; we also investigate different sharing mechanisms for some of the stream operations.