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 QAA11958 for caml-redistribution; Wed, 2 Feb 2000 16:03:34 +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 CAA06620 for ; Tue, 1 Feb 2000 02:51:59 +0100 (MET) Received: from www.nextsolution.co.jp (www.nextsolution.co.jp [202.33.212.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id CAA23417 for ; Tue, 1 Feb 2000 02:51:45 +0100 (MET) Received: from sparc1.nextsolution.co.jp (sparc1 [202.235.80.1]) by www.nextsolution.co.jp (8.9.3/3.7W) with SMTP id KAA12530 for ; Tue, 1 Feb 2000 10:48:10 +0900 (JST) Received: from sparc1.nextsolution.co.jp by sparc1.nextsolution.co.jp (SMI-8.6/SMI-SVR4) id KAA02299; Tue, 1 Feb 2000 10:51:02 +0900 From: "Frank A. Christoph" To: "CAML List" Subject: Stream parsers Date: Tue, 1 Feb 2000 10:53:30 +0900 Message-ID: <000001bf6c57$23c30080$0150ebca@nextsolution.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: weis I have a problem with reporting error locations in stream parsers. Using the count at the beginning of a parser match, I can get the token number of the first element that matched a clause. But when the parser expression looks like this (using the new syntax): parser bp [< e = p; 'T ?? err bp >] -> ... you have to bend over backwards to figure out what token number the error could have occurred on, since p could have parsed an arbitrary number of tokens already. Is there any easy way to work around this? Would it be possible to change the semantics of the expression on the rhs of ?? so that it is a function which gets passed the token count after having matched the previous stream component (p, in my example)? Or, if you want to maintain retain the current semantics, add a new form with three ?'s... --fac