record Stack : Type -> Type -> Bits32 -> Type -> TypeA general-purpose mutable parser stack that can be used in many common
situation, such as when needing just a lexer or wanting to parse
a single value of a simple type.
For concrete usage examples, see ilex-json and ilex-toml, which both
make use of this type as their mutable parser state.
If you are writing a parser for something complex such as a programming
language, you're probably going to need quite a few custom fields, so
feel free to come up with your own.
S : Ref q ByteString -> Ref q ByteString -> Ref q Nat -> Ref q Integer -> Ref q Nat -> Ref q (SnocList BytePos) -> Ref q a -> Ref q (Index r) -> Ref q (SnocList String) -> Ref q (Maybe (BBErr e)) -> Stack e a r q.cur_ : Stack e a r q -> Ref q ByteString.error_ : Stack e a r q -> Ref q (Maybe (BBErr e)).len_ : Stack e a r q -> Ref q Nat.offset_ : Stack e a r q -> Ref q Nat.positions_ : Stack e a r q -> Ref q (SnocList BytePos).prev_ : Stack e a r q -> Ref q ByteString.relpos_ : Stack e a r q -> Ref q Integer.stack_ : Stack e a r q -> Ref q a.state_ : Stack e a r q -> Ref q (Index r).strings_ : Stack e a r q -> Ref q (SnocList String).prev_ : Stack e a r q -> Ref q ByteStringprev_ : Stack e a r q -> Ref q ByteString.cur_ : Stack e a r q -> Ref q ByteStringcur_ : Stack e a r q -> Ref q ByteString.offset_ : Stack e a r q -> Ref q Natoffset_ : Stack e a r q -> Ref q Nat.relpos_ : Stack e a r q -> Ref q Integerrelpos_ : Stack e a r q -> Ref q Integer.len_ : Stack e a r q -> Ref q Natlen_ : Stack e a r q -> Ref q Nat.positions_ : Stack e a r q -> Ref q (SnocList BytePos)positions_ : Stack e a r q -> Ref q (SnocList BytePos).stack_ : Stack e a r q -> Ref q astack_ : Stack e a r q -> Ref q a.state_ : Stack e a r q -> Ref q (Index r)state_ : Stack e a r q -> Ref q (Index r).strings_ : Stack e a r q -> Ref q (SnocList String)strings_ : Stack e a r q -> Ref q (SnocList String).error_ : Stack e a r q -> Ref q (Maybe (BBErr e))error_ : Stack e a r q -> Ref q (Maybe (BBErr e))init : {auto 0 _ : 0 < r} -> a -> F1 q (Stack e a r q)Initializes a new parser stack.
0 Tok : Type -> Type0 Toks : Type -> Type0 Skot : Type -> Type0 L1 : Type -> Type -> Type -> Type0 Lexer : Type -> Type -> TypepushBounded : HasBytes s => HasStack s (Skot a) => RExp True -> {auto 0 _ : 0 < r} -> s q => a -> F1 q (Index r)tok : HasBytes s => HasStack s (Skot a) => RExp True -> {auto 0 _ : 0 < r} -> a -> (RExp True, Step q r s)byteTok : HasBytes s => HasStack s (Skot a) => RExp True -> {auto 0 _ : 0 < r} -> (ByteString -> a) -> (RExp True, Step q r s)stringTok : HasBytes s => HasStack s (Skot a) => RExp True -> {auto 0 _ : 0 < r} -> (String -> a) -> (RExp True, Step q r s)lexEOI : {auto 0 _ : 0 < r} -> HasStack s (SnocList a) => HasBBErr s e => HasBytes s => Index r -> s q -> F1 q (Either (BBErr e) (List a))lexer : {auto 0 _ : 0 < r} -> Steps q r (Stack e (Skot a) r) -> L1 q e adata Token : Type -> Type -> TypeDescription of lexicographic tokens
Ignore : Token e aMarks a terminal state that does not produce a token.
This can be used for comments or whitespace that should be
ignored.
Const : a -> Token e aA constant token that allows us to emit a value directly.
Txt : (String -> Either e a) -> Token e aA token that needs to be parsed from its corresponding bytestring.
Bytes : (ByteString -> Either e a) -> Token e aA token that needs to be parsed from its corresponding bytestring.
const : a -> Token e atxt : (String -> a) -> Token e abytes : (ByteString -> a) -> Token e a0 PVal1 : Type -> Type -> Type -> Typevalue : Maybe a -> TokenMap (Token e a) -> PVal1 q e aParser for simple values based on regular expressions.