For a serializer I'm writing I need to parse simple OCaml type
expressions composed by OCaml basic types, tuples, options and lists.
Given a string like "(int * string option) list" and this type:

type types =
  | Int
  | String
  | Float
  | Char
  | Bool
  | Option of types
  | List of types
  | Tuple of types list

the function I need should return something like List (Tuple ([Int;
Option(String)]))

Before starting with low level sscanf functions I looked at the Genlex
module, but it wasn't so inspiring. Then I tried with Camlp4 but the
documentation doesn't really shine :-)

So is there a simple way to write this function using some standard module?

TIA,


-- 
Paolo
~
~
:wq

_______________________________________________
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

Reply via email to