3

I want to combine BOLT, SEXP and ocamlViz for a large project. The problem is, that SEXP and BOLT are using CamlP4 and ocamlviz is using camlp5. But how could I combine the calls to one chain for the -pp argument of ocamlc/ocamlopt?

Here is my call for actual project without ocamlviz: ocamlopt.opt -c -I +dynlink -I +bolt -I +threads -I +lablgtk2 -I +extlib -I +pcre -I +netsys -I +netstring -I +json-wheel -I +num -I +nums -I +sexplib -I +zip -I +xml-light -I +xmlrpc-light -I +equeue -I +netclient -g -annot -p -thread -pp 'camlp4o /usr/lib/ocaml/bolt/bolt_pp.cmo -logger '\''foo.native'\'' -level DEBUG -- -I /usr/lib/ocaml/sexplib -I /usr/lib/ocaml/type-conv pa_type_conv.cmo pa_sexp_conv.cmo' -o foo.cmx foo.ml

Andreas Romeyke
  • 333
  • 2
  • 8

2 Answers2

1

It is impossible to preprocess source file by two different preprocessors simultaneously for obvious reasons, and using one after another is also impossible because the first one will not recognize the syntax intended for the second one. The solution is either to use different syntaxes in different source files or port ocamlviz to camlp4.

ygrek
  • 6,656
  • 22
  • 29
0

If you pass -printer OCaml to Camlp4, it will output the pre-processed O'Caml file in source format. You can then parse this file again with Camlp5 in another step.

Teraokay
  • 120
  • 6
  • this will not work because camlp4 will not recognize syntax intended to be recognized by ocamlviz/camlp5 – ygrek Mar 29 '11 at 09:15