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 VAA23806; Fri, 14 Dec 2001 21:57:06 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 VAA22161 for ; Fri, 14 Dec 2001 21:57:06 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBEKv5j16262 for ; Fri, 14 Dec 2001 21:57:05 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id VAA12205 for caml-list@inria.fr; Fri, 14 Dec 2001 21:57:05 +0100 Date: Fri, 14 Dec 2001 21:57:05 +0100 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] parsing: old and new ways Message-ID: <20011214215705.A12178@verdot.inria.fr> References: <3C1A569B.3E718623@wanadoo.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C1A569B.3E718623@wanadoo.fr>; from philippe.esperet@wanadoo.fr on Fri, Dec 14, 2001 at 08:44:27PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Fri, Dec 14, 2001 at 08:44:27PM +0100, Philippe Esperet wrote: > # Grammar.Entry.parse mirror (Stream.of_string "abcba");; > Exception: > Stdpp.Exc_located ((0, 5), Stream.Error "illegal begin of mirror"). > > What am I missing? The problem is the lexer you use. You took "Plexer.make ()" which considers "abcba" as a token, therefore not matching the keywords "a", "b" or "c". To get the same result you should give the string "a b c b a" as input... ... or use another lexer, not "Plexer.make ()", which would return each input character as token. It should be easy. If you need help to write it, ask me. -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr