package earley
Install
Dune Dependency
Authors
Maintainers
Sources
md5=6b666c0392dc5b153f81c27d6ef49b12
sha512=a81d2bcf05088a3aaa5c3c0fb3a38306061a624ddf6d8bbefee1b4a17d7a5961ad1b12c0af9bd8dce86aa14b6f05f1956b3f7b5731f3c552bec7f4550182c398
doc/earley.str/Earley_str/index.html
Module Earley_str
Source
Earley support for Str
regular expressions.
val blank_regexp :
string ->
Earley_core.Input.buffer ->
int ->
Earley_core.Input.buffer * int
blank_regexp re
produces a blank function from the regexp re
(following the Str
syntax). There is an important limitation rega- rding regular expressions containing the newline character '\n'
, due to the fact that the Str
module only matches on strings (and not on an abstract notion of buffer). Such regular expressions can only be used if they are idempotent.
val regexp :
?name:string ->
string ->
((int -> string) -> 'a) ->
'a Earley_core.Earley.grammar
regexp ?name re g
is a grammar that parses the input according to the regular expression re
, and returns a value built by applying the function g
to a function of type int -> string
that returns the substring matched by the n
-th match group of the regexp re
(as in the Str
module). The optional name
argument is used to refer to the regular expression in error messages.