caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Error location reporting in Menhir
@ 2007-03-30 14:02 Joel Reymont
  2007-03-30 19:36 ` Francois Pottier
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Reymont @ 2007-03-30 14:02 UTC (permalink / raw)
  To: Caml List; +Cc: Francois.Pottier

I currently retrieve location like this during parser errors:

   let rhs_loc n = (Parsing.rhs_start_pos n, Parsing.rhs_end_pos n)

I then report it like this:

   let syntax_error s num =
     parser_error s (rhs_loc num)

In my grammar I report errors like this:

   | INPUT COLON input_decs error { syntax_error "Missing semicolon" 4 }

I don't do anything special in the lexer to adjust lexeme positions.

How do I rewrite my error reporting for Menhir?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-30 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-30 14:02 Error location reporting in Menhir Joel Reymont
2007-03-30 19:36 ` Francois Pottier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).