Addin exceptions in SvStream
Lubos Lunak
l.lunak at suse.cz
Mon Dec 17 06:07:40 PST 2012
On Saturday 15 of December 2012, Marc-André Laverdière wrote:
> Sounds to me like a big learning curve is involved - which is going to
> be very distracting from research activities.
Depends. It is something new to learn, but the API is rather intuitive.
> If someone can give me link to a good tutorial that gives me a good
> feeling about it I may bite.
I don't think there's anything like that (yet, at least). The Clang tutorials
I could find only say how to create a very basic plugin, which is something
I've already sorted out for LO, so now it is about writing actual code using
Clang internal API (http://clang.llvm.org/doxygen/).
That said, at this point it should be enough just to give it a try. Under
compilerplugins/clang there are already several plugins, with 2 of them
(lclstaticfix.cxx and postfixincrementfix.cxx) doing code rewriting. Writing
a new one would mean something like looking at what's there, compile a
relevant piece of code with '-Xclang -ast-dump' options to get AST dump to
see how Clang represents it internally, and write a new plugin using the
relevant classes mentioned in the AST dump (and I find it much simpler to
check them out in CLANGDIR/include/clang/AST/ rather than the doxygen
documentation).
It's not exactly trivial, but it's probably simpler to get than a lot of LO
code. If you decide to give it a try, feel free to ask if you run into
trouble.
--
Lubos Lunak
l.lunak at suse.cz
More information about the LibreOffice
mailing list