Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2004-01-10 (11:15)
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,
snail:25/85c Wigram Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850. Checkout Felix:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: