Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamlyacc and error messages
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-09-06 (16:20)
From: David Mentr'e <David.Mentre@i...>
Subject: ocamlyacc and error messages

[[ Français (résumé) ]]

Comment donner le numéro de ligne et le point d'échec dans une grammaire
d'un parser généré par ocamlyacc ?

[[ English ]]

What is the simplest way to report an error in a parser generated by
ocamlyacc ?

I would like to report :

 1. line number in parsed file

 2. failing rule number in grammar 

The point (1) is essential for me. Right know, I have a 'Fatal error:
uncaught exception Parsing.Parse_error' not very meaningful. :) I would
prefer have a message like 'parse error on line N in source file,
stucked in grammar rule foo:'.

I've looked at FAQs, mailing-list archive, ocaml sources and ocamlyacc
documentation but did not found very useful info :

 . nothing in faqs
 . mailing-list : an old message related to caml (not *o*caml)
 . ocaml parser in too complicated (rich error handling)
 . ocamlyacc doc is minimal

Thanks for any pointer,

-- --
 Opinions expressed here are only mine.