Module Fmlib_parse.Error_reporter

Convenience module to generate readable error messages.

An error reporter is a parser which reparses the input stream, extracts the failed code snippet and prints the error nicely formatted.

For semantic errors, the module needs support from the user to convert a semantic error into a pretty print document.

The error reporter generates a pretty print document (details about pretty print documents see Fmlib_pretty.Print) of the form

       code snippet containing the error with markers at the error

       description of the error

The description of the error is in case of a syntax error a description of what might have been expected at the error position and in case of a semantic error whatever the user provides as an error description.

The generated error report has one of the following forms:

module type FAILED_PARSER = sig ... end

Needed functions from a failed parser i.e. a parser which has failed either with a syntax error or a semantic error.

module Make (Parser : FAILED_PARSER) : sig ... end

Generate the error reporter from a failed parser.