fortran-src-0.15.0: Parsers and analyses for Fortran standards 66, 77, 90, 95 and 2003 (partial).
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Parser.Monad

Description

Parser/lexer monad, plus common functionality and definitions.

Documentation

data Context Source #

Instances

Instances details
Show Context Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

Eq Context Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

Methods

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

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

data ParseState a Source #

Instances

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

Defined in Language.Fortran.Parser.Monad

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

Defined in Language.Fortran.Parser.Monad

Methods

get :: Parse b c (ParseState b) #

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

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

data ParseError a b Source #

Instances

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

Defined in Language.Fortran.Parser.Monad

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

Defined in Language.Fortran.Parser.Monad

Methods

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

show :: ParseError a b -> String #

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

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

Defined in Language.Fortran.Parser.Monad

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 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.Parser.Monad

Methods

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

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

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

Methods

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

class Tok a where Source #

Methods

eofToken :: a -> Bool Source #

Instances

Instances details
Tok Token Source # 
Instance details

Defined in Language.Fortran.Parser.Fixed.Lexer

Methods

eofToken :: Token -> Bool Source #

Tok Token Source # 
Instance details

Defined in Language.Fortran.Parser.Free.Lexer

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.Parser.Monad

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) => MonadFail (Parse b c) Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

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.Parser.Monad

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) => Functor (Parse b c) Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

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) => Monad (Parse b c) Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

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) => MonadError (ParseError b c) (Parse b c) Source # 
Instance details

Defined in Language.Fortran.Parser.Monad

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 #

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 #

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 #