parsec-3.1.7: Monadic parser combinators

Portabilityportable
Stabilityprovisional
Maintainerderek.a.elkins@gmail.com
Safe HaskellSafe-Infered

Text.ParserCombinators.Parsec

Description

Parsec compatibility module

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 

errorPos :: ParseError -> SourcePosSource

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 
Data SourcePos 
Ord SourcePos 
Show SourcePos 
Typeable SourcePos 

type SourceName = StringSource

type Line = IntSource

type Column = IntSource

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.