fortran-src-0.4.2: Parsers and analyses for Fortran standards 66, 77, 90 and 95.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.ParserMonad

Documentation

class Tok a where Source #

Methods

eofToken :: a -> Bool Source #

Instances

Instances details
Tok Token Source # 
Instance details

Defined in Language.Fortran.Lexer.FreeForm

Methods

eofToken :: Token -> Bool Source #

Tok Token Source # 
Instance details

Defined in Language.Fortran.Lexer.FixedForm

Methods

eofToken :: Token -> Bool Source #

newtype Parse b c a Source #

Constructors

Parse 

Fields

Instances

Instances details
(Loc b, LastToken b c, Show c) => MonadState (ParseState b) (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

get :: Parse b c (ParseState b) #

put :: ParseState b -> Parse b c () #

state :: (ParseState b -> (a, ParseState b)) -> Parse b c a #

(Loc b, LastToken b c, Show c) => Monad (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

(>>=) :: Parse b c a -> (a -> Parse b c b0) -> Parse b c b0 #

(>>) :: Parse b c a -> Parse b c b0 -> Parse b c b0 #

return :: a -> Parse b c a #

(Loc b, LastToken b c, Show c) => Functor (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

fmap :: (a -> b0) -> Parse b c a -> Parse b c b0 #

(<$) :: a -> Parse b c b0 -> Parse b c a #

(Loc b, LastToken b c, Show c) => MonadFail (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

fail :: String -> Parse b c a #

(Loc b, LastToken b c, Show c) => Applicative (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

pure :: a -> Parse b c a #

(<*>) :: Parse b c (a -> b0) -> Parse b c a -> Parse b c b0 #

liftA2 :: (a -> b0 -> c0) -> Parse b c a -> Parse b c b0 -> Parse b c c0 #

(*>) :: Parse b c a -> Parse b c b0 -> Parse b c b0 #

(<*) :: Parse b c a -> Parse b c b0 -> Parse b c a #

(Loc b, LastToken b c, Show c) => MonadError (ParseError b c) (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

throwError :: ParseError b c -> Parse b c a #

catchError :: Parse b c a -> (ParseError b c -> Parse b c a) -> Parse b c a #

class LastToken a b | a -> b where Source #

Methods

getLastToken :: Show b => a -> Maybe b Source #

data ParseResult b c a Source #

Constructors

ParseOk a (ParseState b) 
ParseFailed (ParseError b c) 

Instances

Instances details
Functor (ParseResult b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

fmap :: (a -> b0) -> ParseResult b c a -> ParseResult b c b0 #

(<$) :: a -> ParseResult b c b0 -> ParseResult b c a #

data ParseError a b Source #

Instances

Instances details
Show b => Show (ParseError a b) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

showsPrec :: Int -> ParseError a b -> ShowS #

show :: ParseError a b -> String #

showList :: [ParseError a b] -> ShowS #

(Typeable a, Typeable b, Show a, Show b) => Exception (ParseError a b) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

(Loc b, LastToken b c, Show c) => MonadError (ParseError b c) (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

throwError :: ParseError b c -> Parse b c a #

catchError :: Parse b c a -> (ParseError b c -> Parse b c a) -> Parse b c a #

data ParseState a Source #

Instances

Instances details
Show a => Show (ParseState a) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

(Loc b, LastToken b c, Show c) => MonadState (ParseState b) (Parse b c) Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

get :: Parse b c (ParseState b) #

put :: ParseState b -> Parse b c () #

state :: (ParseState b -> (a, ParseState b)) -> Parse b c a #

data Context Source #

Instances

Instances details
Eq Context Source # 
Instance details

Defined in Language.Fortran.ParserMonad

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

Show Context Source # 
Instance details

Defined in Language.Fortran.ParserMonad

fromRight :: Show a => Either a b -> b Source #

putAlex :: (Loc a, LastToken a b, Show b) => a -> Parse a b () Source #

getAlex :: (Loc a, LastToken a b, Show b) => Parse a b a Source #

popContext :: (Loc a, LastToken a b, Show b) => Parse a b () Source #

pushContext :: (Loc a, LastToken a b, Show b) => Context -> Parse a b () Source #

resetPar :: (Loc a, LastToken a b, Show b) => Parse a b () Source #

incPar :: (Loc a, LastToken a b, Show b) => Parse a b () Source #

decPar :: (Loc a, LastToken a b, Show b) => Parse a b () Source #

runParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> ParseResult b c a Source #

runParseUnsafe :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> (a, ParseState b) Source #

evalParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> a Source #

execParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> ParseState b Source #

collectTokens :: forall a b. (Loc b, Tok a, LastToken b a, Show a) => Parse b a a -> ParseState b -> [a] Source #

collectTokensSafe :: forall a b. (Loc b, Tok a, LastToken b a, Show a) => Parse b a a -> ParseState b -> Maybe [a] Source #