Lexer

ghc-7.0.4: The GHC API

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 |
ITthreadsafe |
ITunsafe |
ITstdcallconv |
ITccallconv |
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 |
ITann_prag |
ITclose_prag |
IToptions_prag String |
ITinclude_prag String |
ITlanguage_prag |
ITdotdot |
ITcolon |
ITdcolon |
ITequal |
ITlam |
ITvbar |
ITlarrow |
ITrarrow |
ITat |
ITtilde |
ITdarrow |
ITminus |
ITbang |
ITstar |
ITdot |
ITbiglam |
ITocurly |
ITccurly |
ITocurlybar |
ITccurlybar |
ITvocurly | }, for type applications
ITvccurly |
ITobrack |
ITopabrack |
ITcpabrack |
ITcbrack |
IToparen |
ITcparen |
IToubxparen |
ITcubxparen |
ITsemi |
ITcomma |
ITunderscore |
ITbackquote |
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 Rational |
ITprimchar Char |
ITprimstring FastString |
ITprimint Integer |
ITprimword Integer |
ITprimfloat Rational |
ITprimdouble Rational |
ITopenExpQuote |
ITopenPatQuote |
ITopenDecQuote |
ITopenTypQuote |
ITcloseQuote |
ITidEscape FastString |
ITparenEscape |
ITvarQuote |
ITtyQuote |
ITquasiQuote (FastString, FastString, SrcSpan) |
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 |

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

pragState :: DynFlags -> StringBuffer -> SrcLoc -> PState

mkPState :: DynFlags -> StringBuffer -> SrcLoc -> PState

data PState

Constructors

PState |
Fields buffer :: StringBuffer dflags :: DynFlags messages :: Messages last_loc :: SrcSpan last_len :: !Int loc :: SrcLoc extsBitmap :: !Int context :: [LayoutContext] lex_state :: [Int] alr_pending_implicit_tokens :: [Located Token] alr_next_token :: Maybe (Located Token) alr_last_loc :: SrcSpan alr_context :: [ALRContext] alr_expecting_ocurly :: Maybe ALRLayout alr_justClosedExplicitLetBlock :: Bool

newtype P a

Constructors

P |
Fields unP :: PState -> ParseResult a

Instances

Monad P |

data ParseResult a

Constructors

POk PState a |
PFailed SrcSpan Message |

getSrcLoc :: P SrcLoc

getPState :: P PState

getDynFlags :: P DynFlags

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

failLocMsgP :: SrcLoc -> SrcLoc -> String -> P a

failSpanMsgP :: SrcSpan -> SDoc -> P a

srcParseFail :: P a

getMessages :: PState -> Messages

popContext :: P ()

pushCurrentContext :: P ()

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

setSrcLoc :: SrcLoc -> P ()

getLexState :: P Int

popLexState :: P Int

pushLexState :: Int -> P ()

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

bangPatEnabled :: Int -> Bool

datatypeContextsEnabled :: Int -> Bool

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

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