ats-format-0.1.0.1: A source-code formatter for ATS

Safe HaskellNone
LanguageHaskell2010

Language.ATS.Lexer

Description

Module exporting the lexer itself as well as several data types for working with tokens.

Synopsis

Documentation

data AlexPosn Source #

Constructors

AlexPn !Int !Int !Int 

data Token Source #

Instances

Eq Token Source # 

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token Source # 

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

Generic Token Source # 

Associated Types

type Rep Token :: * -> * #

Methods

from :: Token -> Rep Token x #

to :: Rep Token x -> Token #

NFData Token Source # 

Methods

rnf :: Token -> () #

type Rep Token # 
type Rep Token = D1 * (MetaData "Token" "Language.ATS.Lexer" "ats-format-0.1.0.1-9jl24t5OpRSBe7Tr5f8MVU" False) ((:+:) * ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Semicolon" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn))) (C1 * (MetaCons "Identifier" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String))))) ((:+:) * (C1 * (MetaCons "Keyword" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Keyword)))) (C1 * (MetaCons "BoolTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))))) ((:+:) * ((:+:) * (C1 * (MetaCons "IntTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int)))) (C1 * (MetaCons "FloatTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Float))))) ((:+:) * (C1 * (MetaCons "CharTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Char)))) (C1 * (MetaCons "StringTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String))))))) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Special" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))) (C1 * (MetaCons "CBlockLex" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String))))) ((:+:) * (C1 * (MetaCons "Operator" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))) (C1 * (MetaCons "Arrow" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))))) ((:+:) * ((:+:) * (C1 * (MetaCons "FuncType" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))) (C1 * (MetaCons "CommentLex" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String))))) ((:+:) * (C1 * (MetaCons "RefTok" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn))) ((:+:) * (C1 * (MetaCons "DefineBlock" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))) (C1 * (MetaCons "TimeTok" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AlexPosn)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))))))))

data Keyword Source #

Instances

Eq Keyword Source # 

Methods

(==) :: Keyword -> Keyword -> Bool #

(/=) :: Keyword -> Keyword -> Bool #

Show Keyword Source # 
Generic Keyword Source # 

Associated Types

type Rep Keyword :: * -> * #

Methods

from :: Keyword -> Rep Keyword x #

to :: Rep Keyword x -> Keyword #

NFData Keyword Source # 

Methods

rnf :: Keyword -> () #

type Rep Keyword # 
type Rep Keyword = D1 * (MetaData "Keyword" "Language.ATS.Lexer" "ats-format-0.1.0.1-9jl24t5OpRSBe7Tr5f8MVU" False) ((:+:) * ((:+:) * ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "KwFun" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwFnx" PrefixI False) (U1 *)) (C1 * (MetaCons "KwAnd" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwDatatype" PrefixI False) (U1 *)) (C1 * (MetaCons "KwDatavtype" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwDataviewtype" PrefixI False) (U1 *)) (C1 * (MetaCons "KwAssume" PrefixI False) (U1 *))))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwTypedef" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwVtypedef" PrefixI False) (U1 *)) (C1 * (MetaCons "KwStaload" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwLet" PrefixI False) (U1 *)) (C1 * (MetaCons "KwIn" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwLocal" PrefixI False) (U1 *)) (C1 * (MetaCons "KwEnd" PrefixI False) (U1 *)))))) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "KwImplement" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwCase" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Addendum))) (C1 * (MetaCons "KwIf" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwSif" PrefixI False) (U1 *)) (C1 * (MetaCons "KwThen" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwElse" PrefixI False) (U1 *)) (C1 * (MetaCons "KwString" PrefixI False) (U1 *))))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwBool" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwInt" PrefixI False) (U1 *)) (C1 * (MetaCons "KwVoid" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwNat" PrefixI False) (U1 *)) (C1 * (MetaCons "KwVal" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Addendum)))) ((:+:) * (C1 * (MetaCons "KwVar" PrefixI False) (U1 *)) (C1 * (MetaCons "KwLambda" PrefixI False) (U1 *))))))) ((:+:) * ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "KwLinearLambda" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwInclude" PrefixI False) (U1 *)) (C1 * (MetaCons "KwWhen" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwOf" PrefixI False) (U1 *)) (C1 * (MetaCons "KwAbsprop" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwPrval" PrefixI False) (U1 *)) (C1 * (MetaCons "KwStadef" PrefixI False) (U1 *))))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwPraxi" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwWhile" PrefixI False) (U1 *)) (C1 * (MetaCons "KwWhere" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwBegin" PrefixI False) (U1 *)) (C1 * (MetaCons "KwOverload" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwWith" PrefixI False) (U1 *)) (C1 * (MetaCons "KwChar" PrefixI False) (U1 *)))))) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "KwDataview" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "KwDataprop" PrefixI False) (U1 *)) (C1 * (MetaCons "KwView" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwAbstype" PrefixI False) (U1 *)) (C1 * (MetaCons "KwType" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwAbst0p" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Addendum))) (C1 * (MetaCons "KwT0p" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Addendum)))))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwVt0p" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Addendum))) ((:+:) * (C1 * (MetaCons "KwPrfun" PrefixI False) (U1 *)) (C1 * (MetaCons "KwPrfn" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwCastfn" PrefixI False) (U1 *)) (C1 * (MetaCons "KwExtern" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwAbsvtype" PrefixI False) (U1 *)) (C1 * (MetaCons "KwProofImplement" PrefixI False) (U1 *))))))))

data Addendum Source #

Constructors

None 
Plus 
Minus 

Instances

Eq Addendum Source # 
Show Addendum Source # 
Generic Addendum Source # 

Associated Types

type Rep Addendum :: * -> * #

Methods

from :: Addendum -> Rep Addendum x #

to :: Rep Addendum x -> Addendum #

NFData Addendum Source # 

Methods

rnf :: Addendum -> () #

type Rep Addendum # 
type Rep Addendum = D1 * (MetaData "Addendum" "Language.ATS.Lexer" "ats-format-0.1.0.1-9jl24t5OpRSBe7Tr5f8MVU" False) ((:+:) * (C1 * (MetaCons "None" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "Plus" PrefixI False) (U1 *)) (C1 * (MetaCons "Minus" PrefixI False) (U1 *))))

lexATS :: String -> [Token] Source #

This function turns a string into a stream of tokens for the parser.