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 SAA21777; Fri, 13 Aug 2004 18:42:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA21438 for ; Fri, 13 Aug 2004 18:42:42 +0200 (MET DST) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i7DGgYmL005069; Fri, 13 Aug 2004 18:42:34 +0200 Received: by yquem.inria.fr (Postfix, from userid 18180) id A13BDBF60; Fri, 13 Aug 2004 18:42:34 +0200 (CEST) Date: Fri, 13 Aug 2004 18:42:34 +0200 From: Xavier Leroy To: Brian Hurt Cc: David McClain , Ocaml Mailing List Subject: Re: [Caml-list] CFG's and OCaml Message-ID: <20040813164234.GA27886@yquem.inria.fr> References: <73EC7D25-ED42-11D8-99DF-000A95C19BAA@Avisere.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Miltered: at nez-perce with ID 411CEF7A.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 precedences:01 ocaml's:01 precedences:01 ocaml's:01 tweaking:01 compilers:01 ocaml:01 ocaml:01 lex:04 lex:04 incorrect:04 ocamlyacc:05 grammar:05 grammar:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > My number one complaint with > Ocaml is the number of shift/reduce (and hidden reduce/reduce) conflicts > in it's grammar. These bite me on a regular basis. >>From this message and earlier messages of yours, I think you are under the wrong impression that precedences and associativities can be used (and would be used in OCaml's grammar) to resolve (or "hide" as you say) reduce/reduce conflicts. This is incorrect: Yacc uses precedences and associativities to resolve (i.e. choose to shift or choose to reduce) shift/reduce conflicts only. If there were reduce/reduce conflicts in OCaml's grammar, Yacc would say so and no among of precedence tweaking would hide them. This said, it is true the OCaml grammar uses precedences a lot to deal with shift/reduce situations. It is equally true that some of these situations correspond to syntactic corners of the language that can confuse the user. Concerning David McClain's problems, I can only repeat the advice given at the beginning of the ocamlyacc chapter in the OCaml manual: `` Readers unfamiliar with lex and yacc are referred to ``Compilers: principles, techniques, and tools'' by Aho, Sethi and Ullman (Addison-Wesley, 1986), or ``Lex & Yacc'', by Levine, Mason and Brown (O'Reilly, 1992). '' (The latter is more practice-oriented.) - Xavier Leroy ------------------- 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