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=2.7 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL 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 78004BBAF for ; Sun, 8 Mar 2009 16:46:58 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgADAJ+Es0nRVduukWdsb2JhbACUaz8BAQEBCQkMBw+tbIEHjiABAwEDhAIGgxM X-IronPort-AV: E=Sophos;i="4.38,325,1233529200"; d="scan'208";a="25243393" Received: from mail-ew0-f174.google.com ([209.85.219.174]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Mar 2009 16:46:58 +0100 Received: by ewy22 with SMTP id 22so790492ewy.27 for ; Sun, 08 Mar 2009 08:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:cc:x-mailer; bh=+4IdulijEkwvYWp34XfVh5tL7ECWfsdgAyEODlWn90I=; b=YzBU6XfeOCpMw8DxSgGdA6Ui9K+2ore6SYMbXfDFI1t2M4ghfxIDML0Zw4BYibA45g g9plZhIq57qzhkGru2TGwedQQXtuP4GO2ly09p9l2uQTkIUyX6YQcNlDlTDJxJeT1vSo GeebGiRr8EkiLoA80JdaZKUePOPj4oIGTB1No= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:cc:x-mailer; b=km/GLoR2xgo/yM5fy10CjYckTwxbY10b2MOf8FSe/0WiAur507bcClZnuGwLHtpmWJ fOEEKs5VeKqxi5ZP1UqL1VXu0x2iqQUFCx4l7xatv9i2Z2SKe/rQVXlfDQ4xWYFhe8di tmSfGez4bWO9aXQEliZOiebpKYrU1/o0JvUkY= Received: by 10.210.18.18 with SMTP id 18mr2843567ebr.53.1236527218159; Sun, 08 Mar 2009 08:46:58 -0700 (PDT) Received: from ?10.10.30.5? (94.Red-88-6-143.staticIP.rima-tde.net [88.6.143.94]) by mx.google.com with ESMTPS id d24sm5712116nfh.43.2009.03.08.08.46.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Mar 2009 08:46:57 -0700 (PDT) References: <24D11586-4F15-4B6E-8FB7-58651317164D@gmail.com> <46331.52510.qm@web27007.mail.ukl.yahoo.com> <0B508092-FD71-4733-BC95-B6B87A6D3E6B@gmail.com> <154139.25342.qm@web27007.mail.ukl.yahoo.com> <46FCBABD-7E4A-4077-8227-3816FD6D635D@gmail.com> <279881.54090.qm@web27008.mail.ukl.yahoo.com> <58D957FE-F549-4B2F-9794-6A6651A20A29@gmail.com> <843379.3763.qm@web27007.mail.ukl.yahoo.com> <801023.45786.qm@web27008.mail.ukl.yahoo.com> <2368FDC0-FD1F-49B8-BDE0-53C2D641070B@gmail.com> <149632.77706.qm@web27001.mail.ukl.yahoo.com> <2F6DE824-09BE-4CB2-8AEA-3CAC58203A43@gmail.com> <537901.83501.qm@web27007.mail.ukl.yahoo.com> Message-Id: <1089D291-76A7-408C-BCA4-91F6B47843C4@gmail.com> From: Joel Reymont To: Matthieu Wipliez In-Reply-To: <537901.83501.qm@web27007.mail.ukl.yahoo.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: [Caml-list] Re: camlp4 stream parser syntax Date: Sun, 8 Mar 2009 15:46:54 +0000 Cc: O'Caml Mailing List X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; camlp:01 parser:01 syntax:01 matthieu:01 elegantly:01 inserting:01 hash:01 functors:01 camlp:01 lexer:01 sig:01 lexer:01 sig:01 struct:01 ocaml:01 On Mar 8, 2009, at 3:32 PM, Matthieu Wipliez wrote: > I'd say duplicate Static, and redefine "using". Seems like the > simplest solution to me, certainly not the cleanest though (but is > there an alternative?). I don't think this will work elegantly. Static first makes a Structure (is make the right term?) and then makes a bunch of other modules using it. A custom Structure will be needed to downcase the keywords before inserting them into the hash table, so Static will need to be duplicated as well. I'm learning modules, functors, etc. Perhaps someone more experienced in this and camlp4 can weight in. Thanks, Joel -- Static.ml --- module Make (Lexer : Sig.Lexer) : Sig.Grammar.Static with module Loc = Lexer.Loc and module Token = Lexer.Token = struct module Structure = Structure.Make Lexer; module Delete = Delete.Make Structure; module Insert = Insert.Make Structure; module Fold = Fold.Make Structure; include Structure; --- http://tinyco.de Mac, C++, OCaml