[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs contributions, C and Lisp

From: Perry E. Metzger
Subject: Re: Emacs contributions, C and Lisp
Date: Tue, 6 Jan 2015 15:45:39 -0500

On Tue, 06 Jan 2015 22:37:01 +0200 Eli Zaretskii <address@hidden> wrote:
> > Date: Tue, 6 Jan 2015 14:39:33 -0500
> > From: "Perry E. Metzger" <address@hidden>
> > Cc: Eli Zaretskii <address@hidden>, address@hidden,
> >     address@hidden, address@hidden
> > 
> > Say you want to do a global refactoring of a function that alters
> > the parameters it takes -- the sort of thing modern IDEs do very
> > well.
> Please also describe why the AST is needed for completion, which was
> the original topic discussed here.

Oh, well for C and C++, given that you can't know the scope of an
identifier (or even what it is -- see the awful C typedef problem in
parsing) without pretty good scope and symbol table info, I had
thought that was obvious. If it isn't, I'm happy to explain in
detail, but I had thought that Richard had written a bunch of the
early GCC stuff himself and understood that.

In a modern IDE, you can complete anything -- struct members or
object member variables/functions, type names, etc., etc., and you
need what are essentially compiler data structures to get that stuff,
and you need the AST to understand the context in which you're
requesting the completion. You can't even know that the variable
"foo" is an object of class "baz" and thus that when you hit complete
on foo.con that it should look for the members that start with "con"
in objects of class "baz" (say "construct()" or some such).

Perry E. Metzger                address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]