Safe Haskell | None |
---|---|

Language | Haskell98 |

- data LookAhead a
- runLookAhead :: (forall b. String -> LookAhead b) -> LookAhead a -> Parser a
- getInput :: LookAhead AlexInput
- setInput :: AlexInput -> LookAhead ()
- liftP :: Parser a -> LookAhead a
- nextChar :: LookAhead Char
- eatNextChar :: LookAhead Char
- sync :: LookAhead ()
- rollback :: LookAhead ()
- match :: [(String, LookAhead a)] -> LookAhead a -> LookAhead a
- match' :: Char -> [(String, LookAhead a)] -> LookAhead a -> LookAhead a

# The LookAhead monad

runLookAhead :: (forall b. String -> LookAhead b) -> LookAhead a -> Parser a Source #

Run a `LookAhead`

computation. The first argument is the error function.

# Operations

nextChar :: LookAhead Char Source #

Look at the next character. Fails if there are no more characters.

rollback :: LookAhead () Source #

Undo look-ahead. Restores the input from the `ParseState`

.

match :: [(String, LookAhead a)] -> LookAhead a -> LookAhead a Source #

Do a case on the current input string. If any of the given strings match we move past it and execute the corresponding action. If no string matches, we execute a default action, advancing the input one character. This function only affects the look-ahead position.