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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C2755BBAF for ; Sun, 8 Mar 2009 14:59:42 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqACAHtss0lA6ba8k2dsb2JhbACUaz8BAQEBCQkKCREDrXmBB443AQMBA4QCBoMT X-IronPort-AV: E=Sophos;i="4.38,324,1233529200"; d="scan'208";a="36248648" Received: from nf-out-0910.google.com ([64.233.182.188]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Mar 2009 14:59:25 +0100 Received: by nf-out-0910.google.com with SMTP id b11so155461nfh.13 for ; Sun, 08 Mar 2009 06:59:24 -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=Anmu0BXI7JL6Kq2KMHbgfznoe+gSzRnRnhyu9AaUOCU=; b=n1MSTv6faiS5+vSADGrtwoJNcn2EcRpk9jCNHHNvSYXDy5GlBYdtMpnS4Ae8sahxtJ h9gxt+P/GiI2luewK1K3BVPQmT4wAMUpfIyLIRUJa+FjouMy/c4bh3E03BU7ap9gKgGd YWVmhOdXrGd8LZBKwBNkEomL9cetC/xQ++Pm0= 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=AoHq4UNnen4mJ0f1eqF8yKWcx2AdizVtD3Ktycleb0ZH/bgR7WEB0PQlFTG34+blCI a7bUNCCyCrhLeKhYLE8zN7gia3KA3hrMHK1jchleshRxezfdGwxIq0MaR9UrFle3CRUe 64N0bpjCvZUnuYbNW2VygSXoBF1GBCkXviF1c= Received: by 10.210.125.13 with SMTP id x13mr2772976ebc.33.1236520764518; Sun, 08 Mar 2009 06:59:24 -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 28sm3197068eyg.35.2009.03.08.06.59.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Mar 2009 06:59:24 -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> Message-Id: From: Joel Reymont To: Matthieu Wipliez In-Reply-To: <843379.3763.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 13:59:11 +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 camlp:01 hash:01 kwd:01 mutable:01 kwd:01 ocaml:01 token:01 wrote:01 caml-list:01 grammar:02 grammar:02 On Mar 8, 2009, at 1:33 PM, Matthieu Wipliez wrote: > So to sum up: when you declare a rule with a token "MyToken", the > grammar is configured to recognize a "MyToken" keyword. The issue here is that it must be lower case in the camlp4 rules, i.e. "mytoken". What if I want to have "MyToken" (camel-case) in the rule and have it be low-cased when the grammar is extended? I think that requires extending one of the Camlp4 modules or it won't work. Also, using is not directly accessible and neither is the keywords hash table or is_kwd. You _can_ get the filter with get_filter () but the resulting structure is not mutable so you can't wrap is_kwd to low- case the string passed to it. --- http://tinyco.de Mac, C++, OCaml