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 UAA00534; Sun, 4 Aug 2002 20:58:24 +0200 (MET DST) 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 UAA00614 for ; Sun, 4 Aug 2002 20:58:23 +0200 (MET DST) Received: from viola.sinor.ru (viola.sinor.ru [217.70.106.9]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g74IwMf20434 for ; Sun, 4 Aug 2002 20:58:22 +0200 (MET DST) Received: from sibnet.ru (tlg5-ppp68.sibnet.ru [217.70.116.68]) by viola.sinor.ru (8.12.3/8.12.3) with ESMTP id g74IwIb8018002 for ; Mon, 5 Aug 2002 01:58:19 +0700 Received: by sibnet.ru id m17bQbK-001EoZC; Mon, 5 Aug 2002 01:59:38 +0700 (NOVST) Date: Mon, 5 Aug 2002 01:59:38 +0700 From: Max Kirillov To: caml-list@inria.fr Subject: [Caml-list] stream parser jump-back Message-ID: <20020805015938.C17263@max.home> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Sender: Max Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello! Is it possible in a stream parser to parse again already accepted token. An example (a little incorrect) follows. I'd like to make this in camlp: A(B).c --> let module M = A(B) in M.c To do that, i write (scematically): expr: [[ m = module_expr; "."; e = expr -> ... ]] "Note" may be parsed as either module expression or a usual one. But, expr cannot be followed by a period (that's wrong, I know, but let's forget about it for a while). Then, writing None, I've got the Stream.Error and parsing error. So, can I write something like: [[ TRY (m = module_expr); "."; ... and so on, do get parsing failure insted of error, and push the successful head of failed structute back into a stream, to parse it again (as an expr now)? Thanks for your attention. Max. ------------------- 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