Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] 3.07: debug information on camlp4-processed files is missing the file name?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@t...>
Subject: Re: [Caml-list] 3.07: debug information on camlp4-processed files is missing the file name?
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 "# <line> <file>" 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