English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Error messages with dypgen
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-18 (11:36)
From: Joel Reymont <joelr1@g...>
Subject: Re: [Caml-list] Error messages with dypgen

There should at least be a textual message embedded in the exception.

This is what I have right now:

   | INPUT COLON input_decs { `InputDecls (List.rev $3) }
   | INPUT COLON input_decs error {
       parser_error "Missing semicolon" $startpos($4) $endpos($4)
   | INPUT COLON error {
       parser_error "Error after INPUT:" $startpos($3) $endpos($3)
   | INPUT error {
       parser_error "Missing ':' after INPUT" $startpos($2) $endpos($2)

I clearly know why the error is happening here. Positions  
notwithstanding, wow do I rewrite this for dypgen?

	Thanks, Joel

On May 18, 2007, at 9:42 AM, skaller wrote:

> No it isn't. Dypgen uses lexbufs for compatibility with the
> broken Ocamlyacc interface. Dypgen lets you use ulex or
> other lexer as well. The type of the error thrown by the
> automaton should not be polluted by positional information
> that has no reasonable standard specification.