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 TAA24133; Wed, 25 Feb 2004 19:07:47 +0100 (MET) 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 TAA23622 for ; Wed, 25 Feb 2004 19:07:46 +0100 (MET) Received: from amber.ccs.neu.edu (amber.ccs.neu.edu [129.10.116.51]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i1PI7mIq001572 for ; Wed, 25 Feb 2004 19:07:48 +0100 Received: from denali.ccs.neu.edu (denali.ccs.neu.edu [129.10.116.200]) by amber.ccs.neu.edu (Postfix) with ESMTP id 1C904542AE for ; Wed, 25 Feb 2004 13:07:45 -0500 (EST) Received: from sproctor by denali.ccs.neu.edu with local (Exim 4.20) id 1Aw3Rg-0006oq-Vz for caml-list@inria.fr; Wed, 25 Feb 2004 13:07:44 -0500 Date: Wed, 25 Feb 2004 13:07:44 -0500 From: Sean Proctor To: caml-list@inria.fr Subject: [Caml-list] start conditions in ocamllex Message-ID: <20040225180744.GA23865@ccs.neu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; sean:99 proctor:99 internals:01 implementor:01 entrypoint:01 sean:99 regexp:01 token:01 token:01 syntax:02 string:03 parse:04 ocamllex:05 ocamllex:05 solved:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Has anyone thought of implementing start conditions for ocamllex? I have some problems that require keeping some state. They would be very simply solved with start conditions. I don't know much about the internals of ocamllex, but if the implementor of it thinks this is a good idea, I would be interested in writing this. I was thinking a good syntax would be something like: regexp where condition ex: condition startcondition rule entrypoint = parse 'a' { start startcondition; A_TOKEN } | 'a' where startcondition { finish startcondition; B_TOKEN } so a string of a's would give alternating A_TOKEN and B_TOKEN. Sean ------------------- 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