tokenify-0.1.2.0: A regex lexer

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Tokenify.DSL

Contents

Description

The DSL for creating a grammar/tokenizer definition for tokenizer

Synopsis

Response Constructors

fails :: Regex s -> Token s a Source

Creates a response which will fail on a regex

ignore :: Regex s -> Token s a Source

Creates a response which will ignore a regex

insert :: Regex s -> (Pos -> a) -> Token s a Source

Creates a response which consumes the text position

evaluate :: Regex s -> (s -> Pos -> a) -> Token s a Source

Creates a response which consumes the captures CharSeq and the text position

Regex Constructors

string :: s -> Regex s Source

Creates a regex that matches a string

char :: Char -> Regex s Source

Creates a regex that matches a char

range :: Char -> Char -> Regex s Source

Creates a create that will match a range of characters

alt :: Regex s -> Regex s -> Regex s Source

Creates a regex that will attmpt to make the regex on the left, if that fails it will attmpt to match the regex on the right

any :: [Regex s] -> Regex s Source

Creates a regex that will attmpt to match a Sequence of regex's in a sequencial order

append :: Regex s -> Regex s -> Regex s Source

Create a regex that appends the result of two regex's

concat :: [Regex s] -> Regex s Source

Create a regex that appends the result of a sequence of regex's

option :: Regex s -> Regex s Source

Create a regex that may or may not match a regex

repeat :: Regex s -> Regex s Source

Create a regex that matches zero or more of a regex

repeat1 :: Regex s -> Regex s Source

Create a regex that matches one or more of a regex