This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Code assistance with GCC


Daniel Jacobowitz wrote:
On Wed, Apr 21, 2010 at 01:12:37PM +0200, Basile Starynkevitch wrote:
However, I am not sure to understand why Tomohiro needs to hack the
GCC parser itself. I was thinking that he might instead write a
plugin which works at the Generic/TREE (or even perhaps  Gimple)
level.

That doesn't make sense. If you're doing code completion, then by definition, what you have now does not parse. If it doesn't parse, you can't build IL from it. A parser is pretty much all you need for code completion, not any of the rest of the compiler (e.g. Eclipse has just a parser and a syntax tree).


I agree, but I am not sure Tomohiro is doing code completion inside the source file (i.e. inside an incomplete source file which was not saved by the editor). I thought that his emacs mode was triggering his program (on a source file in a sane state, i.e. just after emacs having saved it) with the symbol to complete passed in argument.

In that case, his program has to consult the symbol tables & other information from a completely parsed & sane file, and this might be done as a plugin.

And if indeed he is doing completion an incomplete source, I am not sure that hacking GCC is the good approach...

Cheers.
--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]