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 TAA06912; Thu, 12 Aug 2004 19:17:18 +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 TAA06127 for ; Thu, 12 Aug 2004 19:17:17 +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 i7CHHGmL032601 for ; Thu, 12 Aug 2004 19:17:16 +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 i7CHHG105434 for ; Thu, 12 Aug 2004 10:17:16 -0700 Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: <93BB4D7C-EC83-11D8-9939-000A95C19BAA@Avisere.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list@inria.fr From: David McClain Subject: [Caml-list] Context Free Grammars? Date: Thu, 12 Aug 2004 10:18:07 -0700 X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 411BA61C.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 descent:01 context-free:99 ignores:01 unwieldy:01 descent:01 ocaml:01 syntax:02 syntax:02 parser:02 parser:02 tree:02 recursive:03 recursive:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I think my mind has been poisoned from exposure to recursive descent parsing... I am running into a huge number of reduce/reduce conflicts in OCamlYacc. It is beginning to dawn on me that Yacc really is for context-free grammars... (that's what they said! only now I'm starting to realize it..) So the question is, does OCaml actually have a CFG description? I'm confused about the similarity of patterns and expression from the viewpoint of CFG description. They share many similarities, and in the correct context there can be no confusion. But when I try to generate a parser it appears that pieces of expression syntax and pieces of pattern syntax are confusing the parser. If the parser really ignores any kind of context -- such as the parent tree for the subproduction -- then the lack of any context knowledge would certainly be confusing. Anyone have any hints about syntax transformations so that CFG's can really be used here? I read a tremendous number of references that indicate how nasty these reduce/reduce conflicts can be. I believe them. Trouble is they don't go very far in explaining how to fix these conflicts, other than to state that "you have a mistake in your grammar". Some references do hint that syntax description transformations can become unwieldy and unnatural to read. I have to stop thinking like recursive descent and try to view the universe as flat-land... 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