From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA05382 for caml-redistribution; Thu, 30 Dec 1999 19:46:56 +0100 (MET) 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 TAA13168 for ; Thu, 30 Dec 1999 19:33:57 +0100 (MET) Received: from fiji01.liquidmarket.com (oahu02.liquidmarket.com [208.244.147.130]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA29952 for ; Thu, 30 Dec 1999 19:33:55 +0100 (MET) Received: from maui02.liquidmarket.com (maui02.liquidmarket.com [192.168.1.65]) by fiji01.liquidmarket.com (8.9.3/8.9.3) with ESMTP id KAA12278; Thu, 30 Dec 1999 10:30:39 -0800 Message-Id: <199912301830.KAA12278@fiji01.liquidmarket.com> X-Mailer: exmh version 2.0.2 From: Francois Rouaix To: skaller cc: caml-list@inria.fr Subject: Re: ocamlyacc/lex reentrancy In-reply-to: Your message of "Sat, 25 Dec 1999 08:31:11 +1100." <3863E61F.E27029EF@maxtal.com.au> Reply-To: frouaix@liquidmarket.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 30 Dec 1999 10:30:39 -0800 Sender: weis I don't use ocamlyacc, but I do have lots of ocamllex lexers that need to be reentrant. I don't remember if I've posted that trick to the list already, but this is what you can do: In your opening section of the lexer: { type t = let create_data () = .... (* unit -> t *) } and then for all rules, use rule somerule = parse | somepattern { (fun lexdata -> action) } And, when invoking a lexer function or entry point, you need to pass the additionnal argument, a in somerule lexbuf lexdata --f