I would like to parse some file format and generate code at compile time. One way would be to just stitch formatted string of ocaml syntax. I was wondering if i could make use of ppx for this. Say.
let _ = () [%parse_n_gen “foo.xml”];;
Which should generate several modules baz, bar and so on by parsing that file at compile time. I am not sure if there is any facility for quasiquotation. Also how would i generate new structs and sigs from this? So far, i have seen ppx rewrite the same module by adding some more expressions.
Any pointers on this would be appreciated.