Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Unicode solutions

13 views
Skip to first unread message

Jacques Carette

unread,
Apr 12, 2010, 10:36:22 AM4/12/10
to caml...@inria.fr
I need to be able to lex/parse and pretty-print unicode with caml.

I am aware of several 'solutions' for each part, but I would choose to
use whatever library seamlessly allows me to both parse and build
pretty-printers for unicode-based input.

For example, it is unclear to me that module Print in Batteries
integrates well with UTF8.t - but that could just be a documentation
issue. Camomile seems to be good for the representation part, but does
not seem to offer lex/parse and pretty-print modules.

It seems like ulex + dypgen works for the front-end part. Back-end?
[It's not clear to me that ulex + menhir works]

Jacques

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Dario Teixeira

unread,
Apr 12, 2010, 11:44:53 AM4/12/10
to caml...@inria.fr, Jacques Carette
Hi,

> It seems like ulex + dypgen works for the front-end
> part.  Back-end?
> [It's not clear to me that ulex + menhir works]

I can confirm that at least with a recent Menhir, you can use whichever lexer
you want, even Ulex. In fact, I have used the Ulex+Menhir combination in a
couple of my own projects, and their source-code is available if you want
to check out how it's done:

https://forge.ocamlcore.org/scm/viewvc.php/trunk/ccss/src/ccss.ml?root=ccss
https://forge.ocamlcore.org/scm/viewvc.php/trunk/lambdoc/src/lib/lambdoc_read_lambtex/main.ml?root=lambdoc

Hope that helps,
Dario Teixeira

Francois Pottier

unread,
Apr 12, 2010, 1:30:28 PM4/12/10
to Jacques Carette, caml...@inria.fr

On Mon, Apr 12, 2010 at 10:35:24AM -0400, Jacques Carette wrote:
> [It's not clear to me that ulex + menhir works]

Yes, it does. This is documented in the FAQ near the end of the Menhir
reference manual.

In short, although Menhir (like ocamlyacc) produces code whose interface
suggests that it is meant to be used with an ocamllex-generated lexer, this
interface can be easily adapted. Wrappers for this purpose are provided as
part of MenhirLib.

--
François Pottier
Francois...@inria.fr
http://gallium.inria.fr/~fpottier/

0 new messages