 | haskell-src-1.0.1.3: Manipulating Haskell source code | Contents | Index |
|
| Language.Haskell.ParseMonad | | Portability | portable | | Stability | experimental | | Maintainer | libraries@haskell.org |
|
|
|
|
|
| Description |
| Monads for the Haskell parser and lexer.
|
|
| Synopsis |
|
|
|
|
| Parsing
|
|
| data P a |
| Monad for parsing
| Instances | |
|
|
| data ParseResult a |
| The result of a parse.
| | Constructors | | ParseOk a | The parse succeeded, yielding a value.
| | ParseFailed SrcLoc String | The parse failed at the specified
source location, with an error message.
|
| Instances | |
|
|
| atSrcLoc :: P a -> SrcLoc -> P a |
|
| data LexContext |
| Constructors | | Instances | |
|
|
| data ParseMode |
| Static parameters governing a parse.
More to come later, e.g. literate mode, language extensions.
| | Constructors | | ParseMode | | | parseFilename :: String | original name of the file being parsed
|
|
|
|
|
| defaultParseMode :: ParseMode |
| Default parameters for a parse,
currently just a marker for an unknown filename.
|
|
| runParserWithMode :: ParseMode -> P a -> String -> ParseResult a |
|
| runParser :: P a -> String -> ParseResult a |
|
| getSrcLoc :: P SrcLoc |
|
| pushCurrentContext :: P () |
|
| popContext :: P () |
|
| Lexing
|
|
| data Lex r a |
Instances | |
|
|
| getInput :: Lex r String |
|
| discard :: Int -> Lex r () |
| Discard some input characters (these must not include tabs or newlines).
|
|
| lexNewline :: Lex a () |
| Discard the next character, which must be a newline.
|
|
| lexTab :: Lex a () |
| Discard the next character, which must be a tab.
|
|
| lexWhile :: (Char -> Bool) -> Lex a String |
|
| alternative :: Lex a v -> Lex a (Lex a v) |
|
| checkBOL :: Lex a Bool |
|
| setBOL :: Lex a () |
|
| startToken :: Lex a () |
|
| getOffside :: Lex a Ordering |
|
| pushContextL :: LexContext -> Lex a () |
|
| popContextL :: String -> Lex a () |
|
| Produced by Haddock version 2.7.2 |