caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Joel Reymont <joelr1@gmail.com>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Error messages with dypgen
Date: Fri, 18 May 2007 18:42:23 +1000	[thread overview]
Message-ID: <1179477743.17322.10.camel@rosella.wigram> (raw)
In-Reply-To: <66D9A385-E61C-4AA2-81AA-B352FB941A57@gmail.com>

On Fri, 2007-05-18 at 08:20 +0100, Joel Reymont wrote:
> I understand that dypgen throws an exception when a syntax error is  
> found.
> 
> How do I get it to produce line/column numbers when that happens?
> 
> It would be rather groovy if the the exception carried  
> symbol_start_pos, symbol_end_pos, rhs_start_pos, rhs_end_pos from the  
> dyp record since this information is available at the time that the  
> exception is raised. 

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.

If you want this information, you can look it up yourself
in the lexbuf. The parser has no business at all examining
the lexbuf, the lexbuf belongs to the lexer.

> A simple error function built into dypgen could then take a message  
> and raise the syntax error exception with all the required info.

An error function is a good idea, except the Ocamlyacc style
interface is broken so there's no way to pass it so it
would have to be global.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-05-18  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  7:20 Joel Reymont
2007-05-18  8:42 ` skaller [this message]
2007-05-18 11:36   ` [Caml-list] " Joel Reymont
2007-05-18 13:48     ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1179477743.17322.10.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=joelr1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).