From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA18482; Fri, 13 Aug 2004 17:41:44 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA15496 for ; Fri, 13 Aug 2004 17:41:43 +0200 (MET DST) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7DFffRM011218 for ; Fri, 13 Aug 2004 17:41:42 +0200 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i7DFfcJ12547; Fri, 13 Aug 2004 10:41:38 -0500 (CDT) Date: Fri, 13 Aug 2004 10:49:29 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: David McClain cc: caml-list@inria.fr Subject: Re: [Caml-list] CFG's and OCaml In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 411CE135.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 mcclain:01 expr:01 expr:01 reductions:01 compiler:01 ocaml:01 ocaml:01 int:01 int:01 parser:02 float:02 float:02 wrote:03 assign:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 13 Aug 2004, David McClain wrote: > Okay... here's a case where when I do "exactly" what the gurus at Inria > do, I get a reduce/reduce conflict, and yet when I build OCaml it does > not report any such conflicts. [I say "exactly" because obviously I'm > not...] > > simple_expr: > constant > ... > > simple_pattern: > signed_constant > ... > > constant: > INT > | FLOAT > > signed_constant: > constant > | MINUS INT > | MINUS FLOAT > ;; /* ---------------------------------------------------------- */ > > The reduce/reduce conflict comes on deciding whether to assign an INT > seen to signed_constant which will reduce to simple_pattern, or instead > to become constant which reduces to simple_expr. Both Inria and I do > completely different semantic reductions in these two cases, and so a > reduce/reduce conflict could be fatal here... When the compiler sees an int, which path should it take? My advice would be to remove the constant from signed_constant's patterns. > So, as so often happens with the master's touch, everything works fine > for them, but it doesn't for me. Why should this be, in this example > case? They're doing something evil- take a look at line 355 of parsing/parser.mly in 3.08.0. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners