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=0.0 required=5.0 tests=AWL 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 EB800BC6B for ; Wed, 31 Oct 2007 14:51:05 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKokKEeAKs4Fnmdsb2JhbACOZAIBAQcEBhEY X-IronPort-AV: E=Sophos;i="4.21,351,1188770400"; d="scan'208";a="3879643" Received: from netscaler2.rice.edu (HELO mh1.mail.rice.edu) ([128.42.206.5]) by mail1-smtp-roc.national.inria.fr with ESMTP; 31 Oct 2007 14:51:05 +0100 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id DEF21385F17; Wed, 31 Oct 2007 08:51:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.4 at mh1.mail.rice.edu Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mfeOhTO1xVig; Wed, 31 Oct 2007 08:51:03 -0500 (CDT) Received: from [10.194.94.87] (unknown [10.194.94.87]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mh1.mail.rice.edu (Postfix) with ESMTP id B3F43385F07; Wed, 31 Oct 2007 08:51:03 -0500 (CDT) In-Reply-To: References: <6C4DFFEF-0A5E-496F-9468-56693FFA4DC2@cs.rice.edu> <1193753915.47273d3bb15f2@webmail.in-berlin.de> <23EC0ABA-12EE-49DE-B76A-1D91BCCAE1BA@cs.rice.edu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <21DAF2E3-1E29-476D-BEB3-FD608EBD92A2@cs.rice.edu> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Angela Zhu Subject: Re: [Caml-list] Problem with precedence declaration in .mly file Date: Wed, 31 Oct 2007 08:51:01 -0500 To: Peter Ilberg X-Mailer: Apple Mail (2.752.3) X-Spam: no; 0.00; ocamlyacc:01 ocamlyacc:01 syntax:01 angela:98 angela:98 2007,:98 wrote:01 precedence:01 precedence:01 caml-list:01 mly:01 grammar:02 declaration:02 seems:03 zhu:04 On Oct 31, 2007, at 6:52 AM, Peter Ilberg wrote: > > I have no experience with ocamlyacc, but looking at your grammar > below, it seems that you don't need the 'value PLUS exp' etc rules. > All these cases should be covered already by the 'exp PLUS exp' > rules at the beginning and the 'value' rule at the end. > > Try removing the 'value PLUS exp' rules. Maybe ocamlyacc gets > confused if it has two sets of productions that it has to > disambiguate with precedence rules. I removed 'value PLUS exp' rules. The precedence is still not correct, what is more, 1+ t (with t declared) gives a syntax error. Thanks, Angela > > --- Peter