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

Safe HaskellSafe-Inferred
LanguageHaskell98

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 a Source

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 -> Bool Source

Whether the token is whitespace.