cryptol-2.2.3: Cryptol: The Language of Cryptography

Safe HaskellTrustworthy
LanguageHaskell98

Cryptol.Parser.Lexer

Synopsis

Documentation

primLexer :: Config -> String -> ([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 -> String -> ([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.

data Layout Source

Constructors

Layout 
NoLayout 

data Token Source

Constructors

Token 

Instances

data TokenT Source

Constructors

Num Integer Int Int

value, base, number of digits

ChrLit Char

character literal

Ident String

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 

Instances

data TokenV Source

Virtual tokens, inserted by layout processing.

Constructors

VCurlyL 
VCurlyR 
VSemi 

Instances

data TokenW Source

Instances

data Located a Source

Constructors

Located 

Fields

srcRange :: !Range
 
thing :: a
 

Instances

Functor Located 
Eq a => Eq (Located a) 
Show a => Show (Located a) 
PP a => PP (Located a) 
AddLoc (Located a) 
HasLoc (Located a) 
NoPos (Located t) 
Rename a => Rename (Located a) 

data Config Source

Constructors

Config 

Fields

cfgSource :: !FilePath

File that we are working on

cfgLayout :: !Layout

Settings for layout processing

cfgPreProc :: PreProc

Preprocessor settings

cfgAutoInclude :: [FilePath]

Implicit includes

cfgModuleScope :: Bool

When we do layout processing should we add a vCurly (i.e., are we parsing a list of things).