Hostname: page-component-76fb5796d-zzh7m Total loading time: 0 Render date: 2024-04-26T06:45:26.820Z Has data issue: false hasContentIssue false

FUNCTIONAL PEARL Parsing permutation phrases

Published online by Cambridge University Press:  27 October 2004

ARTHUR I. BAARS
Affiliation:
Institute of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands (email: arthurb@cs.uu.nlandres@cs.uu.nldoaitse@cs.uu.nl)
ANDRES LÖH
Affiliation:
Institute of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands (email: arthurb@cs.uu.nlandres@cs.uu.nldoaitse@cs.uu.nl)
S. DOAITSE SWIERSTRA
Affiliation:
Institute of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands (email: arthurb@cs.uu.nlandres@cs.uu.nldoaitse@cs.uu.nl)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

A permutation phrase is a sequence of elements (possibly of different types) in which each element occurs exactly once and the order is irrelevant. Some of the permutable elements may be optional. We show how to extend a parser combinator library with support for parsing such free-order constructs. A user of the library can easily write parsers for permutation phrases and does not need to care about checking and reordering the recognized elements. Applications include the generation of parsers for attributes of XML tags and Haskell's record syntax.

Type
Functional pearls
Copyright
© 2004 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.