GMP.Lexer.hs revision 61b020f416f2204caf544da16d97b9955148b53e
module GMP.Lexer where
import qualified Text.ParserCombinators.Parsec.Token as T
-------------------------------------------------------------------------------
-- The lexer
-------------------------------------------------------------------------------
lexer :: T.TokenParser st
lexer = T.makeTokenParser gmpDef
--lexeme = T.lexeme lexer
--parens = T.parens lexer
--braces = T.braces lexer
--semiSep = T.semiSep lexer
--semiSep1 = T.semiSep1 lexer
--commaSep = T.commaSep lexer
--commaSep1 = T.commaSep1 lexer
whiteSpace :: CharParser st ()
whiteSpace = T.whiteSpace lexer
--symbol = T.symbol lexer
--identifier = T.identifier lexer
--reserved = T.reserved lexer
natural :: CharParser st Integer
natural = T.natural lexer
gmpDef :: LanguageDef st
gmpDef
= haskellStyle
{ identStart = letter
, identLetter = alphaNum <|> oneOf "_'" -- ???
, opStart = opLetter gmpDef
, opLetter = oneOf "\\-<>/~[]"
, reservedOpNames = ["~","->","<-","<->","/\\","\\/","[]","<>"]
}
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------