ocamlyacc and error messages

From: David Mentr'e (David.Mentre@irisa.fr)
Date: Mon Sep 06 1999 - 14:02:11 MET DST


To: caml-list@inria.fr
Subject: ocamlyacc and error messages
From: "David Mentr'e" <David.Mentre@irisa.fr>
Date: 06 Sep 1999 14:02:11 +0200

Hello/Bonjour,

[[ 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)
    http://caml.inria.fr/pub/old_caml_site/caml-list/0061.html
 . ocaml parser in too complicated (rich error handling)
 . ocamlyacc doc is minimal

Thanks for any pointer,
david

d.

-- 
 David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/
 Opinions expressed here are only mine.



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:25 MET