Adding a custom parser in the old camlp4 (now camlp5) was relatively easy. The new camlp4 is quite different. The problem was discussed in two recent threads in the ocaml mailing list here and here.
The main point is to provide a new Lexer module with a compatible signature with the Camlp4 lexer.