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 UAA08468; Thu, 12 Aug 2004 20:13:57 +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 UAA07966 for ; Thu, 12 Aug 2004 20:13:56 +0200 (MET DST) Received: from plato.rocketdogcreative.com (plato.rocketdogcreative.com [66.139.78.99]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i7CIDsmL005660 for ; Thu, 12 Aug 2004 20:13:55 +0200 Received: from [10.0.1.3] (65-103-213-184.tcsn.qwest.net [65.103.213.184]) by plato.rocketdogcreative.com (8.11.6/8.11.6) with ESMTP id i7CIDt106873; Thu, 12 Aug 2004 11:13:55 -0700 In-Reply-To: <411BB09A.7010307@trdlnk.com> References: <93BB4D7C-EC83-11D8-9939-000A95C19BAA@Avisere.com> <411BB09A.7010307@trdlnk.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <7D827B04-EC8B-11D8-9939-000A95C19BAA@Avisere.com> Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: David McClain Subject: Re: [Caml-list] Context Free Grammars? Date: Thu, 12 Aug 2004 11:14:45 -0700 To: Joshua Smith X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 411BB362.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; mcclain:01 mcclain:01 caml-list:01 descent:01 fragment:01 descent:01 token:01 threaded:02 recursive:03 recursive:03 suppose:03 argument:03 ocamlyacc:05 grammar:05 mean:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Out of curiosity, why not use recursive descent parsing instead of > ocamlyacc? > Well, not a bad idea... I suppose. It would give me better control over the course of things. I had the impression that YACC was a much faster system, being table driven and all. And possibly less bulky in generated code, but that isn't much of an argument in its favor today... The problems I am seeing have to do with factoring the grammar, similar to factoring threaded code. However the parent trees of these factors have very different semantic notions about what that fragment should mean. Recursive descent would certainly handle this better. I am not a YACC expert (no kidding!?) but I always had the notion that nonterminal reduction trees would somehow guide the reduce decisions. Now, however, it appears that YACC is simply looking blindly for syntactic token chains and reducing on them with absolutely no notion of who might be interested in the result. Kind of takes the wind out of my ancient understandings of YACC. [So I guess I was writing my grammars as though there were some kind of recursive descent engine in control. Not apparently so...] David McClain Senior Corporate Scientist Avisere, Inc. david.mcclain@avisere.com +1.520.390.7738 (USA) ------------------- 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