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 (Prod r e t a)) -> ST s (i -> ST s (Result s e i a))
- allParses :: (forall s. ST s (i -> ST s (Result s e i a))) -> i -> ([(a, Int)], Report e i)
- fullParses :: ListLike i t => (forall s. ST s (i -> ST s (Result s e i a))) -> i -> ([a], Report e i)
- report :: ListLike i t => (forall s. ST s (i -> ST s (Result s e i a))) -> i -> 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 (Prod r e t a)) -> ST s (i -> ST s (Result s e i a)) Source
Create a parser from the given grammar.
allParses :: (forall s. ST s (i -> ST s (Result s e i a))) -> i -> ([(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.