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 QAA22561; Tue, 22 Oct 2002 16:21:15 +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 QAA22167 for ; Tue, 22 Oct 2002 16:21:14 +0200 (MET DST) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9MELE514454 for ; Tue, 22 Oct 2002 16:21:14 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id QAA16984 for caml-list@inria.fr; Tue, 22 Oct 2002 16:21:14 +0200 Date: Tue, 22 Oct 2002 16:21:14 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] Camlp4 pretty print comments Message-ID: <20021022162114.K3558@verdot.inria.fr> References: <20021022111642R.garrigue@kurims.kyoto-u.ac.jp> <20021022131530.A3558@verdot.inria.fr> <20021022131838.GB23724@cs.unibo.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021022131838.GB23724@cs.unibo.it>; from zack@cs.unibo.it on Tue, Oct 22, 2002 at 03:18:38PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Tue, Oct 22, 2002 at 03:18:38PM +0200, Stefano Zacchiroli wrote: > > Why comments are not represented? It's because the lexer don't return > them or because the standard ocaml grammar rules skip them? > > If the first case does apply, is possible to add a camlp4 rule to > retain them, right? Well, as Maxence Guesdon says, it is really a pain to retain them. Because it implies complicated actions in the lexer *and* in the parser. Storing the comments, as Sven luther suggests, well, why not? But it is complicated also. A simple solution would be to store... the whole input! This way I could read the "input file" in memory, and I am sure the change would be easy to program. I can do that, just for the case when the input is the standard one. Are you interested and OK for this solution, even if it uses more memory? (but now, machine memory spaces is big). -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- 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