cryptol-2.3.0: Cryptol: The Language of Cryptography

Copyright(c) 2013-2016 Galois, Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell98

Cryptol.Parser.Lexer

Description

At present Alex generates code with too many warnings.

Synopsis

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.

data Layout Source

Constructors

Layout 
NoLayout 

data TokenT Source

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 

data TokenV Source

Virtual tokens, inserted by layout processing.

Constructors

VCurlyL 
VCurlyR 
VSemi 

data Located a Source

Constructors

Located 

Fields

srcRange :: !Range
 
thing :: 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).