From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id DE545BC69 for ; Wed, 2 May 2007 13:56:45 +0200 (CEST) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l42BuZR2031155; Wed, 2 May 2007 13:56:35 +0200 Received: by yquem.inria.fr (Postfix, from userid 18965) id A3015BC69; Wed, 2 May 2007 13:56:35 +0200 (CEST) Date: Wed, 2 May 2007 13:56:35 +0200 From: Francois Pottier To: skaller Cc: Joel Reymont , menhir-list@yquem.inria.fr, Caml List Subject: Re: [Caml-list] Re: [Menhir-list] There's an elephant in the room: Solution to sharing a symbol table Message-ID: <20070502115635.GA21560@yquem.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <1EE80473-541D-478D-97F8-06A1B5F65F79@gmail.com> <20070502054411.GB726@yquem.inria.fr> <8C011A98-CE76-4A83-B24C-BA37B66DF15D@gmail.com> <1178096690.13660.80.camel@rosella.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1178096690.13660.80.camel@rosella.wigram> User-Agent: Mutt/1.5.9i X-Miltered: at discorde with ID 46387C73.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; functor:01 parser:01 ocamllex:01 parser:01 recursive:01 functor:01 recursive:01 elephant:98 invoke:01 wrote:01 cristal:01 recursively:01 caml-list:01 pottier:01 pottier:01 Hello, On Wed, May 02, 2007 at 07:04:50PM +1000, skaller wrote: > You can't. Don't be confused by functor interface in Menhir. > It is useless for maintaining state. I don't think so... > What you need is a feature I asked for .. the possibility of > passing a state argument to the parser the same way you can > now do for ocamllex: you just write > > rule fred state = parse ... I remember our discussion. What you need primarily, if I recall correctly, is the ability for a semantic action to recursively invoke the parser itself. This happens to work if the parser is defined as a recursive function, and does not (currently) work when the parser is defined as a functor, because the functor is not declared as recursive. We could, in principle, make it a recursive functor, which would allow recursive invocations. -- François Pottier Francois.Pottier@inria.fr http://cristal.inria.fr/~fpottier/