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


Tomohiro Matsuyama wrote:
Hi, all

I have been working on implementing a tool-set of code assistance called GCCSense, which enables code-completion for C/C++ in editors or a terminal.

http://cx4a.org/software/gccsense/

GCCSense depends on its own GCC which has special options for code assistance such like -code-completion-at:

    $ cat
    #include <string>
    int main()
    {
        std::string s;
        s.
    }
    $ # Print completion candidates at line 5 and column 7 of a.cc
    $ g++-code-assist -fsyntax-only -code-completion-at=a.cc:5:7 a.c

Now, I have the following problems:

* Hard to build that GCC for users
* Hard to maintain that GCC for me

Plugin might be a solution for them. Finally, however, I found that there is no proper plugin entrances for code assistance. As you may understand if you read an attached patch, GCCSense needs to handle quickly a special token for code-completion after particular tokens such as "." and "->" in parser phase.

Is there any good solution for this ?
Or could you implement such plugin entrances for code assistance ?

Thanks.
Tomohiro Matsuyama



I did suggest (in a previous private emaol) to Tomohiro to consider making his g++-code-assist a proper GCC plugin. I even dared suggesting him to make it a GCC MELT module (see http://gcc.gnu.org/wiki/MiddleEndLispTranslator for more about GCC MELT).

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.

What do other people think?

Regards.

--
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]