uulib-0.9.8: Haskell Utrecht Tools Library

UU.Parsing.Derived

Synopsis

Documentation

acceptsepsilon :: IsParser p s => p v -> BoolSource

Checks if the parser accepts epsilon.

mnz :: IsParser p s => p v -> t -> String -> tSource

(<..>) :: IsParser p s => s -> s -> p sSource

Parses the specified range, see also pRange.

Example:

 pDig = 'a' <..> 'z'

pExcept :: (IsParser p s, Symbol s, Ord s, Eq (SymbolR s)) => (s, s, s) -> [s] -> p sSource

opt :: IsParser p s => p a -> a -> p aSource

Optionally recognize parser p.

If p can be recognized, the return value of p is used. Otherwise, the value v is used. Note that opt is greedy, if you do not want this use ... | pSucceed v instead. Furthermore, p should not recognise the empty string.

asList :: IsParser p s => Expecting s -> p v -> p vSource

asList1 :: IsParser p s => Expecting s -> p v -> p vSource

asOpt :: IsParser p s => Expecting s -> p v -> p vSource

(<+>) :: IsParser p s => p a -> p b -> p (a, b)Source

Parses the sequence of pa and pb, and combines them as a tuple.

(<**>) :: IsParser p s => p a -> p (a -> b) -> p bSource

Suppose we have a parser a with two alternatives that both start with recognizing a non-terminal p, then we will typically rewrite:

 a =     f <$> p <*> q 
     <|> g <$> p <*> r 

into:

 a = p <**> (f <$$> q <|> g <$$> r)

(<$$>) :: IsParser p s => (a -> b -> c) -> p b -> p (a -> c)Source

(<??>) :: IsParser p s => p a -> p (a -> a) -> p aSource

(<?>) :: IsParser p s => p v -> String -> p vSource

pPacked :: IsParser p s => p a -> p b1 -> p b -> p bSource

This can be used to parse x surrounded by l and r.

Example:

 pParens = pPacked pOParen pCParen

pFoldr_ng :: IsParser p s => (a -> a1 -> a1, a1) -> p a -> p a1Source

pFoldr_gr :: IsParser p s => (a -> b -> b, b) -> p a -> p bSource

pFoldr :: IsParser p s => (a -> b -> b, b) -> p a -> p bSource

pFoldr1_gr :: IsParser p s => (v -> b -> b, b) -> p v -> p bSource

pFoldr1_ng :: IsParser p s => (v -> b -> b, b) -> p v -> p bSource

pFoldr1 :: IsParser p s => (v -> b -> b, b) -> p v -> p bSource

pFoldrSep_gr :: IsParser p s => (v -> b -> b, b) -> p a -> p v -> p bSource

pFoldrSep_ng :: IsParser p s => (v -> b -> b, b) -> p a -> p v -> p bSource

pFoldrSep :: IsParser p s => (v -> b -> b, b) -> p a -> p v -> p bSource

pFoldr1Sep_gr :: IsParser p s => (a -> b -> b, b) -> p a1 -> p a -> p bSource

pFoldr1Sep_ng :: IsParser p s => (a -> b -> b, b) -> p a1 -> p a -> p bSource

pFoldr1Sep :: IsParser p s => (a -> b -> b, b) -> p a1 -> p a -> p bSource

list_alg :: (a -> [a] -> [a], [a1])Source

pList_gr :: IsParser p s => p a -> p [a]Source

pList_ng :: IsParser p s => p a -> p [a]Source

pList :: IsParser p s => p a -> p [a]Source

pList1_gr :: IsParser p s => p a -> p [a]Source

pList1_ng :: IsParser p s => p a -> p [a]Source

pList1 :: IsParser p s => p a -> p [a]Source

pListSep_gr :: IsParser p s => p a1 -> p a -> p [a]Source

pListSep_ng :: IsParser p s => p a1 -> p a -> p [a]Source

pListSep :: IsParser p s => p a -> p a1 -> p [a1]Source

pList1Sep_gr :: IsParser p s => p a1 -> p a -> p [a]Source

pList1Sep_ng :: IsParser p s => p a1 -> p a -> p [a]Source

pList1Sep :: IsParser p s => p a -> p a1 -> p [a1]Source

pChainr_gr :: IsParser p s => p (c -> c -> c) -> p c -> p cSource

pChainr_ng :: IsParser p s => p (a -> a -> a) -> p a -> p aSource

pChainr :: IsParser p s => p (c -> c -> c) -> p c -> p cSource

pChainl_gr :: IsParser p s => p (c -> c -> c) -> p c -> p cSource

pChainl_ng :: IsParser p s => p (c -> c -> c) -> p c -> p cSource

pChainl :: IsParser p s => p (c -> c -> c) -> p c -> p cSource

pAny :: IsParser p s => (a -> p a1) -> [a] -> p a1Source

Parses using any of the parsers in the list l.

Warning: l may not be an empty list.

pAnySym :: IsParser p s => [s] -> p sSource

Parses any of the symbols in l.

pToks :: IsParser p s => [s] -> p [s]Source

pLocate :: IsParser p s => [[s]] -> p [s]Source