From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA27289 for caml-red; Thu, 1 Feb 2001 08:38:03 +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 SAA08932 for ; Wed, 31 Jan 2001 18:16:26 +0100 (MET) Received: from batman.labri.u-bordeaux.fr (batman.labri.u-bordeaux.fr [147.210.8.5]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f0VHGPT06619 for ; Wed, 31 Jan 2001 18:16:25 +0100 (MET) Received: from philemon.labri.u-bordeaux.fr (root@philemon [147.210.8.129]) by batman.labri.u-bordeaux.fr (8.8.7/8.8.7) with ESMTP id SAA01449 for ; Wed, 31 Jan 2001 18:19:57 +0100 (MET) Received: from labri.u-bordeaux.fr (IDENT:reveille@localhost.localdomain [127.0.0.1]) by philemon.labri.u-bordeaux.fr (8.9.3/8.8.8/Debian/GNU) with ESMTP id SAA07332 for ; Wed, 31 Jan 2001 18:16:23 +0100 Message-ID: <3A784863.78765C0@labri.u-bordeaux.fr> Date: Wed, 31 Jan 2001 18:16:19 +0100 From: Laurent Reveillere Organization: LaBRI, University of Bordeaux, FRANCE X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: fr, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: ocamlyacc/ocamllex problems Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr I am writing a parser that uses Parsing.rhs_start and Parsing.rhs_end in a rule. The problem is the following, 1) If I use a simple rule in the lexer that matches a token all is fine. ex: | "'" ['0' '1' '*' '.']+ "'" { ... } 2) If I use an automata in the lexer for matching the same token, the results of Parsing.rhs_start and Parsing.rhs_end are wrong. ex: | "'" { ... bits lexbuf ... } and bits = parse | '\'' { ... } | ['0' '1' '.' '*' ] { ... } | eof { ... } | _ { ... } Here is the ouput of a debug printf for rhs_start and rhs_end values case 1) Debug: pats='1..00000' at (964,965) case 2) Debug: pats='1..00000' at (955,965) I am not sure to undertand the reasons of my problem? -- Laurent