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 E7991BBAF for ; Sun, 8 Mar 2009 15:30:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgCAM5ys0lA6ba4kGdsb2JhbACUaj8BAQEBCQkMBxEDrgWBB44uAQMBA4QCBoMT X-IronPort-AV: E=Sophos;i="4.38,324,1233529200"; d="scan'208";a="25241376" Received: from nf-out-0910.google.com ([64.233.182.184]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Mar 2009 15:30:35 +0100 Received: by nf-out-0910.google.com with SMTP id b11so156885nfh.13 for ; Sun, 08 Mar 2009 07:30:35 -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=Yq5qtNflrZ4WURB94EXbDhia5U9TqdOhjZqkHvAoZrk=; b=DV11AH9iaGnkTNUAR05DkPvf37GMkdU7NpidyaA2qiblBlr5R875VBuG8Ux529eCAp wDEGRh5ftFW8IcFnPTrUiWYow+mGgwz8rzPJjObObAUg4vxVBNzo0xjN1/Pop8XvEo5L kwv6HjVnbKJZk2XQMcr/bJyERoQrJyjAbT9vg= 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=DA/9hAcfiKyr6bF0qeTClzgpclrfEwnDVwiYhVUim5Z/lQzdXkcKkRE8stdVRN08Yq TE9ozH6DHInR0vJogmn3rU6jDkfXHr6i0E1QaqnulGJDm2hctJiKXONQdw8W8ohvxAh8 LZmRVTfLeJ8hJIn98G9fhHDfiP68asBoocMws= Received: by 10.210.76.4 with SMTP id y4mr2807951eba.17.1236522635227; Sun, 08 Mar 2009 07:30:35 -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 10sm3118255eyd.13.2009.03.08.07.30.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Mar 2009 07:30:34 -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> Message-Id: <2368FDC0-FD1F-49B8-BDE0-53C2D641070B@gmail.com> From: Joel Reymont To: Matthieu Wipliez In-Reply-To: <801023.45786.qm@web27008.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: Re: Re : [Caml-list] Re: camlp4 stream parser syntax Date: Sun, 8 Mar 2009 14:30:31 +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 lexing:01 lowercase:01 hash:01 lowercase:01 parser:01 lexer:01 camlp:01 struct:01 ocaml:01 wrote:01 caml-list:01 On Mar 8, 2009, at 2:09 PM, Matthieu Wipliez wrote: > using a single rule, say > buy : [ [ "buyOrSell"; ... ] ] Yes, I want camel-case above. > and at lexing time do > if String.lowercase s = "buyorsell" then > IDENT "buy_or_sell" > else > IDENT s And this is the part that I object to. I have quite a number of keywords and I don't want to have a bunch of if statements or have a hash table mapping lowercase to camel case. This would mean having to track the parser (camel case) version in two places: the lexer and the parser. What I want is to extend Camlp4.Struct.Grammar.Static with a custom version of Make that applies String.lowercase before giving the string to 'using' to be inserted into the keywords table. Thanks, Joel --- http://tinyco.de Mac, C++, OCaml