BNFC-meta-0.4.0.1: Deriving Parsers and Quasi-Quoters from BNF Grammars

Safe HaskellNone

Language.LBNF.Compiletime

Contents

Description

Contains things needed by BNFC-meta language definitions and by the code generated from those. Typical users don't need to browse this module.

Synopsis

Happy and Alex

data HappyStk a

Constructors

HappyStk a (HappyStk a) 

utf8Encode :: Char -> [Word8]

data Posn

Constructors

Pn !Int !Int !Int 

Instances

Eq Posn 
Ord Posn 
Show Posn 

type AlexInput = (Posn, Char, [Word8], String)

alexGetByte :: AlexInput -> Maybe (Word8, AlexInput)

ord :: Char -> Int

listArray :: Ix i => (i, i) -> [e] -> Array i e

(!) :: Ix i => Array i e -> i -> e

data Array i e

Instances

Typeable2 Array 
Ix i => Functor (Array i) 
(Ix i, Eq e) => Eq (Array i e) 
(Typeable a, Data b, Ix a) => Data (Array a b) 
(Ix i, Ord e) => Ord (Array i e) 
(Ix a, Read a, Read b) => Read (Array a b) 
(Ix a, Show a, Show b) => Show (Array a b) 

Pretty printing

printTree :: Print a => a -> String

doc :: ShowS -> Doc

concatD :: [Doc] -> Doc

class Print a where

Methods

prt :: Int -> a -> Doc

prtList :: [a] -> Doc

prPrec :: Int -> Int -> Doc -> Doc

newtype PrintPlain

Constructors

MkPrintPlain String 

Instances

Quasi quoting

parseToQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter

parseToMonQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter

data ParseMonad a

Constructors

Ok a 
Bad String 

Instances

Monad ParseMonad 
Functor ParseMonad 
Eq a => Eq (ParseMonad a) 
Ord a => Ord (ParseMonad a) 
Read a => Read (ParseMonad a) 
Show a => Show (ParseMonad a) 

errq :: (String -> a) -> ParseMonad a -> Q a

data Q a

Instances

Monad Q 
Functor Q 
Applicative Q 
Quasi Q 

data BNFC_QQType

Constructors

QQApp (String, LocType) [BNFC_QQType] 
QQAq (Q Exp, Q Pat) 
QQList [BNFC_QQType] 
QQLit Lit 
QQPosT (Int, Int) (String, LocType) String 

fromToken :: Literal a => LocType -> String -> a -> BNFC_QQType

fromPositionToken :: LocType -> String -> ((Int, Int), String) -> BNFC_QQType

class Lift t where

Methods

lift :: t -> Q Exp

Instances

Lift Bool 
Lift Char 
Lift Int 
Lift Integer 
Lift Rational 
Lift Word8 
Lift Exp 
Lift Match 
Lift Clause 
Lift Pat 
Lift Type 
Lift Dec 
Lift Name 
Lift FunDep 
Lift Pred 
Lift TyVarBndr 
Lift () 
Lift TyLit 
Lift Strict 
Lift Stmt 
Lift Safety 
Lift RuleMatch 
Lift RuleBndr 
Lift Range 
Lift Pragma 
Lift Phases 
Lift NameSpace 
Lift Lit 
Lift Inline 
Lift Info 
Lift Guard 
Lift Foreign 
Lift FixityDirection 
Lift Fixity 
Lift FamFlavour 
Lift Con 
Lift Callconv 
Lift Body 
Lift NameFlavour 
Lift OccName 
Lift PkgName 
Lift ModName 
Lift a => Lift [a] 
Lift a => Lift (Maybe a) 
(Lift a, Lift b) => Lift (Either a b) 
(Lift a, Lift b) => Lift (a, b) 
(Lift a, Lift b, Lift c) => Lift (a, b, c) 
(Lift a, Lift b, Lift c, Lift d) => Lift (a, b, c, d) 
(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift (a, b, c, d, e) 
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift (a, b, c, d, e, f) 
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift (a, b, c, d, e, f, g) 

type LocType = (String, String)

class Literal a where

Methods

lit :: a -> Lit

Instances

Literal Char 
Literal Double 
Literal Integer 
IsChar a => Literal [a] 

class IsChar a where

Methods

toChar :: a -> Char

Instances

IsChar Char 

Helper functions for defining Anti-quotation

stringAq :: String -> BNFC_QQType