Hello mistar, may i ask what functions the plugin will be offered?
Basically, it should highlight the c++ syntax in a semantic way.
For example, in highlighting based on lexers, all identifiers have the same color.
In semantic highlight on the other hand, variables, types, functions, etc. are highlighted in different ways.
If you work for some time with semantic highlight and then switch back to the usual, lexer-based highlight,
you notice the difference as if you switch from lexer-based highlight to no highlight at all
.
Some tools provide semantic highlight, eg. Eclipse CDT or KDevelop, but they lack a support for the new C++11 standard.
Also, both have internal parsers that are not developed to support the new standard.
Since libclang (see
http://clang.llvm.org; nb. version 3.1 is about to be released) has the best support for the new standard
and it provides parser API, it is relatively easy to write a plugin for C::B.
So far I have written a very simple tool that highlights a source in a semantic way (so it can be done using manual styling in Scintilla).
Now I'm working on retrieving compiler options (include directories, defines, etc.) so that all declarations are accessible to the libclang parser
(otherwise it highlights fragments of code as invalid).
Since some options are given implicitly (eg. via `wx-config --cxxflags`) I'm using wxExecute to retrieve the options, but it messes up the C::B user interface
on C::B sturtup (it seems that wxAuiManager and wxExecute interfere in some way)... any ideas how to do this in another way?
(The output of C::B on stdout contains "caching results from `wx-config --cxxflags`", so maybe I can use this cache?)
I've tried also to do this in a separate thread but the thread freezes (perhaps wxExecute in not thread-safe).
@MortenMacFly: Thanks, I'll have a look.