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 FAA06117; Tue, 6 Aug 2002 05:04:00 +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 FAA06057 for ; Tue, 6 Aug 2002 05:03:58 +0200 (MET DST) Received: from viola.sinor.ru (viola.sinor.ru [217.70.106.9]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7633vD18108 for ; Tue, 6 Aug 2002 05:03:57 +0200 (MET DST) Received: from sibnet.ru (tlg5-ppp86.sibnet.ru [217.70.116.86]) by viola.sinor.ru (8.12.3/8.12.3) with ESMTP id g7633qb8025026 for ; Tue, 6 Aug 2002 10:03:53 +0700 Received: by sibnet.ru id m17buex-001EoZC; Tue, 6 Aug 2002 10:05:23 +0700 (NOVST) Date: Tue, 6 Aug 2002 10:05:23 +0700 From: Max Kirillov To: caml-list@inria.fr Subject: Re: [Caml-list] stream parser jump-back Message-ID: <20020806100523.D17263@max.home> Mail-Followup-To: caml-list@inria.fr References: <20020805015938.C17263@max.home> <20020805084039.F29829@verdot.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020805084039.F29829@verdot.inria.fr>; from daniel.de_rauglaudre@inria.fr on Mon, Aug 05, 2002 at 08:40:39AM +0200 X-Sender: Max Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Aug 05, 2002 at 08:40:39AM +0200, Daniel de Rauglaudre wrote: >> Is it possible in a stream parser to parse again already >> accepted token. > No. Sad. Well, in the case I can simply note that little of module_expr may be misparsed as expr, and define something like module_expr_or_expr: [[ ... -> (<:module_expr< ...>>,<:expr< ...>>)]] expr: [[ (m1,_) = module_expr_or_expr; "." ... | (_,e1) = module_expr_or_expr -> e1 ]] and so on. > You can add a grammar entry defined by a parser. There are examples of > that in the "normal" syntax (pa_o.ml, in Camlp4, subdirectory etc). > See entries "test_ctyp_minusgreater", "test_label_eq", > "test_typevar_list_dot". But I consider they are "hacks" to make > some situation work. Thank you. That funcs use Stream.npeek to get a content of the stream, than parse it manually. Hmm... 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