From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr 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 2F339BB9A for ; Fri, 28 Oct 2005 09:12:02 +0200 (CEST) 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 j9S7C1YE010211 for ; Fri, 28 Oct 2005 09:12:01 +0200 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 JAA14217 for ; Fri, 28 Oct 2005 09:12:01 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j9S7Bw7E010204; Fri, 28 Oct 2005 09:12:00 +0200 Received: from rosella (ppp7-104.lns1.syd7.internode.on.net [59.167.7.104]) by smtp3.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id j9S7BuQc011606; Fri, 28 Oct 2005 16:41:57 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Parser state variables From: skaller To: Alain Frisch Cc: Caml Mailing List In-Reply-To: <4361C38B.8090309@inria.fr> References: <1130398547.7544.66.camel@rosella> <4361C38B.8090309@inria.fr> Content-Type: text/plain Date: Fri, 28 Oct 2005 17:11:56 +1000 Message-Id: <1130483516.28547.26.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4361CF41.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4361CF3E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 parser:01 frisch:01 ocamlyacc:01 ocamllex:01 workarounds:01 syntax:01 wrote:01 wrote:01 sourceforge:01 abstract:01 functions:01 functions:01 argument:01 data:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Fri, 2005-10-28 at 08:22 +0200, Alain Frisch wrote: > skaller wrote: > > Are there any plans to extend Ocamlyacc to allow state variables, > > in a manner similar to the recent extensions to Ocamllex to > > allow them? > > > > At present, there are two workarounds: > > Another one is to make semantic actions return functions which take the > state as an argument. This is similar to introducing a new data type to > represent pure concrete parse trees and then post-process these trees to > produce abstract syntax. Aha! Another win for higher order functions! Thanks for this insight. Dang -- so obvious when you see it :) -- John Skaller Felix, successor to C++: http://felix.sf.net