Portability | portable |
---|---|
Stability | provisional |
Maintainer | Antoine Latter <aslatter@gmail.com> |
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.
- module Text.ParserCombinators.Parsec.Prim
- module Text.ParserCombinators.Parsec.Combinator
- module Text.ParserCombinators.Parsec.Char
- data ParseError
- errorPos :: ParseError -> SourcePos
- data SourcePos
- type SourceName = String
- type Line = Int
- type Column = Int
- sourceName :: SourcePos -> SourceName
- sourceLine :: SourcePos -> Line
- sourceColumn :: SourcePos -> Column
- incSourceLine :: SourcePos -> Line -> SourcePos
- incSourceColumn :: SourcePos -> Column -> SourcePos
- setSourceLine :: SourcePos -> Line -> SourcePos
- setSourceColumn :: SourcePos -> Column -> SourcePos
- setSourceName :: SourcePos -> SourceName -> SourcePos
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 Text.Parsec.Prim.parse
. ParseError
is an
instance of the Show
class.
Instances
errorPos :: ParseError -> SourcePosSource
Extracts the source position from the parse error
type SourceName = StringSource
sourceName :: SourcePos -> SourceNameSource
Extracts the name of the source from a source position.
sourceLine :: SourcePos -> LineSource
Extracts the line number from a source position.
sourceColumn :: SourcePos -> ColumnSource
Extracts the column number from a source position.
incSourceLine :: SourcePos -> Line -> SourcePosSource
Increments the line number of a source position.
incSourceColumn :: SourcePos -> Column -> SourcePosSource
Increments the column number of a source position.
setSourceLine :: SourcePos -> Line -> SourcePosSource
Set the line number of a source position.
setSourceColumn :: SourcePos -> Column -> SourcePosSource
Set the column number of a source position.
setSourceName :: SourcePos -> SourceName -> SourcePosSource
Set the name of the source.