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=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST 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 C4CFBBBAF for ; Sun, 8 Mar 2009 15:09:26 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQCAFpus0nZkrEIkWdsb2JhbACUCIEgAQEBAQkLCgcRA64KgQeOMgEEhAU X-IronPort-AV: E=Sophos;i="4.38,324,1233529200"; d="scan'208";a="25240983" Received: from web27008.mail.ukl.yahoo.com ([217.146.177.8]) by mail1-smtp-roc.national.inria.fr with SMTP; 08 Mar 2009 15:09:26 +0100 Received: (qmail 47694 invoked by uid 60001); 8 Mar 2009 14:09:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1236521365; bh=lDXN4ZsDTGOrL+9xA0qs1fWebbLtRc9xXuqDMgnKDdA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=cuYxuyNxiu0ZdT6LtWNEtOTEkLMtOTgVwzlpMOYFfegOaomOJ21xnFobnjbqDbkzY2n4g0foIaAYK3U9e02pqj2OWaVepuyNVeme1XASRxtfys+wE6PxaYJGQSDXYKG3B9AncDDc61hjvk8JlW4uyuN8pdK+1hm7n66BFXxB77M= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZCOzTAYRKS5Tnnmk9KE+XHol8joWQo/CTAEKyCUF7Ryy+AwJwSA+xOz7sJ+Z3r81abp4GEw+TSMjpElVToIalCWe3wkzqdkO5dnmnuSmyQE+u5tUvx0aH+oQ/uG/cem8ybJjwiQYSWxGLjZhYkg+EWf36O+k2ODF96KQ6InvD4U=; Message-ID: <801023.45786.qm@web27008.mail.ukl.yahoo.com> X-YMail-OSG: LbIGcMYVM1k6Az.cMep_F991q_4veEqE1z.a9yHz4bWfq4hnvYLeiCacptzynoldGZhtYSfBgiXxLhIEvAPCi5XAuj3is2Yy1j_H4yMny8CYTKBBwLhW6I3Ns2FVmv3mQ9Ald3n.oWWD4ShfkJ8WC8f1e_r0LjyynI242BhLKSqS5XRruKl.5nw7uPU7MQ-- Received: from [82.242.132.106] by web27008.mail.ukl.yahoo.com via HTTP; Sun, 08 Mar 2009 14:09:25 GMT X-Mailer: YahooMailRC/1155.45 YahooMailWebService/0.7.289.1 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> Date: Sun, 8 Mar 2009 14:09:25 +0000 (GMT) From: Matthieu Wipliez Subject: Re : [Caml-list] Re: camlp4 stream parser syntax To: O'Caml Mailing List MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; matthieu:01 camlp:01 parser:01 syntax:01 camlp:01 lexing:01 lowercase:01 lexer:01 cheers:01 matthieu:01 token:01 parsing:01 caml-list:01 ident:01 ident:01 > > So to sum up: when you declare a rule with a token "MyToken", the gramm= ar is =0A> configured to recognize a "MyToken" keyword.=0A> =0A> The issue = here is that it must be lower case in the camlp4 rules, i.e. =0A> "mytoken"= .=0A=0AWhy "it must"? You need it to be lower-case? Or parsing does not wor= k if it is not lower-case?=0A=0AMaybe I did not understand correctly what y= ou want...=0AI thought you wanted to recognize=0A BuyOrSell something=0A = buyORsell something=0A=0Ausing a single rule, say=0A buy : [ [ "buyOrSell"= ; ... ] ]=0A=0AIf that is the case, I think my solution works.=0AYou might = even do that:=0A buy : [ [ "buy_or_sell"; ... ] ]=0A=0Aand at lexing time = do=0A if String.lowercase s =3D "buyorsell" then=0A IDENT "buy_or_sell"= =0A else=0A IDENT s=0A=0AIn this case it is more than a matter of case,= but the argument is still valid: I have declared a rule with "buy_or_sell"= , so the rule will be taken when a "buy_or_sell" keyword is found, and the = lexer produces "buy_or_sell" identifiers from anything that matches case-in= sensitively "BuyOrSell".=0A=0ACheers,=0AMatthieu=0A=0A=0A=0A