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.8 required=5.0 tests=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 4B770BBAF for ; Wed, 11 Mar 2009 00:37:01 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqECAA6WtklA6ba8kWdsb2JhbACUbz8BAQEBCQsKBxEDq2+BB49hAQMBA4QKBoMX X-IronPort-AV: E=Sophos;i="4.38,338,1233529200"; d="scan'208";a="25380783" Received: from nf-out-0910.google.com ([64.233.182.188]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Mar 2009 00:37:01 +0100 Received: by nf-out-0910.google.com with SMTP id b11so385135nfh.13 for ; Tue, 10 Mar 2009 16:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-transfer-encoding:from:message-id:in-reply-to:cc:date :references:content-type:to:x-mailer; bh=RIEBYDi8chPyIYJuLPgdF/Uds2ykg53ElxJtqupSvbE=; b=OevNQxSoVQZPmc/JA6tQzlbDgYq0DZbqg0TyxVMVzQ8mVstsSjPEL8v+Q1qw2HEoXm j2VpKmQsieuq1/VFDz7wc1yV+OPi3vg3iRojVKqa7iYLryhCDgYhwGxL0G29Y+QnjwqE dmqMrOD6ggoG92s5IXlEHTCSPdK/z4zhFm088= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-transfer-encoding:from:message-id :in-reply-to:cc:date:references:content-type:to:x-mailer; b=PsJuJcEAstELSci8krF6Ui7yHHHGMlqmAIcpwru7bZDo18NYXBBTG/gVTnPZM5P7Et SRESeIjOQeUU+eE4WLS/HfKvGJdyEWNMtwuukHL1/U83ofv2VuKo7+CpIPatzPo+nzBf JDWROU08G2zabkDL62tTg0lPaunMBSY1m6e4c= Received: by 10.210.60.3 with SMTP id i3mr4979301eba.90.1236728220292; Tue, 10 Mar 2009 16:37:00 -0700 (PDT) Received: from ?10.10.30.6? (8.Red-88-3-5.dynamicIP.rima-tde.net [88.3.5.8]) by mx.google.com with ESMTPS id 10sm5811342eyd.33.2009.03.10.16.36.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Mar 2009 16:36:59 -0700 (PDT) Subject: Re: [Caml-list] camlp4 grammar and LIST1 Mime-Version: 1.0 (Apple Message framework v1043) Content-Transfer-Encoding: 7bit From: Joel Reymont Message-Id: <0D14077B-F7FC-4DF0-B0FA-21445B75061B@gmail.com> In-Reply-To: Cc: "O'Caml Mailing List" Date: Tue, 10 Mar 2009 23:36:56 +0000 References: <6485A041-8698-471F-9D9C-BF3DFF0D3018@gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed To: Jake Donham X-Mailer: Apple Mail (2.1043) X-Spam: no; 0.00; camlp:01 recursive:01 branching:01 expr:01 10,:98 token:01 wrote:01 caml-list:01 grammar:02 opt:04 descent:08 approach:08 fun:08 fun:08 rule:10 On Mar 10, 2009, at 11:01 PM, Jake Donham wrote: > An approach > that works for me is to think "recursive descent" and always give > rules that check at least one token before branching to another rule. Something like this then? sellMethod: [ [ "Next"; "Bar"; at = OPT "At$"; e = expr; f = [ [ "Stop" | "Lower" ] -> fun x -> Stop x | [ "Limit" | "Higher" ] -> fun x -> Limit x ] -> (f e, at) ] ]; --- http://tinyco.de --- Mac & iPhone