camfort-1.1.0: CamFort - Cambridge Fortran infrastructure
Copyright(c) 2017 Dominic Orchard Andrew Rice Mistral Contrastin Matthew Danish
LicenseApache-2.0
Maintainerdom.orchard@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Camfort.Specification.Parser

Description

 
Synopsis

Specification Parsers

data SpecParser e r Source #

Parser for specifications of type r that may fail with error type e.

Instances

Instances details
Functor (SpecParser e) Source # 
Instance details

Defined in Camfort.Specification.Parser

Methods

fmap :: (a -> b) -> SpecParser e a -> SpecParser e b #

(<$) :: a -> SpecParser e b -> SpecParser e a #

looksLikeASpec :: SpecParser e r -> String -> Bool Source #

Check if a comment is probably an attempt at a specification that can be parsed by the given parser.

mkParser Source #

Arguments

:: (String -> Either e r)

Parser with error type e and result type r.

-> [String]

Keywords that indicate the type of specification.

-> SpecParser e r 

Define a specification parser.

runParser :: SpecParser e r -> String -> Either (SpecParseError e) r Source #

Run the given parser on a string to produce a specification (or a reason why it couldn't be parsed).

Errors

data SpecParseError e Source #

Instances

Instances details
Eq e => Eq (SpecParseError e) Source # 
Instance details

Defined in Camfort.Specification.Parser

Data e => Data (SpecParseError e) Source # 
Instance details

Defined in Camfort.Specification.Parser

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpecParseError e -> c (SpecParseError e) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SpecParseError e) #

toConstr :: SpecParseError e -> Constr #

dataTypeOf :: SpecParseError e -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> SpecParseError e -> SpecParseError e #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpecParseError e -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpecParseError e -> r #

gmapQ :: (forall d. Data d => d -> u) -> SpecParseError e -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SpecParseError e -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpecParseError e -> m (SpecParseError e) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpecParseError e -> m (SpecParseError e) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpecParseError e -> m (SpecParseError e) #

Show e => Show (SpecParseError e) Source # 
Instance details

Defined in Camfort.Specification.Parser

Exception e => Exception (SpecParseError e) Source # 
Instance details

Defined in Camfort.Specification.Parser

parseError :: e -> SpecParseError e Source #

Embed an error as a specification parse error.