parsec-3.1.17.0: Monadic parser combinators
Copyright(c) Paolo Martini 2007
LicenseBSD-style (see the LICENSE file)
Maintainerderek.a.elkins@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

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 and Eq classes.

errorPos :: ParseError -> SourcePos Source #

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

Instances details
Data SourcePos Source # 
Instance details

Defined in Text.Parsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos Source #

toConstr :: SourcePos -> Constr Source #

dataTypeOf :: SourcePos -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) Source #

gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

Show SourcePos Source # 
Instance details

Defined in Text.Parsec.Pos

Eq SourcePos Source # 
Instance details

Defined in Text.Parsec.Pos

Ord SourcePos Source # 
Instance details

Defined in Text.Parsec.Pos

type Line = Int Source #

sourceName :: SourcePos -> SourceName Source #

Extracts the name of the source from a source position.

sourceLine :: SourcePos -> Line Source #

Extracts the line number from a source position.

sourceColumn :: SourcePos -> Column Source #

Extracts the column number from a source position.

incSourceLine :: SourcePos -> Line -> SourcePos Source #

Increments the line number of a source position.

incSourceColumn :: SourcePos -> Column -> SourcePos Source #

Increments the column number of a source position.

setSourceLine :: SourcePos -> Line -> SourcePos Source #

Set 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.