caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Bruno De Fraine <Bruno.De.Fraine@vub.ac.be>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] try .. finally using new camlp4
Date: Tue, 10 Jul 2007 10:28:38 +0200	[thread overview]
Message-ID: <323324DA-AFAE-45AD-BCE4-EB188CE82729@vub.ac.be> (raw)
In-Reply-To: <cd67f63a0707090606y4edc4bbbl9fa8bd9a8a85f97d@mail.gmail.com>

On 09 Jul 2007, at 15:06, Nicolas Pouillard wrote:
> Let's go

Of course, if you wrote the thing, it's easy... :-)

>>   EXTEND Gram
>>     expr: LEVEL "top"
>>     [[ "try"; f=expr; "finally"; g=expr ->
> Here one extend a rule. So in order to have something working properly
> one *must* look at the original rule.
>
> There is the up-to-date rule:
>
> $ cvs ann -r release310
> camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml | grep '"try"'
> Annotations for camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
> ***************
> 1.2.2.11     (pouillar 04-Apr-07):         | "try"; e = sequence;
> "with"; a = match_case ->
>
> So the correct rule is:
>     [[ "try"; f=sequence; "finally"; g=expr ->

Just a remark, you don't need the source code to check the existing  
definition.

$ ocaml camlp4orf.cma
# open Camlp4.PreCast ;;
# Gram.Entry.print Format.std_formatter Syntax.expr ;;

Will show:

expr: [
...
| "top" RIGHTA [
...
   | "try"; sequence; "with"; match_case

Regards,
Bruno

--
Bruno De Fraine
Vrije Universiteit Brussel
Faculty of Applied Sciences, DINF - SSEL
Room 4K208, Pleinlaan 2, B-1050 Brussels
tel: +32 (0)2 629 29 75
fax: +32 (0)2 629 28 70
e-mail: Bruno.De.Fraine@vub.ac.be



  reply	other threads:[~2007-07-10  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  0:14 Jon Harrop
2007-07-08  3:28 ` [Caml-list] " Julien Moutinho
2007-07-09  9:01 ` Vincent Hanquez
2007-07-09  9:43   ` Jeremy Yallop
2007-07-09  9:33     ` Vincent Hanquez
2007-07-09 13:06 ` Nicolas Pouillard
2007-07-10  8:28   ` Bruno De Fraine [this message]
2007-07-10 12:44     ` Nicolas Pouillard

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=323324DA-AFAE-45AD-BCE4-EB188CE82729@vub.ac.be \
    --to=bruno.de.fraine@vub.ac.be \
    --cc=caml-list@yquem.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;
as well as URLs for NNTP newsgroup(s).