Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Francois.Pottier@inria.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: [ANNOUNCE] Alpha release of Menhir, an LR(1) parser generator for ocaml
Date: Thu, 15 Dec 2005 11:41:16 -0500	[thread overview]
Message-ID: <87y82m2ujh.fsf-monnier+inbox@gnu.org> (raw)
In-Reply-To: <20051215084749.GD1966@yquem.inria.fr> (Francois Pottier's message of "Thu, 15 Dec 2005 09:47:49 +0100")

>> I wish it had something like ml-yacc's automatic handling of syntax-errors
>> (which tries to insert/delete tokens in the input stream until the parse
>> succeeds).

> Do you mean instead of or in addition to the current mechanism? (I assume
> instead of.  I don't know if the two can be made to coexist.)

I don't know enough of the details to tell you, but I'd guess it'd have to
be "instead of", indeed.

> I am not particularly happy with Menhir's current error mechanism, which
> attempts to follow yacc's.  If you could explain to us why ML-Yacc's
> approach is superior, that would be great.

ML-Yacc's error recovery if fully automatic: you write your grammar without
worrying about error handling and the generated parser automatically signals
syntax errors (note the "s" at the end: it doesn't just stop at the first
syntax error) by mentioning that it had to insert a ";" at line L1 and
remove an ID at line L2.

For toy projects it's amazing: you get good error messages with 0 effort.

The main downside of ML-Yacc IIRC has to do with the fact that it requires
a fairly strong decoupling between the lexer and parser (you can't do tricks
like change the lexer state from a parser semantic action IIRC), but it may
be just a limitation of ML-Yacc rather than of the underlying technique.

See http://www.smlnj.org/doc/ML-Yacc/mlyacc001.html#toc3


        Stefan


  reply	other threads:[~2005-12-15 16:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-12 17:58 Francois Pottier
2005-12-12 19:51 ` [Caml-list] " "Márk S. Zoltán"
2005-12-13 21:07 ` Nathaniel Gray
2005-12-14  6:08   ` skaller
2005-12-14  9:04     ` Francois Pottier
2005-12-14 10:27       ` Alessandro Baretta
2005-12-14 21:04         ` skaller
2005-12-15  8:46           ` Francois Pottier
2005-12-15 11:03             ` skaller
2005-12-14 20:51       ` skaller
2005-12-14 22:15         ` Joaquin Cuenca Abela
2005-12-15  8:40           ` Francois Pottier
2005-12-15  6:35 ` Stefan Monnier
2005-12-15  8:47   ` [Caml-list] " Francois Pottier
2005-12-15 16:41     ` Stefan Monnier [this message]
2005-12-15 16:50       ` Francois Pottier
2005-12-15 18:56         ` Stefan Monnier
2005-12-30 21:57         ` Florian Weimer

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=87y82m2ujh.fsf-monnier+inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=Francois.Pottier@inria.fr \
    --cc=caml-list@inria.fr \
    /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