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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 737F5BBCA for ; Fri, 4 Apr 2008 23:30:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwBAEo69keDrhCRiGdsb2JhbACRTwEBAQ8mmgk X-IronPort-AV: E=Sophos;i="4.25,606,1199660400"; d="scan'208";a="10451915" Received: from smeltpunt.science.ru.nl ([131.174.16.145]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Apr 2008 23:30:59 +0200 Received: from tandem.cs.ru.nl (tandem.cs.ru.nl [131.174.142.18]) by smeltpunt.science.ru.nl (8.13.7/5.24) with ESMTP id m34LUwO7012055 for ; Fri, 4 Apr 2008 23:30:58 +0200 (MEST) Received: from tews by tandem.cs.ru.nl with local (Exim 4.63) (envelope-from ) id 1JhtUw-0000Ng-7h for caml-list@yquem.inria.fr; Fri, 04 Apr 2008 23:30:58 +0200 From: Hendrik Tews To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Camlp4: example/parse_files.ml References: <18420.4901.506029.744640@tandem.cs.ru.nl> <1207236568-sup-3680@port-ext16.ensta.fr> <1207316266-sup-9155@ausone.inria.fr> <1207318438-sup-662@ausone.inria.fr> Date: Fri, 04 Apr 2008 23:30:58 +0200 In-Reply-To: <1207318438-sup-662@ausone.inria.fr> (Nicolas Pouillard's message of "Fri, 04 Apr 2008 16:19:16 +0200") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.63 on 131.174.16.145 X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 camlp:01 doable:01 functors:01 camlp:01 cmo:01 cmo:01 syntax:01 syntax:01 callbacks:01 hendrik:01 parsed:01 caml-list:01 "Nicolas Pouillard" writes: I think that's doable (not tested), basically you need three primitive functors: I don't see how. Let me clarify again what I mean. And let me clarify that I only pursue this discussion out of curiosity, to see, what can be done with the functorial Camlp4 interface. Assume we have a table like this: s1.cmo s2.cmo ... : f1.ml f2.ml ... s3.cmo s4.cmo ... : f3.ml f4.ml ... The sx.cmo files are Camlp4 syntax extentions and the fx.ml are files to be parsed using those syntax extentions. There are a number of possible solutions: - starting camlp4 for each file or each row - clearing PreCast.Syntax before each row and then calling the callbacks that the syntax extensions registered But I would like to know if the functorial Camlp4 design is strong enough to solve this exercise within one program (without fork/exec) and without reusing/clearing one syntax module. It is clear that the registration in Register.SyntaxExtension is not good enough, because it always applies the syntax extension to PreCast.Syntax. However, even with changing Register.SyntaxExtension or how syntax extensions register themselves, I can't see a solution. Bye, Hendrik