epic

Epic.Lexer

# Documentation

type LineNumber = Int

type P a = String -> String -> LineNumber -> Result a

getLineNo :: P LineNumber

getFileName :: P String

getContent :: P String

thenP :: P a -> (a -> P b) -> P b

returnP :: a -> P a

failP :: String -> P a

catchP :: P a -> (String -> P a) -> P a

happyError :: P a

reportError :: String -> P a

data Token

Constructors

TokenName Name |
TokenString String |
TokenInt Int |
TokenFloat Double |
TokenBigInt Integer |
TokenBigFloat Double |
TokenChar Char |
TokenBool Bool |
TokenIntType |
TokenBigIntType |
TokenCharType |
TokenBoolType |
TokenFloatType |
TokenBigFloatType |
TokenStringType |
TokenPtrType |
TokenUnitType |
TokenAnyType |
TokenDataType |
TokenTyCType |
TokenTyLinear |
TokenTyEval |
TokenFunType |
TokenForeign |
TokenCInclude |
TokenLink |
TokenInline |
TokenOB |
TokenCB |
TokenOCB |
TokenCCB |
TokenOSB |
TokenCSB |
TokenPlus |
TokenMinus |
TokenTimes |
TokenDivide |
TokenMod |
TokenFPlus |
TokenFMinus |
TokenFTimes |
TokenFDivide |
TokenEquals |
TokenEQ |
TokenGE |
TokenLE |
TokenGT |
TokenLT |
TokenFEQ |
TokenFGE |
TokenFLE |
TokenFGT |
TokenFLT |
TokenShL |
TokenShR |
TokenArrow |
TokenColon |
TokenUnit |
TokenCon |
TokenDefault |
TokenExport |
TokenCType |
TokenLet |
TokenCase |
TokenOf |
TokenIf |
TokenThen |
TokenElse |
TokenWhile |
TokenUnused |
TokenIn |
TokenLazy |
TokenPar |
TokenStrict |
TokenEffect |
TokenError |
TokenImpossible |
TokenProj |
TokenSemi |
TokenComma |
TokenBar |
TokenLam |
TokenDot |
TokenExtern |
TokenMemory |
TokenFixed |
TokenGrowable |
TokenInclude |
TokenEOF |

Instances

Eq Token |
Show Token |

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

readNum :: String -> (String, String, Bool)

mkname :: String -> Token

getstr :: String -> Maybe (String, String, Int)

getchar :: String -> Maybe (Char, String)