Safe Haskell | None |
---|---|
Language | Haskell2010 |
Parsing.
- data Report e i = Report {
- position :: Int
- expected :: [e]
- unconsumed :: i
- data Result s e i a
- parser :: ListLike i t => (forall r. Grammar r e (Prod r e t a)) -> i -> ST s (Result s e i a)
- allParses :: (forall s. ST s (Result s e i a)) -> ([(a, Int)], Report e i)
- fullParses :: ListLike i t => (forall s. ST s (Result s e i a)) -> ([a], Report e i)
- report :: ListLike i t => (forall s. ST s (Result s e i a)) -> Report e i
Documentation
A parsing report, which contains fields that are useful for presenting errors to the user if a parse is deemed a failure. Note however that we get a report even when we successfully parse something.
Report | |
|
The result of a parse.
Ended (Report e i) | The parser ended. |
Parsed (ST s [a]) Int i (ST s (Result s e i a)) | The parser parsed a number of |
parser :: ListLike i t => (forall r. Grammar r e (Prod r e t a)) -> i -> ST s (Result s e i a) Source
Create a parser from the given grammar.
allParses :: (forall s. ST s (Result s e i a)) -> ([(a, Int)], Report e i) Source
Return all parses from the result of a given parser. The result may
contain partial parses. The Int
s are the position at which a result was
produced.
fullParses :: ListLike i t => (forall s. ST s (Result s e i a)) -> ([a], Report e i) Source
Return all parses that reached the end of the input from the result of a given parser.