GroteTrap-0.5: Parser and selection library for expression languages.

Language.GroteTrap.Lexer

Contents

Description

Deriving a lexer from a Language.

Synopsis

Types

data Token Source

The tokenizer produces a list of tokens.

Instances

Tokenizing

run :: Monad m => String -> GenParser tok () a -> [tok] -> m aSource

run sourceName p input runs the specified parser on the input, returning the result in a monad.

tokenize :: Monad m => Language a -> String -> m [TokenPos]Source

When given a language, transforms a list of characters into a list of tokens.

isWhite :: Token -> BoolSource

Whether the token is whitespace.