I'm pretty sure that the output format of `ocamlc` can easily be parsed with regular expressions, and I don't see any need for this custom parser.

If I'm not totally mistaken, `(error line-start "File: " (file-name (one-or-more (not (any "\"")))) ", line " line ", characters " column "-" (one-or-more digit) ":\nError: " (message) line-end)` would do the job for errors.  The warning pattern just needs to be adapted accordingly.