| ||||||||
| ||||||||
| Description | ||||||||
This module provides the Parsek library developed by Koen Claessen in his functional pearl article Parallel Parsing Processes, Journal of Functional Programming, 14(6), 741757, Cambridge University Press, 2004: http://www.cs.chalmers.se/~koen/pubs/entry-jfp04-parser.html http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/ http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/code/week3/Parsek.hs Copyright (C) 2003 Koen Claessen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||||||
| Documentation | ||||||||
| data Parser s a | ||||||||
| ||||||||
| type Expect = [String] | ||||||||
| type Unexpect = [String] | ||||||||
| satisfy :: Show s => (s -> Bool) -> Parser s s | ||||||||
| look :: Parser s [s] | ||||||||
| succeeds :: Parser s a -> Parser s (Maybe a) | ||||||||
| string :: (Eq s, Show s) => [s] -> Parser s [s] | ||||||||
| anySymbol :: Parser s s | ||||||||
| munch :: (s -> Bool) -> Parser s [s] | ||||||||
| munch1 :: Show s => (s -> Bool) -> Parser s [s] | ||||||||
| label :: Parser s a -> String -> Parser s a | ||||||||
| (<?>) :: Parser s a -> String -> Parser s a | ||||||||
| pzero :: Parser s a | ||||||||
| (<|>) :: Parser s a -> Parser s a -> Parser s a | ||||||||
| (<<|>) :: Parser s a -> Parser s a -> Parser s a | ||||||||
| try :: Parser s a -> Parser s a | ||||||||
| choice :: [Parser s a] -> Parser s a | ||||||||
| option :: a -> Parser s a -> Parser s a | ||||||||
| optional :: Parser s a -> Parser s () | ||||||||
| between :: Parser s open -> Parser s close -> Parser s a -> Parser s a | ||||||||
| count :: Int -> Parser s a -> Parser s [a] | ||||||||
| chainl1 :: Parser s a -> Parser s (a -> a -> a) -> Parser s a | ||||||||
| chainl :: Parser s a -> Parser s (a -> a -> a) -> a -> Parser s a | ||||||||
| chainr1 :: Parser s a -> Parser s (a -> a -> a) -> Parser s a | ||||||||
| chainr :: Parser s a -> Parser s (a -> a -> a) -> a -> Parser s a | ||||||||
| skipMany1 :: Parser s a -> Parser s () | ||||||||
| skipMany :: Parser s a -> Parser s () | ||||||||
| many1 :: Parser s a -> Parser s [a] | ||||||||
| many :: Parser s a -> Parser s [a] | ||||||||
| sepBy1 :: Parser s a -> Parser s sep -> Parser s [a] | ||||||||
| sepBy :: Parser s a -> Parser s sep -> Parser s [a] | ||||||||
| type ParseMethod s a e r = P s a -> [s] -> ParseResult e r | ||||||||
| type ParseResult e r = Either (e, Expect, Unexpect) r | ||||||||
| parseFromFile :: Parser Char a -> ParseMethod Char a e r -> FilePath -> IO (ParseResult e r) | ||||||||
| parse :: Parser s a -> ParseMethod s a e r -> [s] -> ParseResult e r | ||||||||
| shortestResult :: ParseMethod s a (Maybe s) a | ||||||||
| longestResult :: ParseMethod s a (Maybe s) a | ||||||||
| longestResults :: ParseMethod s a (Maybe s) [a] | ||||||||
| allResults :: ParseMethod s a (Maybe s) [a] | ||||||||
| allResultsStaged :: ParseMethod s a (Maybe s) [[a]] | ||||||||
| completeResults :: ParseMethod s a (Maybe s) [a] | ||||||||
| shortestResultWithLeftover :: ParseMethod s a (Maybe s) (a, [s]) | ||||||||
| longestResultWithLeftover :: ParseMethod s a (Maybe s) (a, [s]) | ||||||||
| longestResultsWithLeftover :: ParseMethod s a (Maybe s) ([a], Maybe [s]) | ||||||||
| allResultsWithLeftover :: ParseMethod s a (Maybe s) [(a, [s])] | ||||||||
| completeResultsWithLine :: ParseMethod Char a Int [a] | ||||||||
| Produced by Haddock version 0.8 |