Copyright | (c) 2013-2016 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Cryptol.Parser.Lexer
Description
At present Alex generates code with too many warnings.
- primLexer :: Config -> Text -> ([Located Token], Position)
- lexer :: Config -> Text -> ([Located Token], Position)
- data Layout
- data Token = Token {}
- data TokenT
- data TokenV
- data TokenKW
- = KW_Arith
- | KW_Bit
- | KW_Cmp
- | KW_else
- | KW_Eq
- | KW_extern
- | KW_fin
- | KW_if
- | KW_private
- | KW_include
- | KW_inf
- | KW_lg2
- | KW_lengthFromThen
- | KW_lengthFromThenTo
- | KW_max
- | KW_min
- | KW_module
- | KW_newtype
- | KW_pragma
- | KW_property
- | KW_then
- | KW_type
- | KW_where
- | KW_let
- | KW_x
- | KW_import
- | KW_as
- | KW_hiding
- | KW_infixl
- | KW_infixr
- | KW_infix
- | KW_primitive
- data TokenErr
- data TokenSym
- data TokenW
- data Located a = Located {}
- data Config = Config {
- cfgSource :: !FilePath
- cfgLayout :: !Layout
- cfgPreProc :: PreProc
- cfgAutoInclude :: [FilePath]
- cfgModuleScope :: Bool
- defaultConfig :: Config
Documentation
primLexer :: Config -> Text -> ([Located Token], Position) Source
Returns the tokens and the last position of the input that we processed. The tokens include whte space tokens.
lexer :: Config -> Text -> ([Located Token], Position) Source
Returns the tokens in the last position of the input that we processed. White space is removed, and layout processing is done as requested. This stream is fed to the parser.
Constructors
Num Integer Int Int | value, base, number of digits |
ChrLit Char | character literal |
Ident [String] String | (qualified) identifier |
StrLit String | string literal |
KW TokenKW | keyword |
Op TokenOp | operator |
Sym TokenSym | symbol |
Virt TokenV | virtual token (for layout) |
White TokenW | white space token |
Err TokenErr | error token |
EOF |
Virtual tokens, inserted by layout processing.
Constructors
Constructors
BlockComment | |
LineComment | |
Space | |
DocStr |
Instances
Functor Located Source | |
Eq a => Eq (Located a) Source | |
Show a => Show (Located a) Source | |
Generic (Located a) Source | |
NFData a => NFData (Located a) Source | |
PPName a => PPName (Located a) Source | |
PP a => PP (Located a) Source | |
AddLoc (Located a) Source | |
HasLoc (Located a) Source | |
NoPos (Located t) Source | |
type Rep (Located a) Source |
Constructors
Config | |
Fields
|