Copyright | (c) Daan Leijen 1999-2001 |
---|---|
License | BSD-style (see the file libraries/parsec/LICENSE) |
Maintainer | Christian Maeder <chr.maeder@web.de> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Parsec, the Fast Monadic Parser combinator library.
Inspired by:
Graham Hutton and Erik Meijer: Monadic Parser Combinators. Technical report NOTTCS-TR-96-4. Department of Computer Science, University of Nottingham, 1996. https://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
- module Text.ParserCombinators.Parsec.Char
- module Text.ParserCombinators.Parsec.Combinator
- module Text.ParserCombinators.Parsec.Prim
- data ParseError
- errorPos :: ParseError -> SourcePos
- type Column = Int
- type Line = Int
- type SourceName = String
- data SourcePos
- incSourceColumn :: SourcePos -> Column -> SourcePos
- incSourceLine :: SourcePos -> Line -> SourcePos
- setSourceColumn :: SourcePos -> Column -> SourcePos
- setSourceLine :: SourcePos -> Line -> SourcePos
- setSourceName :: SourcePos -> SourceName -> SourcePos
- sourceColumn :: SourcePos -> Column
- sourceLine :: SourcePos -> Line
- sourceName :: SourcePos -> SourceName
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
Eq ParseError Source # | |
Defined in Text.ParserCombinators.Parsec.Error (==) :: ParseError -> ParseError -> Bool # (/=) :: ParseError -> ParseError -> Bool # | |
Show ParseError Source # | |
Defined in Text.ParserCombinators.Parsec.Error showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # |
errorPos :: ParseError -> SourcePos Source #
Extracts the source position from the parse error
type SourceName = String 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.
incSourceColumn :: SourcePos -> Column -> SourcePos Source #
Increments the column number of a source position.
incSourceLine :: SourcePos -> Line -> SourcePos Source #
Increments the line number of a source position.
setSourceColumn :: SourcePos -> Column -> SourcePos Source #
Set the column number of a source position.
setSourceName :: SourcePos -> SourceName -> SourcePos Source #
Set the name of the source.
sourceColumn :: SourcePos -> Column Source #
the column number from a source position
sourceLine :: SourcePos -> Line Source #
the line number from a source position
sourceName :: SourcePos -> SourceName Source #
the name of the source from a position