caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@tpg.com.au>
To: Damien Doligez <damien.doligez@inria.fr>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] 3.07: debug information on camlp4-processed files is missing the file name?
Date: 10 Jan 2004 22:15:30 +1100	[thread overview]
Message-ID: <1073733329.25418.19.camel@localhost.localdomain> (raw)
In-Reply-To: <1ACD826A-4291-11D8-BEFF-00039310CAE8@inria.fr>

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


  reply	other threads:[~2004-01-10 11:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-05 19:27 Aleksey Nogin
2004-01-05 20:18 ` Damien Doligez
2004-01-07  5:47   ` Aleksey Nogin
2004-01-07 12:50     ` Damien Doligez
2004-01-08  1:29       ` Aleksey Nogin
2004-01-08  8:17   ` Stefano Zacchiroli
2004-01-08  9:49     ` Damien Doligez
2004-01-08 15:38       ` skaller
2004-01-09 10:46         ` Damien Doligez
2004-01-10 11:15           ` skaller [this message]
2004-01-09  8:41       ` Stefano Zacchiroli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1073733329.25418.19.camel@localhost.localdomain \
    --to=skaller@tpg.com.au \
    --cc=caml-list@inria.fr \
    --cc=damien.doligez@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).