This is a bare-bones README file for ocamlmerr.  It assumes you have
an ocamllex/ocamlyacc grammar working, and you know how to do some things,
such as edit a Makefile and insert code in your driver program (called 
here 'main.ml').
  The 'meta.err' file included here isn't complete; it's just meant to 
give you some idea of the file's syntax and the sorts of things you can 
put in it.

-Arthur O'Dwyer
October 2004



In Makefile, you need:

.mly.ml:
        $(CAMLYACC) $<
        sed s/Parsing/Merr_parsing/ $@ >temp.temp.temp
        mv temp.temp.temp $@

merrgen: merrgen.c
        gcc -O3 -o merrgen merrgen.c

merr.ml: merrgen meta.err
        ./merrgen -w ./compile



In main.ml, you need:

      let absyntree =
        (try
          Grammar.program Lexer.token lexbuf
        with
        | Merr_parsing.Parse_error(state, tok) ->
            Errormsg.error (Lexing.lexeme_start lexbuf,
                            Lexing.lexeme_end lexbuf)
                           (Merr.get_error(state, tok));
            close_files(); exit(-1)
        ) in