Re: [anjuta-devel] Code assistance plugin



Hello,

I'm a little in desperate, because it's the first time that I use interfaces in C, so in recent days I spend some time to learn how it works.

I tried to split the parser part from the language-support plugin into an own plugin. To deal each language parser in the same way I wrote an interface, because each parser should work like an adapter.

Firstly I moved the parser part from language-support-cpp-java plugin into a new plugin named parser-cxx and first of all I adapted libanjuta/interfaces/libanjuta.idl for the cxx parser. The new parser interface is called IAnjutaParser. The parser-cxx plugin will only activated/loaded, if C or C++ file is opened. I linked the public methods of cxx parser to the interfaces methods (ianjuta_parser_init, ianjuta_parser_deinit and ianjuta_parser_process_expression).

Then I added a new parameter to the cpp_java_assist_new method to outreach the IAnjutaParser object from plugin.c to cpp-java-assist.c, because the parser function is only needed by the assist.

I get the IAnjutaParser object throw execute the following code:

anjuta_shell_get_interface (ANJUTA_PLUGIN (lang_plugin)->shell, IAnjutaParser, NULL)

I'm not sure, if this is the right way to get this object. I copied it from another place.

I can compile the code and can execute anjuta too, but I get some errors in the terminal:

* (anjuta:11447): libanjuta-interfaces-CRITICAL **: ianjuta_parser_init: assertion `IANJUTA_IS_PARSER(obj)' failed * (anjuta:11447): libanjuta-interfaces-CRITICAL **: ianjuta_parser_deinit: assertion `IANJUTA_IS_PARSER(obj)' failed * (anjuta:11447): libanjuta-interfaces-CRITICAL **: ianjuta_parser_process_expression: assertion `IANJUTA_IS_PARSER(obj)' failed

So made I some mistakes in the procedure?

To prevent some question: Firstly I want move each parser in a separate plugin. If this works I'll merge the completion code in an extra plugin called completion-engine, which manage the parser plugins. Maybe there is no common completion code, in this case the completion code of each language-support plugin will move to the parser plugins.

My last question is how can I activate the debug mode. I already read the manual (http://developer.gnome.org/libanjuta/3.5/libanjuta-Debugging.html), but I don't know, where I should set the flags.

Regards Moritz



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