ghc-7.6.3: The GHC API

Safe Haskell | None

Lexer

# Documentation

data Token

Constructors

ITas |
ITcase |
ITclass |
ITdata |
ITdefault |
ITderiving |
ITdo |
ITelse |
IThiding |
ITif |
ITimport |
ITin |
ITinfix |
ITinfixl |
ITinfixr |
ITinstance |
ITlet |
ITmodule |
ITnewtype |
ITof |
ITqualified |
ITthen |
ITtype |
ITwhere |
ITscc |
ITforall |
ITforeign |
ITexport |
ITlabel |
ITdynamic |
ITsafe |
ITinterruptible |
ITunsafe |
ITstdcallconv |
ITccallconv |
ITcapiconv |
ITprimcallconv |
ITmdo |
ITfamily |
ITgroup |
ITby |
ITusing |
ITinline_prag InlineSpec RuleMatchInfo |
ITspec_prag |
ITspec_inline_prag Bool |
ITsource_prag |
ITrules_prag |
ITwarning_prag |
ITdeprecated_prag |
ITline_prag |
ITscc_prag |
ITgenerated_prag |
ITcore_prag |
ITunpack_prag |
ITnounpack_prag |
ITann_prag |
ITclose_prag |
IToptions_prag String |
ITinclude_prag String |
ITlanguage_prag |
ITvect_prag |
ITvect_scalar_prag |
ITnovect_prag |
ITctype |
ITdotdot |
ITcolon |
ITdcolon |
ITequal |
ITlam |
ITlcase |
ITvbar |
ITlarrow |
ITrarrow |
ITat |
ITtilde |
ITtildehsh |
ITdarrow |
ITminus |
ITbang |
ITstar |
ITdot |
ITbiglam |
ITocurly |
ITccurly |
ITvocurly |
ITvccurly |
ITobrack |
ITopabrack |
ITcpabrack |
ITcbrack |
IToparen |
ITcparen |
IToubxparen |
ITcubxparen |
ITsemi |
ITcomma |
ITunderscore |
ITbackquote |
ITsimpleQuote |
ITvarid FastString |
ITconid FastString |
ITvarsym FastString |
ITconsym FastString |
ITqvarid (FastString, FastString) |
ITqconid (FastString, FastString) |
ITqvarsym (FastString, FastString) |
ITqconsym (FastString, FastString) |
ITprefixqvarsym (FastString, FastString) |
ITprefixqconsym (FastString, FastString) |
ITdupipvarid FastString |
ITchar Char |
ITstring FastString |
ITinteger Integer |
ITrational FractionalLit |
ITprimchar Char |
ITprimstring FastString |
ITprimint Integer |
ITprimword Integer |
ITprimfloat FractionalLit |
ITprimdouble FractionalLit |
ITopenExpQuote |
ITopenPatQuote |
ITopenDecQuote |
ITopenTypQuote |
ITcloseQuote |
ITidEscape FastString |
ITparenEscape |
ITtyQuote |
ITquasiQuote (FastString, FastString, RealSrcSpan) |
ITqQuasiQuote (FastString, FastString, FastString, RealSrcSpan) |
ITproc |
ITrec |
IToparenbar |
ITcparenbar |
ITlarrowtail |
ITrarrowtail |
ITLarrowtail |
ITRarrowtail |
ITunknown String |
ITeof |
ITdocCommentNext String |
ITdocCommentPrev String |
ITdocCommentNamed String |
ITdocSection Int String |
ITdocOptions String |
ITdocOptionsOld String |
ITlineComment String |
ITblockComment String |

Instances

Show Token |

lexer :: (Located Token -> P a) -> P a

pragState :: DynFlags -> StringBuffer -> RealSrcLoc -> PState

mkPState :: DynFlags -> StringBuffer -> RealSrcLoc -> PState

data PState

Constructors

PState |

Fields

buffer :: StringBuffer
dflags :: DynFlags
messages :: Messages
last_tk :: Maybe Token
last_loc :: RealSrcSpan
last_len :: !Int
loc :: RealSrcLoc
extsBitmap :: !Int
context :: [LayoutContext]
lex_state :: [Int]
srcfiles :: [FastString]
alr_pending_implicit_tokens :: [RealLocated Token]
alr_next_token :: Maybe (RealLocated Token)
alr_last_loc :: RealSrcSpan
alr_context :: [ALRContext]
alr_expecting_ocurly :: Maybe ALRLayout
alr_justClosedExplicitLetBlock :: Bool

newtype P a

Constructors

P |

Fields

unP :: PState -> ParseResult a

Instances

Monad P |
HasDynFlags P |

data ParseResult a

Constructors

POk PState a |
PFailed SrcSpan MsgDoc |

getSrcLoc :: P RealSrcLoc

getPState :: P PState

getDynFlags :: HasDynFlags m => m DynFlags

withThisPackage :: (PackageId -> a) -> P a

failLocMsgP :: RealSrcLoc -> RealSrcLoc -> String -> P a

failSpanMsgP :: SrcSpan -> SDoc -> P a

srcParseFail :: P a

getMessages :: PState -> Messages

popContext :: P ()

pushCurrentContext :: P ()

setLastToken :: RealSrcSpan -> Int -> P ()

setSrcLoc :: RealSrcLoc -> P ()

activeContext :: P Bool

nextIsEOF :: P Bool

getLexState :: P Int

popLexState :: P Int

pushLexState :: Int -> P ()

extension :: (Int -> Bool) -> P Bool

bangPatEnabled :: Int -> Bool

datatypeContextsEnabled :: Int -> Bool

traditionalRecordSyntaxEnabled :: Int -> Bool

typeLiteralsEnabled :: Int -> Bool

explicitNamespacesEnabled :: Int -> Bool

addWarning :: WarningFlag -> SrcSpan -> SDoc -> P ()

lexTokenStream :: StringBuffer -> RealSrcLoc -> DynFlags -> ParseResult [Located Token]