SoC Project: Incremental Parsing (of C++)
Ian Lance Taylor
iant@google.com
Tue Mar 20 21:37:00 GMT 2007
"Doug Gregor" <doug.gregor@gmail.com> writes:
> On 20 Mar 2007 17:04:56 -0500, Gabriel Dos Reis <gdr@cs.tamu.edu> wrote:
> > That defered parsing might work with C (I don't really know), but it
> > certainly is problematic with C++ because there are bindings that
> > need to be in overload sets, and you cannot accurately capture those if
> > you don't parse the function bodies. Sadly.
>
> What if you were able to "roll back" name lookup, so that it was able
> to resolve names as if it were at an earlier point in the translation
> unit? If one were to, say, annotate declarations with their position
> in the translation unit (line and column number, in the trivial case),
> and then modify name lookup so that we could say, "find the name foo
> as if we were looking from line number 50, column 3," it might be
> possible to parse function bodies later on.
OK, now I get it.
I believe that would be a desirable feature anyhow, because I believe
it would make name lookups more efficient (and thus perhaps obviate
the whole issue). But it is clearly nontrivial.
Ian
More information about the Gcc
mailing list