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 RAA04449; Sun, 15 Aug 2004 17:31:28 +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 RAA04081 for ; Sun, 15 Aug 2004 17:31:27 +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 i7FFVQRM020517 for ; Sun, 15 Aug 2004 17:31:26 +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 i7FFVDJ09802; Sun, 15 Aug 2004 10:31:14 -0500 (CDT) Date: Sun, 15 Aug 2004 10:39:12 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Jon Harrop cc: Ocaml Mailing List Subject: Re: [Caml-list] CFG's and OCaml In-Reply-To: <200408150226.53550.jon@jdh30.plus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 411F81CE.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 operands:01 operands:01 ocaml:01 ocaml:01 ast:02 ast:02 binary:02 node:02 parser:02 tree:02 wrote:03 trick:03 redirect:95 pair:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 15 Aug 2004, Jon Harrop wrote: > I believe you are unnecessarily constraining the AST to be a binary > tree. No, I was trying to make a graphical point. > I think Skaller referred to the implementation of a parser for this as a > "chain operator", which I understand to be a way non-associative operators > may be parsed to create a node in the AST with a list of operands, rather > than the usual pair of operands. Yep. But notice where the trick was- it wasn't in the yacc grammar, it was in the Ocaml code. He parsed the sequence as: < / \ a < / \ b c Forget I said AST. How are the yacc rules applied? -- "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