parsec1-1.0.0.6: Portable monadic parser combinators

Copyright (c) Daan Leijen 1999-2001 BSD-style (see the file libraries/parsec/LICENSE) Antoine Latter provisional portable Safe-Inferred Haskell98

Text.ParserCombinators.Parsec

Description

Parsec, the Fast Monadic Parser combinator library, see http://www.cs.uu.nl/people/daan/parsec.html.

Inspired by:

• Graham Hutton and Erik Meijer: Monadic Parser Combinators. Technical report NOTTCS-TR-96-4. Department of Computer Science, University of Nottingham, 1996. http://www.cs.nott.ac.uk/~gmh/monparsing.ps
• Andrew Partridge, David Wright: Predictive parser combinators need four values to report errors. Journal of Functional Programming 6(2): 355-364, 1996

This helper module exports elements from the basic libraries.

Synopsis

# Documentation

data ParseError Source

The abstract data type `ParseError` represents parse errors. It provides the source position (`SourcePos`) of the error and a list of error messages (`Message`). A `ParseError` can be returned by the function `parse`. `ParseError` is an instance of the `Show` class.

Instances

 Show ParseError

Extracts the source position from the parse error

data SourcePos Source

The abstract data type `SourcePos` represents source positions. It contains the name of the source (i.e. file name), a line number and a column number. `SourcePos` is an instance of the `Show`, `Eq` and `Ord` class.

Instances

 Eq SourcePos Ord SourcePos Show SourcePos

type Line = Int Source

Extracts the name of the source from a source position.

Extracts the line number from a source position.

Extracts the column number from a source position.

Increments the line number of a source position.

Increments the column number of a source position.

Set the line number of a source position.

Set the column number of a source position.

Set the name of the source.