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 B30FEBB83 for ; Sun, 17 Sep 2006 09:41:23 +0200 (CEST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8H7fKEY025580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 17 Sep 2006 09:41:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id E88E25435A for ; Sun, 17 Sep 2006 17:41:11 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23243-07 for ; Sun, 17 Sep 2006 17:41:11 +1000 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id D0415542C9 for ; Sun, 17 Sep 2006 17:41:11 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id 42949A0AFC7; Sun, 17 Sep 2006 17:41:20 +1000 (EST) Date: Sun, 17 Sep 2006 17:41:20 +1000 From: Pietro Abate To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] combining camlp4 extensions Message-ID: <20060917074120.GA27422@pulp.rsise.anu.edu.au> References: <20060917072242.GA26895@pulp.rsise.anu.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060917072242.GA26895@pulp.rsise.anu.edu.au> X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at concorde with ID 450CFC20.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; camlp:01 pcaml:01 grammar:01 expr:01 pcaml:01 grammar:01 expr:01 blog:98 blog:98 caml-list:01 let:03 let:03 problem:05 anyway:05 entity:06 There's something magic about this list... as soon as I post something I come up with a solution... must be the ocaml-guru karma reaching my office... anyway... This example now works as expected... Is this the best way of solving this problem ? ------------ ext_repeat.ml open Pcaml open Repeat (* <--------- I need to refer to the grammar entity declared in the common part to be able to extend it !!!!!! *) let extend () = EXTEND GLOBAL: reexpr; reexpr: [[ e = expr -> e ]]; END ;; ----------- -----------repeat.ml open Pcaml let reexpr = Grammar.Entry.create Pcaml.gram "reexpr";; let extend () = EXTEND GLOBAL: reexpr expr ; expr: LEVEL "expr1" [[ "repeat"; e1 = reexpr; "until"; e2 = expr -> <:expr< do { $e1$; while not $e2$ do { $e1$; } } >> ]]; reexpr: [[]]; END ;; -------------- -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html