caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ann] Regexp library supporting binding for * and +'s
@ 2004-09-19 20:41 Yutaka OIWA
  2004-09-20  0:38 ` skaller
  0 siblings, 1 reply; 4+ messages in thread
From: Yutaka OIWA @ 2004-09-19 20:41 UTC (permalink / raw)
  To: caml-list

Hi everyone at caml-list,

From the computer room at ICFP2004 in Snowbird Resort,
I announce a beta version of my combinator-based
regular-expression match library which supports
list (Kleene-*) binding.

This library provide a set of typed "combinators" which can be
used to construct "regular expression matcher", which tests strings
against regexps and capture the matched substring in various ways.
Especially, powerful "repeat" combinator, which corresponds
to * and + operators in conventional regular expression notation,
returns all values captured inside as a list value.

For example, the small code below

  open Regexp_pp_ng
  let s = "1 2 3 4 5" in
  match_string s (repeat ~sep:spacesA int_decimal) (fun x -> x)

returns [1; 2; 3; 4; 5]: int list.

All combinators are given static types and any mismatch of
value types and matcher types are statically rejected.

The implementation is available from a subversion repository.
Using subversion, you can checkout the URL

 https://www.oiwa.jp/svn/regexp-ocaml/branches/combinators/

to get the up-to-date implementation, or you can directly
access the above address by web browsers to see the latest revision.
There is also a ViewCVS interface at the following address.

 http://www.oiwa.jp/viewcvs/regexp-ocaml/branches/combinators/

See regexp_pp_ng.mli for interfaces, and regexp_pp_ng_test.ml for
some example of the use of this library.

It may work partially on some older OCaml, but for real use
it requires a newer version (3.07 or later) which supports
the relaxed value restriction.

I plan to construct a neat syntax sugar over this library 
and build a next-generation version of Regexp/OCaml library.
Any comments are welcome.

-- 
Yutaka Oiwa              Yonezawa Lab., Dept. of Computer Science,
      Graduate School of Information Sci. & Tech., Univ. of Tokyo.
                    <oiwa@yl.is.s.u-tokyo.ac.jp>, <yutaka@oiwa.jp>
PGP fingerprint = C9 8D 5C B8 86 ED D8 07  EA 59 34 D8 F4 65 53 61

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-20 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-19 20:41 [Caml-list] [ann] Regexp library supporting binding for * and +'s Yutaka OIWA
2004-09-20  0:38 ` skaller
2004-09-20  6:54   ` Yutaka OIWA
2004-09-20 11:12     ` skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).