| |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| Description | |||||||||||||||||||||||||||||||||
| This library defines parser combinators for precedence parsing. | |||||||||||||||||||||||||||||||||
| Synopsis | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| Documentation | |||||||||||||||||||||||||||||||||
| data ReadPrec a | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| Precedences | |||||||||||||||||||||||||||||||||
| type Prec = Int | |||||||||||||||||||||||||||||||||
| minPrec :: Prec | |||||||||||||||||||||||||||||||||
| Precedence operations | |||||||||||||||||||||||||||||||||
| lift :: ReadP a -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Lift a precedence-insensitive ReadP to a ReadPrec. | |||||||||||||||||||||||||||||||||
| prec :: Prec -> ReadPrec a -> ReadPrec a | |||||||||||||||||||||||||||||||||
(prec n p) checks whether the precedence context is less than or equal to n, and
| |||||||||||||||||||||||||||||||||
| step :: ReadPrec a -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Increases the precedence context by one. | |||||||||||||||||||||||||||||||||
| reset :: ReadPrec a -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Resets the precedence context to zero. | |||||||||||||||||||||||||||||||||
| Other operations | |||||||||||||||||||||||||||||||||
| All are based directly on their similarly-named ReadP counterparts. | |||||||||||||||||||||||||||||||||
| get :: ReadPrec Char | |||||||||||||||||||||||||||||||||
| Consumes and returns the next character. Fails if there is no input left. | |||||||||||||||||||||||||||||||||
| look :: ReadPrec String | |||||||||||||||||||||||||||||||||
| Look-ahead: returns the part of the input that is left, without consuming it. | |||||||||||||||||||||||||||||||||
| (+++) :: ReadPrec a -> ReadPrec a -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Symmetric choice. | |||||||||||||||||||||||||||||||||
| (<++) :: ReadPrec a -> ReadPrec a -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Local, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used. | |||||||||||||||||||||||||||||||||
| pfail :: ReadPrec a | |||||||||||||||||||||||||||||||||
| Always fails. | |||||||||||||||||||||||||||||||||
| choice :: [ReadPrec a] -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Combines all parsers in the specified list. | |||||||||||||||||||||||||||||||||
| Converters | |||||||||||||||||||||||||||||||||
| readPrec_to_P :: ReadPrec a -> Int -> ReadP a | |||||||||||||||||||||||||||||||||
| readP_to_Prec :: (Int -> ReadP a) -> ReadPrec a | |||||||||||||||||||||||||||||||||
| readPrec_to_S :: ReadPrec a -> Int -> ReadS a | |||||||||||||||||||||||||||||||||
| readS_to_Prec :: (Int -> ReadS a) -> ReadPrec a | |||||||||||||||||||||||||||||||||
| Produced by Haddock version 0.8 |