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 MAA11005; Sat, 10 Jan 2004 12:15:54 +0100 (MET) 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 MAA10704 for ; Sat, 10 Jan 2004 12:15:52 +0100 (MET) Received: from mail1.tpgi.com.au (mail.tpgi.com.au [203.12.160.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0ABFn525707; Sat, 10 Jan 2004 12:15:50 +0100 (MET) Received: from 203-219-225-166-syd-ts24-2600.tpgi.com.au (203-219-225-166-syd-ts24-2600.tpgi.com.au [203.219.225.166]) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id i0ABFg604881; Sat, 10 Jan 2004 22:15:46 +1100 Subject: Re: [Caml-list] 3.07: debug information on camlp4-processed files is missing the file name? From: skaller Reply-To: skaller@tpg.com.au To: Damien Doligez Cc: Caml List In-Reply-To: <1ACD826A-4291-11D8-BEFF-00039310CAE8@inria.fr> References: <1ACD826A-4291-11D8-BEFF-00039310CAE8@inria.fr> Content-Type: text/plain Message-Id: <1073733329.25418.19.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 10 Jan 2004 22:15:30 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 3.07:01 camlp:01 tpg:99 2004:99 damien:01 annotations:01 doen't:01 annotations:01 tpg:99 glebe:01 2037,:01 9660:01 tokens:01 encode:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 2004-01-09 at 21:46, Damien Doligez wrote: > On Thursday, January 8, 2004, at 04:38 PM, skaller wrote: > > > Are you also teaching it to respect the original source > > file name? > > If you mean to heed the cpp-like "# " annotations Yes, that's what I mean. > then yes, that is planned. Good, thanks! > > Ocamlyacc/lex doen't seem to allow for that either. > > I'm not sure I understand this remark. ocamlyacc and ocamllex > do insert these annotations in the code they generate. Yeah, but they do not *read* annotations inserted by the program that generated the .mll and .mly files as far as I know? BTW: is there any plan to fix the parser so it uses an abstract token source, rather than a lexbuf? This seems a good use for classes, but the parser requests for source information (as well as tokens) must somehow be made into user plugable function calls. My parsers are all completely separated from the lexer. I encode locations in each token. Using a lexbuf to do that is impossible: I have to process #include like directives which of course create a stack of lexbufs. Thus there is no possibility a single real lexbuf permanently attached to the parser makes any sense for me .. Lexing is expensive .. storing the location in each lexbuf variable even if you're not recursing down include files would be quite expensive .. just so the parser can report an error which may not exist. -- John Max Skaller, mailto:skaller@tpg.com.au snail:25/85c Wigram Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850. Checkout Felix: http://felix.sf.net ------------------- 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