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 SAA07690; Sun, 15 Aug 2004 18:57:36 +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 SAA07404 for ; Sun, 15 Aug 2004 18:57:35 +0200 (MET DST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7FGvYRM029139 for ; Sun, 15 Aug 2004 18:57:35 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1BwOK6-000PMZ-Ll for caml-list@inria.fr; Sun, 15 Aug 2004 16:57:34 +0000 From: Jon Harrop To: Ocaml Mailing List Subject: Re: [Caml-list] CFG's and OCaml Date: Sun, 15 Aug 2004 17:54:15 +0100 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408151754.16162.jon@jdh30.plus.com> X-Miltered: at concorde with ID 411F95FE.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 2004:99 lalr:01 ocaml:01 checking:01 ast:02 ast:02 binary:02 tree:02 necessarily:02 enforce:02 wrote:03 data:03 pointed:04 mean:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 15 August 2004 16:39, Brian Hurt wrote: > Forget I said AST. How are the yacc rules applied? > ... Right, yes, I see what you mean. So we're talking about using LR(1), which is necessarily a binary tree (albeit of function calls and not AST), to build up non-binary-tree data structures. This kind of goes back to what I said originally about doing as much work as possible within LALR(1) and using post-processing to do the rest. Although, in this case, I think yacc will enforce correctness, e.g. even "ace" is correct etc., so the post-processing doesn't need to do any checking here. As Skaller pointed out off list, the ability to write "a<=b