antlr-haskell-0.1.0.0: A Haskell implementation of the ANTLR top-down parser generator

Copyright(c) Karl Cronburg 2018
LicenseBSD3
Maintainerkarl@cs.tufts.edu
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Text.ANTLR.Lex.Regex

Description

 
Synopsis

Documentation

data Regex s Source #

Regular expression data representation as used by the tokenizer.

Constructors

Epsilon

Regex accepting the empty string

Symbol s

An individual symbol in the alphabet

Literal [s]

A literal sequence of symbols (concatenated together)

Class [s]

A set of alternative symbols (unioned together)

Union (Regex s) (Regex s)

Union of two arbitrary regular expressions

Concat [Regex s]

Concatenation of 2 or more regular expressions

Kleene (Regex s)

Kleene closure of a regex

PosClos (Regex s)

Positive closure

Question (Regex s)

0 or 1 instances

MultiUnion [Regex s]

Union of two or more arbitrary regexs

NotClass [s]

Complement of a character class

Instances
Show s => Show (Regex s) Source # 
Instance details

Defined in Text.ANTLR.Lex.Regex

Methods

showsPrec :: Int -> Regex s -> ShowS #

show :: Regex s -> String #

showList :: [Regex s] -> ShowS #

Lift s => Lift (Regex s) Source # 
Instance details

Defined in Text.ANTLR.Lex.Regex

Methods

lift :: Regex s -> Q Exp #

regex2nfa' :: forall s i. (Hashable i, Ord i, Hashable s, Eq s) => (i -> Int) -> (Int -> i) -> Regex s -> NFA s i Source #

Translation code of a regular expresion to an NFA.

regex2nfa :: (Hashable s, Ord s) => Regex s -> NFA s Int Source #

Entrypoint for translating a regular expression into an NFA with integer indices.

regex2dfa :: (Hashable s, Ord s) => Regex s -> DFA s (DFAState Int) Source #

Entrypoint for translating a regular expression into a DFA with integer indices.