From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9E7FABB91 for ; Thu, 27 Jan 2005 21:17:15 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0RKHF1g014923 for ; Thu, 27 Jan 2005 21:17:15 +0100 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 VAA06278 for ; Thu, 27 Jan 2005 21:17:14 +0100 (MET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0RKHEQL015744 for ; Thu, 27 Jan 2005 21:17:14 +0100 Received: by wproxy.gmail.com with SMTP id 69so308637wra for ; Thu, 27 Jan 2005 12:17:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=a/24wzaVgwf7upEhFTgQ8SUtCZDFQSGIHWKJPU84vCP79pYOFOfrs0Z2jdjn+Lrk5kiQN0qbjk8jiSN74MfwYk0FNtDKDbRfqi3OMsW7XPFEpEgdozIB55J6l9T/1tN5qhbBia+j43MiMnqnXjqQypWB3r6reSiF6z+nd6fT38Y= Received: by 10.54.18.34 with SMTP id 34mr135216wrr; Thu, 27 Jan 2005 12:17:13 -0800 (PST) Received: by 10.54.5.8 with HTTP; Thu, 27 Jan 2005 12:17:13 -0800 (PST) Message-ID: <875c7e0705012712177a9e852@mail.gmail.com> Date: Thu, 27 Jan 2005 15:17:13 -0500 From: Chris King Reply-To: Chris King To: "O'Caml Mailing List" Subject: yacc style Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41F94C4B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41F94C4A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; grammar:01 ocamlyacc:01 parser:01 parser:01 parsed:01 defining:01 defining:01 imperative:01 imperative:01 tree:02 functional:02 parse:02 structure:04 structure:04 chris:05 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: I'm defining a grammar which, when parsed, returns an imperative structure (i.e. one which can't easily be created in a functional style). ocamlyacc is making this difficult for me, since there's no clean way to pass to the main parser function a structure on which to operate. Right now I'm getting around this by defining global references in the header of the parser and setting them before each call to the parser main function. Is it considered better style to instead have the parser return a parse tree, and then use that to generate the imperative structure, or is there a more direct way to do what I want to do? Thanks!