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 KAA29717; Tue, 21 Sep 2004 10:26:39 +0200 (MET DST) 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 KAA28197 for ; Tue, 21 Sep 2004 10:26:38 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8L8QcLK020229 for ; Tue, 21 Sep 2004 10:26:38 +0200 Received: from [192.168.0.2] (planar.net0.nerim.net [213.41.168.102]) by kraid.nerim.net (Postfix) with ESMTP id B27C341C10; Tue, 21 Sep 2004 10:26:37 +0200 (CEST) In-Reply-To: <1095691464.2580.554.camel@pelican.wigram> References: <414B602F.2020400@clemson.edu> <16718.41346.210917.885719@gargle.gargle.HOWL> <1095691464.2580.554.camel@pelican.wigram> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: caml-list From: Damien Doligez Subject: Re: [Caml-list] Lexing.lexeme_start_p broken? Date: Tue, 21 Sep 2004 10:26:38 +0200 To: skaller@users.sourceforge.net X-Mailer: Apple Mail (2.619) X-Miltered: at concorde with ID 414FE5BE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 44,:01 flx:01 flx:01 char:01 tokens:01 tokens:01 dummy:01 token:01 token:01 doligez:01 doligez:01 sep:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sep 20, 2004, at 16:44, skaller wrote: > How does that help, if the tokeniser isn't using the lexbuf? > Here's my parser: > > let parse_tokens (parser:'a parser_t) (tokens: Flx_parse.token list) = > let toker = (new tokeniser tokens) in > try > parser (toker#token_src) (Lexing.from_string "dummy" ) > with _ -> > toker#report_syntax_error; > raise (Flx_exceptions.ParseError "Parsing Tokens") > > The token supplying function never looks at the lexbuf. > The parser does, to report errors, so I have to trash > the parser exceptions, since the locations are wrong. The token supplying function is supposed to _update_ the lexbuf, if you want the parser to report the correct locations. ocamllex does some of the work by updating the char count, the rest is up to the lexer itself. -- Damien ------------------- 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