futhark-0.25.9: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Futhark.Parser.Monad

Contents

Description

Utility functions and definitions used in the Happy-generated parser. They are defined here because the .y file is opaque to linters and other tools. In particular, we cannot enable warnings for that file, because Happy-generated code is very dirty by GHC's standards.

Synopsis

Documentation

data Comment Source #

A comment consists of its starting and end position, as well as its text. The contents include the comment start marker.

Constructors

Comment 

Instances

Instances details
Show Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Eq Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Methods

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

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

Ord Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Located Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Methods

locOf :: Comment -> Loc #

locOfList :: [Comment] -> Loc #

data SyntaxError Source #

A syntax error.

Constructors

SyntaxError 

backOneCol :: Loc -> Loc Source #

Move the end position back one column.

Reexports

data L a #

A value of type L a is a value of type a with an associated Loc, but this location is ignored when performing comparisons.

Instances

Instances details
Functor L 
Instance details

Defined in Data.Loc

Methods

fmap :: (a -> b) -> L a -> L b #

(<$) :: a -> L b -> L a #

Data a => Data (L a) 
Instance details

Defined in Data.Loc

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> L a -> c (L a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (L a) #

toConstr :: L a -> Constr #

dataTypeOf :: L a -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> L a -> L a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r #

gmapQ :: (forall d. Data d => d -> u) -> L a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> L a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> L a -> m (L a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) #

Show x => Show (L x) 
Instance details

Defined in Data.Loc

Methods

showsPrec :: Int -> L x -> ShowS #

show :: L x -> String #

showList :: [L x] -> ShowS #

Eq x => Eq (L x) 
Instance details

Defined in Data.Loc

Methods

(==) :: L x -> L x -> Bool #

(/=) :: L x -> L x -> Bool #

Ord x => Ord (L x) 
Instance details

Defined in Data.Loc

Methods

compare :: L x -> L x -> Ordering #

(<) :: L x -> L x -> Bool #

(<=) :: L x -> L x -> Bool #

(>) :: L x -> L x -> Bool #

(>=) :: L x -> L x -> Bool #

max :: L x -> L x -> L x #

min :: L x -> L x -> L x #

Pretty x => Pretty (L x) 
Instance details

Defined in Text.PrettyPrint.Mainland.Class

Methods

ppr :: L x -> Doc #

pprPrec :: Int -> L x -> Doc #

pprList :: [L x] -> Doc #

Located (L a) 
Instance details

Defined in Data.Loc

Methods

locOf :: L a -> Loc #

locOfList :: [L a] -> Loc #

Relocatable (L a) 
Instance details

Defined in Data.Loc

Methods

reloc :: Loc -> L a -> L a #

data Token Source #

A lexical token. It does not itself contain position information, so in practice the parser will consume tokens tagged with a source position.

Instances

Instances details
Show Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

Eq Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

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

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

Ord Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

compare :: Token -> Token -> Ordering #

(<) :: Token -> Token -> Bool #

(<=) :: Token -> Token -> Bool #

(>) :: Token -> Token -> Bool #

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

max :: Token -> Token -> Token #

min :: Token -> Token -> Token #