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.0 required=5.0 tests=AWL,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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id EC90BBC69 for ; Tue, 1 May 2007 21:16:46 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l41JGkZr015037 for ; Tue, 1 May 2007 21:16:46 +0200 Received: by ug-out-1314.google.com with SMTP id k3so88388ugf for ; Tue, 01 May 2007 12:16:46 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=fTMZvqhc4vdLCvYQBwF2P4cbXhyXXKMSKi9uRLmfNsZUb6FLIuliEZeXEmGwznQyRTQKiBeTo5mwfFRcw6xDt++0dVdr9xFPr0hj/eENvThbAag63ARKdWyMl4VAiS5N0APX5nQlBkmiaFz6uNtUhjRElCk2AlYvRqSs5qDZtvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=T1E+PdD2uwVUAqx5qy6R3uAIypwPwShnhXSVgY5Tq7irONXZ7Cov4/RDjOgts6nNHwgbtvvo2+oQuZUPAfYNOcAAxKjCiLh8DQECD3Pz8yxNPimw4odMDLkK/KItpqh15QjaC5KYX0RXSyRuXJmd7oE/qN4fl0ozsFbinYZGjcs= Received: by 10.82.185.12 with SMTP id i12mr14574710buf.1178047005728; Tue, 01 May 2007 12:16:45 -0700 (PDT) Received: from ?192.168.1.34? ( [83.52.237.136]) by mx.google.com with ESMTP id z40sm5432903ikz.2007.05.01.12.16.40; Tue, 01 May 2007 12:16:44 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: <8E37041B-229B-4C5C-9964-C468C347E426@gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: Caml List From: Joel Reymont Subject: Menhir and ocamlyacc: Ambiguous grammar Date: Tue, 1 May 2007 20:16:33 +0100 X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 4637921E.001 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 4637921E.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocamlyacc:01 expr:01 expr:01 ocamlyacc:01 $2,:98 $2,:98 grammar:01 parse:02 parse:02 ambiguous:02 problem:05 shares:88 shares:88 case:13 some:14 name_shares: | LP expr RP expr SHARES { (Some $2, `Qty $4) } | LP expr RP { (Some $2, `All) } | expr SHARES { (None, `Qty $1) } | { (None, `All) } This is intended to parse a "name" that is followed by the # of shares. The problem is that expr itself can be LP expr LP in which case the only differentiator is the SHARES that follows. Is there any way to parse this using ocamlyacc or Menhir? Thanks, Joel -- http://wagerlabs.com/