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.5 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 1AB95BBC4 for ; Sun, 8 Mar 2009 02:08:07 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkMCAHupsknZkrEHmWdsb2JhbACUAoEgAQEBAQEICwoHEa1HgQePAQEEhAU X-IronPort-AV: E=Sophos;i="4.38,321,1233529200"; d="scan'208";a="25226543" Received: from web27007.mail.ukl.yahoo.com ([217.146.177.7]) by mail1-smtp-roc.national.inria.fr with SMTP; 08 Mar 2009 02:08:06 +0100 Received: (qmail 25984 invoked by uid 60001); 8 Mar 2009 01:08:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1236474486; bh=AG70GPE8EUkI4ux7CjmzFV3ynRjbWkLDsJosOPq1IEE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=yLG1QsJpKhG0W0Ah+0y83OaaKwcWoj98GxUztvkkouEQOqfANIXPWd0JLOzZfEiGchd1PqO3dMnchgLz83ycqFivchnhjsvlRFF5MH1PGU1+ei5CFQf0SqL0ATzoCHSXULx8CUdQbov3RC9zLUz4aPDbx2pyyzRpEIaiLLlr2CY= 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:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=l61yt2fcmRNXP3nYJh1rR4/zNd55vKT8bHIzRlV0xN+0IvR2P4YkUJjfnxt5FrT+l2RSL4hYUAHPUaTTcWmZwYPg3fbnYPxqkY132Ed/3sehvVOkinp2LxHifk+CeBnGQGesIhz2d6jspKvys0/CDL9o/VpKoRHguMSIamV1cVQ=; Message-ID: <154139.25342.qm@web27007.mail.ukl.yahoo.com> X-YMail-OSG: YrgjSHAVM1kG5TEspvJdwiFMhpJItY4t48tBL2AkuPGvLhFoHWXexAmfLO0gIkxTnFuLseffGOtJ0RtazrMpGdFh8n7kX_R9ARmw0yeswZuuyNO9gFZgjGhJ1QpYmUbD67Hmf8wr4X9Wn_pEXliRPAcqibnnj05kQOUEF06Xsn6ql0t0Xqpx.lrRHjGSKTn._d4kU14_u2LyMHr.2OfXHiv4xkU6.3e9qma_pQfF Received: from [82.242.132.106] by web27007.mail.ukl.yahoo.com via HTTP; Sun, 08 Mar 2009 01:08:05 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> Date: Sun, 8 Mar 2009 01:08:05 +0000 (GMT) From: Matthieu Wipliez Subject: Re : Re : [Caml-list] Re: camlp4 stream parser syntax To: Joel Reymont Cc: 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 matthieu:01 camlp:01 parser:01 failwith:01 lexer:01 lexer:01 parsers:01 non-trivial:01 parsers:01 cheers:01 char:01 > Matthieu,=0A> =0A> Is the camlp4 grammar parser case-insensitive?=0A> =0A= > Will both Delay and delay be accepted in the actionDelay rule?=0A> =0A> = actionDelay: [ [ "delay"; expression ->=0A> Asthelper.failwith (= convert_loc _loc)=0A> "RVC-CAL does not permit the use of delay= ." ] ];=0A=0ANo, only "delay" is accepted.=0A=0A> Also, I noticed that your= lexer has a really small token set, i.e.=0A> =0A> type token =3D=0A> |= KEYWORD of string=0A> | SYMBOL of string=0A> | IDENT of string= =0A> | INT of int * string=0A> | FLOAT of float * string=0A> = | CHAR of char * string=0A> | STRING of string * string=0A> = | EOI=0A> =0A> My custom lexer, on the other hand, has a HUGE token set, e= .g.=0A> =0A> type token =3D=0A> | BUY_TO_COVER=0A> | SELL_SHORT= =0A> | AT_ENTRY=0A> | RANGE=0A> | YELLOW=0A> | WHITE=0A> = | WHILE=0A> | UNTIL=0A> ...=0A> =0A> This is partly because I hav= e a very large set of keywords.=0A> =0A> Do I correctly understand that I d= o not need all the keywords since I can match =0A> them in the camlp4 gramm= ar as strings like "BuyToCover", "SellShort", etc.?=0A=0AYes that's right.= =0A=0AAlso a good source of information, being given the status of Camlp4= =0Adocumentation, is Camlp4 source code, especially camlp4/Camlp4Parsers/Ca= mlp4OCamlRevisedParser.ml and=0ACamlp4OCamlParser.ml=0A=0A> I had no idea C= amlp4 had been used to write such non-trivial parsers...=0A=0AActually the = aforementioned files show the power of Camlp4 parsing and grammar extension= capabilities quite well IMHO.=0A=0ACheers,=0AMatthieu=0A=0A=0A