[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Joel Reymont <joelr1@g...> |
| Subject: | Error location reporting in Menhir |
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/