From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 31241BC6B for ; Tue, 10 Jul 2007 10:29:05 +0200 (CEST) Received: from dorado.vub.ac.be (smtp.vub.ac.be [134.184.129.10]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6A8T4cG025352 for ; Tue, 10 Jul 2007 10:29:05 +0200 Received: from exchange.etro.vub.ac.be (etro10.vub.ac.be [134.184.2.10]) by dorado.vub.ac.be (Postfix) with ESMTP id 4D172593 for ; Tue, 10 Jul 2007 10:29:02 +0200 (CEST) Received: from ssel.vub.ac.be ([10.0.4.37]) by exchange.etro.vub.ac.be with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Jul 2007 10:29:02 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by ssel.vub.ac.be (Postfix) with ESMTP id 11427246822E for ; Tue, 10 Jul 2007 10:29:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at ssel.vub.ac.be Received: from ssel.vub.ac.be ([127.0.0.1]) by localhost (ssel.vub.ac.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q9RBUmRepT3H for ; Tue, 10 Jul 2007 10:28:53 +0200 (CEST) Received: from [10.0.4.145] (unknown [10.0.4.145]) by ssel.vub.ac.be (Postfix) with ESMTP id 66F4D246822D for ; Tue, 10 Jul 2007 10:28:50 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <200707080114.42213.jon@ffconsultancy.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <323324DA-AFAE-45AD-BCE4-EB188CE82729@vub.ac.be> Content-Transfer-Encoding: 7bit From: Bruno De Fraine Subject: Re: [Caml-list] try .. finally using new camlp4 Date: Tue, 10 Jul 2007 10:28:38 +0200 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 10 Jul 2007 08:29:02.0180 (UTC) FILETIME=[5EBB5240:01C7C2CC] X-Miltered: at concorde with ID 46934350.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 expr:01 expr:01 camlp:01 parsers:01 annotations:01 parsers:01 ocaml:01 syntax:01 universiteit:01 vub:98 2007,:98 vub:98 cvs:01 wrote:01 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